Skip to content

[Transition Tracing] Add Support for Multiple Transitions on Root#24732

Merged
lunaruan merged 4 commits intofacebook:mainfrom
lunaruan:multiple_roots
Jun 17, 2022
Merged

[Transition Tracing] Add Support for Multiple Transitions on Root#24732
lunaruan merged 4 commits intofacebook:mainfrom
lunaruan:multiple_roots

Conversation

@lunaruan
Copy link
Contributor

We can think of transitions on the root as a bunch of tracing markers. Therefore, we can map each transition to a map of pending suspense boundaries. When a transition's pending suspense boundary map is empty, we know that it's complete. This PR:

  • Combines the pendingSuspenseBoundaries and transitions into one incompleteTransitions object. This object is a map from a transition to a map of pendingSuspenseBoundaries
  • Refactored code to make it so that every transition has its own pendingSuspenseBoundaries map rather than sharing just one.
  • Moves the transition complete callback to the root. Alternatively, we can also keep a map of pendingSuspenseBoundaries to transitions on the Offscreen marker, but it's simpler to just call the transition complete callback on the root instead. We also only do this if there are transitions pending, so it shouldn't make too big of a difference

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants