[DevTools] Reset forced states when changing component filters #34929
+128
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we change component filters, we unmount the whole tree and mount it again. That means that any Suspense rect measurement will be gone. On mount, we're not measuring Suspense nodes since there's nothing to measure. Users can't even get back the original state since we no longer know which Fibers we forced a fallback for.
Now we're scheduling updates on the Fibers we removed forced states from when applying new filters. We could also do this in
untrackFiber
directly but most of the time this will be for Fibers that are no longer alive so the checks would be wasted.As an alternative, we could collect all rects of suspended boundaries and restore those rects. We'd also have to restore the Sets of Fibers with forced states.
This is mainly relevant when editing the Suspense timeline and moving in and out of Activity slices (#34908)