Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverts "Prevent LayoutBuilder from rebuilding more than once (#147856)" #149279

Merged
merged 1 commit into from
May 29, 2024

Conversation

auto-submit[bot]
Copy link
Contributor

@auto-submit auto-submit bot commented May 29, 2024

Reverts: #147856

Initiated by: loic-sharma

Reason for reverting: tree is closed with errors like:

test/integration.shard/break_on_framework_exceptions_test.dart: breaks when rebuilding dirty elements throws [E]
  Expected: <45>
    Actual: <2756>
  
  package:matcher                                                       expect
  test\integration.shard\break_on_framework_exceptions_test.dart 56:5   main.expectException
  ===== asynchronous gap ===
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: LongCatIsLooong
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {goderbauer}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
Fixes https://github.com/flutter/flutter/issues/146379: introduces `Element.buildScope` which `BuildOwner.buildScope` uses to identify subtrees that need skipping (those with different `BuildScope`s). If `Element.update` calls `updateChild` then dirty children will still be rebuilt regardless of their build scopes. 

This also introduces `LayoutBuilder.applyDoubleRebuildFix` migration flag which should only live for a week or less. 

Caveats: 

`LayoutBuilder`'s render object calls `markNeedsLayout` if a descendant Element is dirty. Since `markNeedsLayout` also implies `markNeedsPaint`, the render object is going to be very repaint/relayout-happy.

Tests: 

Presubmits with the migration flag set to true: https://github.com/flutter/flutter/pull/147856/checks?check_run_id=24629865893


## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is [test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on [Discord].

<!-- Links -->
[Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]: https://github.com/flutter/flutter/wiki/Data-driven-Fixes

<!-- end_revert_body -->

@auto-submit auto-submit bot added the revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests. label May 29, 2024
@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label May 29, 2024
@auto-submit auto-submit bot merged commit ebc4143 into master May 29, 2024
6 of 8 checks passed
@auto-submit auto-submit bot deleted the revert_bafdb124c76d943542643a462af65fe1607e1263 branch May 29, 2024 23:29
hello-coder-xu added a commit to hello-coder-xu/flutter that referenced this pull request May 30, 2024
* master: (115 commits)
  Roll Flutter Engine from 4adf453b6d68 to 19707e811b60 (1 revision) (flutter#149291)
  disable Impeller on external texture test. (flutter#149292)
  Roll Flutter Engine from 8d5d14a1db95 to 4adf453b6d68 (12 revisions) (flutter#149290)
  Update 3.22.1 release notes to include missing fix. (flutter#148999)
  Manual roll Flutter Engine from 60968ee3bde7 to 8d5d14a1db95 (1 revision) (flutter#149263)
  Reverts "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149279)
  Unskip expression evaluation test (flutter#149253)
  temporarily disable SemanticsAction tests to unblock engine change (flutter#149274)
  Adds benchmark for rrect_blur. (flutter#149261)
  Prevent LayoutBuilder from rebuilding more than once (flutter#147856)
  Add test for inherited_theme.0.dart (flutter#149120)
  Update progress_indicator.dart to indicate the adaptive option is for both macOS and iOS (flutter#145246)
  _ModalScopeStatus as InheritedModel (flutter#149022)
  Add test for radio.toggleable.0.dart (flutter#149153)
  Add a sentinel value for `TextStyle.height` (flutter#149049)
  Remove dynamic_layouts from issue template (flutter#149252)
  Roll Flutter Engine from 30aa720d4999 to 60968ee3bde7 (1 revision) (flutter#149255)
  Roll Flutter Engine from b26e1b023cdb to 30aa720d4999 (7 revisions) (flutter#149249)
  Roll Packages from a933c3016f6c to 31d332900d98 (6 revisions) (flutter#149246)
  Clean leak in editable_text_test.dart. (flutter#149223)
  ...
hello-coder-xu added a commit to hello-coder-xu/flutter that referenced this pull request May 30, 2024
* master: (115 commits)
  Roll Flutter Engine from 4adf453b6d68 to 19707e811b60 (1 revision) (flutter#149291)
  disable Impeller on external texture test. (flutter#149292)
  Roll Flutter Engine from 8d5d14a1db95 to 4adf453b6d68 (12 revisions) (flutter#149290)
  Update 3.22.1 release notes to include missing fix. (flutter#148999)
  Manual roll Flutter Engine from 60968ee3bde7 to 8d5d14a1db95 (1 revision) (flutter#149263)
  Reverts "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149279)
  Unskip expression evaluation test (flutter#149253)
  temporarily disable SemanticsAction tests to unblock engine change (flutter#149274)
  Adds benchmark for rrect_blur. (flutter#149261)
  Prevent LayoutBuilder from rebuilding more than once (flutter#147856)
  Add test for inherited_theme.0.dart (flutter#149120)
  Update progress_indicator.dart to indicate the adaptive option is for both macOS and iOS (flutter#145246)
  _ModalScopeStatus as InheritedModel (flutter#149022)
  Add test for radio.toggleable.0.dart (flutter#149153)
  Add a sentinel value for `TextStyle.height` (flutter#149049)
  Remove dynamic_layouts from issue template (flutter#149252)
  Roll Flutter Engine from 30aa720d4999 to 60968ee3bde7 (1 revision) (flutter#149255)
  Roll Flutter Engine from b26e1b023cdb to 30aa720d4999 (7 revisions) (flutter#149249)
  Roll Packages from a933c3016f6c to 31d332900d98 (6 revisions) (flutter#149246)
  Clean leak in editable_text_test.dart. (flutter#149223)
  ...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 30, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 30, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 30, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 30, 2024
victorsanni pushed a commit to victorsanni/flutter that referenced this pull request May 31, 2024
…r#147856)" (flutter#149279)

Reverts: flutter#147856
Initiated by: loic-sharma
Reason for reverting: tree is closed with errors like: 

```
test/integration.shard/break_on_framework_exceptions_test.dart: breaks when rebuilding dirty elements throws [E]
  Expected: <45>
    Actual: <2756>
  
  package:matcher                                                       expect
  test\integration.shard\break_on_framework_exceptions_test.dart 56:5   main.expectException
  ===== asynchronous gap ===
Original PR Author: LongCatIsLooong

Reviewed By: {goderbauer}

This change reverts the following previous change:
Fixes flutter#146379: introduces `Element.buildScope` which `BuildOwner.buildScope` uses to identify subtrees that need skipping (those with different `BuildScope`s). If `Element.update` calls `updateChild` then dirty children will still be rebuilt regardless of their build scopes. 

This also introduces `LayoutBuilder.applyDoubleRebuildFix` migration flag which should only live for a week or less. 

Caveats: 

`LayoutBuilder`'s render object calls `markNeedsLayout` if a descendant Element is dirty. Since `markNeedsLayout` also implies `markNeedsPaint`, the render object is going to be very repaint/relayout-happy.

Tests: 

Presubmits with the migration flag set to true: https://github.com/flutter/flutter/pull/147856/checks?check_run_id=24629865893
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jun 1, 2024
flutter/flutter@c85fa6a...7eebe29

2024-05-30 engine-flutter-autoroll@skia.org Roll Packages from 31d3329 to 910fabb (11 revisions) (flutter/flutter#149321)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from fb64b9a4e6f2 to 2fedfd3cc6e5 (2 revisions) (flutter/flutter#149320)
2024-05-30 yinxulolol@gmail.com Fix `Slider` throws an error when `_labelPainter` text is null (flutter/flutter#148462)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5500c1a3969a to fb64b9a4e6f2 (1 revision) (flutter/flutter#149307)
2024-05-30 tessertaha@gmail.com Enable `explicitChildNodes` for the `AlertDialog` content (flutter/flutter#149130)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0c95e85dfbf4 to 5500c1a3969a (1 revision) (flutter/flutter#149304)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 19707e811b60 to 0c95e85dfbf4 (1 revision) (flutter/flutter#149300)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4adf453b6d68 to 19707e811b60 (1 revision) (flutter/flutter#149291)
2024-05-30 jonahwilliams@google.com disable Impeller on external texture test. (flutter/flutter#149292)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8d5d14a1db95 to 4adf453b6d68 (12 revisions) (flutter/flutter#149290)
2024-05-30 kevinjchisholm@google.com Update 3.22.1 release notes to include missing fix. (flutter/flutter#148999)
2024-05-30 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 60968ee3bde7 to 8d5d14a1db95 (1 revision) (flutter/flutter#149263)
2024-05-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Prevent LayoutBuilder from rebuilding more than once (#147856)" (flutter/flutter#149279)
2024-05-29 danny@tuppeny.com Unskip expression evaluation test (flutter/flutter#149253)
2024-05-29 yjbanov@google.com temporarily disable SemanticsAction tests to unblock engine change (flutter/flutter#149274)
2024-05-29 30870216+gaaclarke@users.noreply.github.com Adds benchmark for rrect_blur. (flutter/flutter#149261)
2024-05-29 31859944+LongCatIsLooong@users.noreply.github.com Prevent LayoutBuilder from rebuilding more than once (flutter/flutter#147856)
2024-05-29 32538273+ValentinVignal@users.noreply.github.com Add test for inherited_theme.0.dart (flutter/flutter#149120)
2024-05-29 73608287+ellet0@users.noreply.github.com Update progress_indicator.dart to indicate the adaptive option is for both macOS and iOS (flutter/flutter#145246)
2024-05-29 linxunfeng@yeah.net _ModalScopeStatus as InheritedModel (flutter/flutter#149022)
2024-05-29 32538273+ValentinVignal@users.noreply.github.com Add test for radio.toggleable.0.dart (flutter/flutter#149153)
2024-05-29 31859944+LongCatIsLooong@users.noreply.github.com Add a sentinel value for `TextStyle.height` (flutter/flutter#149049)
2024-05-29 katelovett@google.com Remove dynamic_layouts from issue template (flutter/flutter#149252)
2024-05-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 30aa720d4999 to 60968ee3bde7 (1 revision) (flutter/flutter#149255)
2024-05-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from b26e1b023cdb to 30aa720d4999 (7 revisions) (flutter/flutter#149249)
2024-05-29 engine-flutter-autoroll@skia.org Roll Packages from a933c30 to 31d3329 (6 revisions) (flutter/flutter#149246)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2024
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
…r#6836)

flutter/flutter@c85fa6a...7eebe29

2024-05-30 engine-flutter-autoroll@skia.org Roll Packages from 31d3329 to 910fabb (11 revisions) (flutter/flutter#149321)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from fb64b9a4e6f2 to 2fedfd3cc6e5 (2 revisions) (flutter/flutter#149320)
2024-05-30 yinxulolol@gmail.com Fix `Slider` throws an error when `_labelPainter` text is null (flutter/flutter#148462)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5500c1a3969a to fb64b9a4e6f2 (1 revision) (flutter/flutter#149307)
2024-05-30 tessertaha@gmail.com Enable `explicitChildNodes` for the `AlertDialog` content (flutter/flutter#149130)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0c95e85dfbf4 to 5500c1a3969a (1 revision) (flutter/flutter#149304)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 19707e811b60 to 0c95e85dfbf4 (1 revision) (flutter/flutter#149300)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4adf453b6d68 to 19707e811b60 (1 revision) (flutter/flutter#149291)
2024-05-30 jonahwilliams@google.com disable Impeller on external texture test. (flutter/flutter#149292)
2024-05-30 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8d5d14a1db95 to 4adf453b6d68 (12 revisions) (flutter/flutter#149290)
2024-05-30 kevinjchisholm@google.com Update 3.22.1 release notes to include missing fix. (flutter/flutter#148999)
2024-05-30 engine-flutter-autoroll@skia.org Manual roll Flutter Engine from 60968ee3bde7 to 8d5d14a1db95 (1 revision) (flutter/flutter#149263)
2024-05-29 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Prevent LayoutBuilder from rebuilding more than once (#147856)" (flutter/flutter#149279)
2024-05-29 danny@tuppeny.com Unskip expression evaluation test (flutter/flutter#149253)
2024-05-29 yjbanov@google.com temporarily disable SemanticsAction tests to unblock engine change (flutter/flutter#149274)
2024-05-29 30870216+gaaclarke@users.noreply.github.com Adds benchmark for rrect_blur. (flutter/flutter#149261)
2024-05-29 31859944+LongCatIsLooong@users.noreply.github.com Prevent LayoutBuilder from rebuilding more than once (flutter/flutter#147856)
2024-05-29 32538273+ValentinVignal@users.noreply.github.com Add test for inherited_theme.0.dart (flutter/flutter#149120)
2024-05-29 73608287+ellet0@users.noreply.github.com Update progress_indicator.dart to indicate the adaptive option is for both macOS and iOS (flutter/flutter#145246)
2024-05-29 linxunfeng@yeah.net _ModalScopeStatus as InheritedModel (flutter/flutter#149022)
2024-05-29 32538273+ValentinVignal@users.noreply.github.com Add test for radio.toggleable.0.dart (flutter/flutter#149153)
2024-05-29 31859944+LongCatIsLooong@users.noreply.github.com Add a sentinel value for `TextStyle.height` (flutter/flutter#149049)
2024-05-29 katelovett@google.com Remove dynamic_layouts from issue template (flutter/flutter#149252)
2024-05-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 30aa720d4999 to 60968ee3bde7 (1 revision) (flutter/flutter#149255)
2024-05-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from b26e1b023cdb to 30aa720d4999 (7 revisions) (flutter/flutter#149249)
2024-05-29 engine-flutter-autoroll@skia.org Roll Packages from a933c30 to 31d3329 (6 revisions) (flutter/flutter#149246)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework flutter/packages/flutter repository. See also f: labels. revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants