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

Allow requesting a reduced widget tree with getRootWidgetTree service extension #157309

Merged
merged 16 commits into from
Oct 23, 2024

Conversation

elliette
Copy link
Member

@elliette elliette commented Oct 21, 2024

Work towards flutter/devtools#1423

Reduces the widget tree payload sent back from getRootWidgetTree when the fullDetails parameter is false.

getRootWidgetTree payload size comparison (for the Flutter gallery):

  • with fullDetails=true: 1,367,692 bytes
  • with fullDetails=false: 446,696 bytes

The fullDetails=false payload is approximately a third of the size of the original payload.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Oct 21, 2024
@elliette elliette changed the title Allow requesting an abbreviated widget tree with getRootWidgetTree service extension Allow requesting a reduced widget tree with getRootWidgetTree service extension Oct 22, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 26, 2024
M97Chahboun pushed a commit to M97Chahboun/flutter that referenced this pull request Oct 30, 2024
github-merge-queue bot pushed a commit that referenced this pull request Nov 26, 2024
…esting a large widget tree (#159454)

Fixes flutter/devtools#8553

Context: 

A Flutter web customer with a large widget tree was getting a stack
overflow error when they toggled on "show implementation widgets" in the
Flutter DevTools Inspector. This is because building the JSON tree
recursively was hitting Chrome's stack limit.

This PR creates the JSON tree **iteratively** if the `getRootWidgetTree`
service extension is called with `fullDetails = false` (which is what
DevTools uses to fetch the widget tree).

For all other instances of creating a widget JSON map (for example, when
fetching widget properties) the recursive implementation is used. This
allows properties provided by subclasses implementing `toJsonMap` to be
included in the response.

Note: Because with this change `toJsonMap` is only called when
`fullDetails = true` and `toJsonMapIterative` is only called when
`fullDetails = false`, this PR partially reverts the changes in
#157309.
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants