-
Notifications
You must be signed in to change notification settings - Fork 48.6k
[Transition Tracing] Add transition tracing transitions stack #24321
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -661,7 +661,7 @@ function updateOffscreenComponent( | |
// push the cache pool even though we're going to bail out | ||
// because otherwise there'd be a context mismatch | ||
if (current !== null) { | ||
pushTransition(workInProgress, null); | ||
pushTransition(workInProgress, null, null); | ||
} | ||
} | ||
pushRenderLanes(workInProgress, renderLanes); | ||
|
@@ -695,7 +695,7 @@ function updateOffscreenComponent( | |
// push the cache pool even though we're going to bail out | ||
// because otherwise there'd be a context mismatch | ||
if (current !== null) { | ||
pushTransition(workInProgress, null); | ||
pushTransition(workInProgress, null, null); | ||
} | ||
} | ||
|
||
|
@@ -733,7 +733,9 @@ function updateOffscreenComponent( | |
// using the same cache. Unless the parent changed, since that means | ||
// there was a refresh. | ||
const prevCachePool = prevState !== null ? prevState.cachePool : null; | ||
pushTransition(workInProgress, prevCachePool); | ||
// TODO: Consider if and how Offscreen pre-rendering should | ||
// be attributed to the transition that spawned it | ||
pushTransition(workInProgress, prevCachePool, null); | ||
} | ||
|
||
pushRenderLanes(workInProgress, subtreeRenderLanes); | ||
|
@@ -751,7 +753,7 @@ function updateOffscreenComponent( | |
// using the same cache. Unless the parent changed, since that means | ||
// there was a refresh. | ||
const prevCachePool = prevState.cachePool; | ||
pushTransition(workInProgress, prevCachePool); | ||
pushTransition(workInProgress, prevCachePool, null); | ||
} | ||
|
||
// Since we're not hidden anymore, reset the state | ||
|
@@ -767,7 +769,7 @@ function updateOffscreenComponent( | |
// using the same cache. Unless the parent changed, since that means | ||
// there was a refresh. | ||
if (current !== null) { | ||
pushTransition(workInProgress, null); | ||
pushTransition(workInProgress, null, null); | ||
} | ||
} | ||
} | ||
|
@@ -1330,10 +1332,10 @@ function updateHostRoot(current, workInProgress, renderLanes) { | |
|
||
const nextState: RootState = workInProgress.memoizedState; | ||
const root: FiberRoot = workInProgress.stateNode; | ||
pushRootTransition(workInProgress, root, renderLanes); | ||
|
||
if (enableCache) { | ||
const nextCache: Cache = nextState.cache; | ||
pushRootTransition(root); | ||
pushCacheProvider(workInProgress, nextCache); | ||
if (nextCache !== prevState.cache) { | ||
// The root cache refreshed. | ||
|
@@ -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 commentThe 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:
The begin phase needs to be:
|
||
|
||
if (enableCache) { | ||
const cache: Cache = current.memoizedState.cache; | ||
pushCacheProvider(workInProgress, cache); | ||
pushRootTransition(root); | ||
acdlite marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
if (enableTransitionTracing) { | ||
workInProgress.memoizedState.transitions = getWorkInProgressTransitions(); | ||
|
Uh oh!
There was an error while loading. Please reload this page.