Skip to content

Make Element tree root generic #123352

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

Merged
merged 3 commits into from
Mar 27, 2023
Merged

Conversation

goderbauer
Copy link
Member

@goderbauer goderbauer commented Mar 23, 2023

Part of #121573.

This change allows the root of the element tree to be any Element (not just a RenderObjectElement). For that, it introduces the RootElementMixin, which can be used to make any Element subclass the root of the element tree. It replaces the RootRenderObjectElement, which is now deprecated in favor of the new mixin. In addition to that, it renames the renderViewElement accessor on the WidgetsBinding to rootElement to remove the implied assumption that the root is a RenderObjectElement.

This is in preparation for further changes towards multi-view rendering, where the root of the element tree will not be backed by render objects, see https://docs.flutter.dev/go/multiple-views for the details of that.

@flutter-dashboard flutter-dashboard bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. c: tech-debt Technical debt, code quality, testing, etc. labels Mar 23, 2023
@goderbauer goderbauer marked this pull request as ready for review March 23, 2023 20:27
@goderbauer goderbauer requested a review from gspencergoog March 23, 2023 20:27
@goderbauer
Copy link
Member Author

The fix for the flutter_plugins check is flutter/packages#3539.

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@@ -6323,14 +6323,28 @@ abstract class RenderObjectElement extends Element {
}
}

/// The element at the root of the tree.
/// Deprecated. Will be removed in a future version of Flutter.
Copy link
Contributor

Choose a reason for hiding this comment

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

You could also mention that it is no longer used by Flutter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added.

@goderbauer
Copy link
Member Author

flutter/packages#3539 has rolled into the framework in #123542.

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

auto-submit bot commented Mar 27, 2023

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

@goderbauer
Copy link
Member Author

customer_testing failures are (unrelated) flakes hopefully fixed with flutter/tests#239.

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

auto-submit bot commented Mar 27, 2023

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

@goderbauer goderbauer added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 27, 2023
@auto-submit auto-submit bot merged commit 48bb12d into flutter:master Mar 27, 2023
@goderbauer goderbauer deleted the genericElementRoot branch March 27, 2023 20:31
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 28, 2023
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: tests "flutter test", flutter_test, or one of our tests autosubmit Merge PR when tree becomes green via auto submit App c: contributor-productivity Team-specific productivity, code health, technical debt. c: tech-debt Technical debt, code quality, testing, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants