Skip to content

Conversation

@Hixie
Copy link
Contributor

@Hixie Hixie commented Mar 16, 2023

Fixes #112676.
Fixes #97015.
Fixes #62107.
Fixes #38740.
Fixes #31911.
Fixes #29958.
Fixes #18108.
Fixes #17160.
Fixes #14243.
Fixes #3554.

@flutter-dashboard flutter-dashboard bot added a: animation Animation APIs d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos documentation f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Mar 16, 2023
@Hixie Hixie marked this pull request as ready for review March 16, 2023 18:48
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slightly incorrect isn't it? context.visitAncestorElements returns false at the first ancestor, not the _getParent() function, because the latter returns a BuildContext.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. s/returns false/stops/
thanks!

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read just the part about slivers. Great to have the sliver concept explained all in one place! I've looked before for a good reference I could point to for what a sliver is, and not really found one.

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the rest of the changes, mostly commenting on the nice new description of when and how rebuilds happen at [Element.rebuild].

(The PR description says it fixes #3354, but that's an old PR and not a docs issue; perhaps a typo?)

Comment on lines +4750 to +4766
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Hmm, now I wonder how often applications in the ecosystem fall into this trap. All it takes is using a widget from one library that made the wrong choice here…)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. i mean, this is true in general of any method that isn't otherwise overridden, as i understand it. @nonvirtual is the annotation intended to help with this, but i'm sure people ignore the lints sometimes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good to know about @nonVirtual! Which I see is on [Widget.==] (and that implementation otherwise just vacuously defers to super.)

I'm sure people ignore it sometimes, but that is still fairly reassuring about how prevalent this mistake would be — it makes it a lot less silent of a trap to fall into.

@Hixie
Copy link
Contributor Author

Hixie commented Mar 17, 2023

(The PR description says it fixes #3354, but that's an old PR and not a docs issue; perhaps a typo?)

Oops, meant to say #3554.

@Hixie
Copy link
Contributor Author

Hixie commented Mar 17, 2023

updated with review comments!

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks great! One new nit.

@Hixie Hixie added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 17, 2023
@Hixie
Copy link
Contributor Author

Hixie commented Mar 17, 2023

thanks for the review!

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 17, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Mar 17, 2023

auto label is removed for flutter/flutter, pr: 122787, due to - The status or check suite Windows customer_testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

Comment on lines +487 to +490
/// This hint tells the compositor not to cache the layer containing this
/// render object because the cache will not be used in the future. If this
/// hint is not set, the compositor will apply its own heuristics to decide
/// whether this layer is likely to be reused in the future.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these docs would be better updated to not refer to a raster cache at all. Impeller doesn't use a raster cache and it seems unlikely that it will at this point.

This is a hint that tells the compositor whether the developer knows this layer will be around next frame or not. The compositor may or may not use that information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the hints have any effect on Impeller at all?

(Might be worth doing an "Impeller docs update" PR separate from this that updates our docs to match the new world with mixed Impeller/Skia backends.)

/// heuristics to decide whether the this layer is complex enough to benefit
/// from caching.
/// heuristics to decide whether the layer containing this render object is
/// complex enough to benefit from caching.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this actually gets added on the picture instead of the layer, but same feedback as below - I think we should try to get rid of docs referring to raster cache, since it's a private implementation detail of the compositor that may not even be present.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pictures are layers at the framework level

/// A widget that builds itself based on the latest snapshot of interaction with
/// a [Future].
///
/// {@youtube 560 315 https://www.youtube.com/watch?v=ek8ZPdWj4Qo}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this die?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it got replaced by the second one.

@dnfield
Copy link
Contributor

dnfield commented Mar 21, 2023

(It's fine to follow up in my comments in a separate PR if more convenient - none of what you added really makes things worse than they already were)

@Hixie Hixie added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 22, 2023
@auto-submit auto-submit bot merged commit 3fe5740 into flutter:master Mar 22, 2023
@Hixie
Copy link
Contributor Author

Hixie commented Mar 22, 2023

@dnfield gonna land this as-is for now but we should talk about doing a pass for impeller, there's lots of places that mention the raster cache and i'm sure lots of other things need updating too

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 22, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 23, 2023
@Hixie Hixie deleted the docs branch March 23, 2023 21:18
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: animation Animation APIs autosubmit Merge PR when tree becomes green via auto submit App c: contributor-productivity Team-specific productivity, code health, technical debt. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: material design flutter/packages/flutter/material repository. f: routes Navigator, Router, and related APIs. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

4 participants