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
[Transition Tracing] Add transition tracing transitions stack #24321
Conversation
| } | ||
|
|
||
| pushTransition(workInProgress, prevCachePool, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Add a comment here to remind us to consider how transitions should work for Offscreen. Like maybe at some point we'll need a way to attribute pre-rendering work to the transition that spawned it.
TODO: Consider if and how Offscreen pre-rendering should be attributed to the transition that spawned it
|
Comparing: 8dcedba...5ee6aaa Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
ab27dd0
to
085e721
Compare
7fe33af
to
f8c9395
Compare
| @@ -3572,10 +3574,11 @@ function attemptEarlyBailoutIfNoScheduledUpdate( | |||
| case HostRoot: | |||
| pushHostRootContext(workInProgress); | |||
| const root: FiberRoot = workInProgress.stateNode; | |||
| pushRootTransition(workInProgress, root, renderLanes); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the order of pushes in the begin phase needs to be the reverse of the pops in the complete phase.
It happens to not matter here because none of these functions read the current value before the next one pops, but it's a refactor hazard if we ever change them to do that.
So since the complete phase is:
- popRootTransition
- popCacheProvider
The begin phase needs to be:
- pushCacheProvider
- pushRootTransition
| // transitions. Therefore, we want to lazily combine transitions. Instead of | ||
| // comparing the arrays of transitions when we combine them and storing them | ||
| // and filtering out the duplicates, we will instead store the unprocessed transitions | ||
| // in an array of arrays and actually filter them in the passive phase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: it's just an array now, not an array of arrays
| } | ||
|
|
||
| const currentTransitions = transitionStack.current; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You can return this directly without the null check
Added a transitions stack for to keep track of which transitions are still happening for the current boundary.
* On the root, we will get all transitions that have been initiated for the corresponding lanes.
* Whenever we encounter a suspended boundary, we will add all transitions on the stack onto the boundary
* Whenever we encounter a boundary that just unsuspended, we will add all transitions on the boundary onto the stack
A transition will be considered complete when there are no boundaries that have the associated transition