You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Flutter web customer with a large widget tree reported that the new inspector is crashing for them when "show implementation widgets" is toggled on.
When it crashes, they see a "stack overflow" error in the Chrome DevTools console. I've confirmed that this is due to us building the widget tree's JSON object recursively, and it seems like we are hitting Chrome's stack limit.
They've confirmed that they don't see the stack overflow error when the widget tree JSON is built iteratively instead.
The text was updated successfully, but these errors were encountered:
Note: The iterative approach should only be used to build the widget tree itself, not to fetch any of the properties or details of a widget. This is because those require the recursive implementation to call toJsonMap for each node to get the details provided by the subclass implementations.
…esting a large widget tree (#159454)
Fixesflutter/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.
A Flutter web customer with a large widget tree reported that the new inspector is crashing for them when "show implementation widgets" is toggled on.
When it crashes, they see a "stack overflow" error in the Chrome DevTools console. I've confirmed that this is due to us building the widget tree's JSON object recursively, and it seems like we are hitting Chrome's stack limit.
They've confirmed that they don't see the stack overflow error when the widget tree JSON is built iteratively instead.
The text was updated successfully, but these errors were encountered: