-
Notifications
You must be signed in to change notification settings - Fork 47.2k
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
Use Lanes to check if a render is a Suspense retry #19307
Conversation
Now that Suspense retries have their own dedicated set of lanes (facebook#19287), we can determine if a render includes only retries by checking if its lanes are a subset of the retry lanes. Previously we inferred this by checking `workInProgressRootLatestProcessedEventTime`. If it's not set, that implies that no updates were processed in the current render, which implies it must be a Suspense retry. The eventual plan is to get rid of `workInProgressRootLatestProcessedEventTime` and instead track event times on the root; this change is one the steps toward that goal. The relevant tests were originally added in facebook#15769.
@@ -451,9 +451,12 @@ export function getLanesToRetrySynchronouslyOnError(root: FiberRoot): Lanes { | |||
export function returnNextLanesPriority() { | |||
return return_highestLanePriority; | |||
} | |||
export function hasUpdatePriority(lanes: Lanes) { | |||
export function includesNonIdleWork(lanes: Lanes) { |
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.
This rename is unrelated. Just felt slightly better than the old one.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e21e908:
|
Details of bundled changes.Comparing: 14084be...e21e908 react-dom
react-art
react-test-renderer
react-native-renderer
react-reconciler
Size changes (stable) |
Details of bundled changes.Comparing: 14084be...e21e908 react-dom
react-native-renderer
react-art
react-test-renderer
react-reconciler
Size changes (experimental) |
Same logic as facebook#19307. Uses RetryLanes instead of event time to determine if a render includes new updates.
Same logic as #19307. Uses RetryLanes instead of event time to determine if a render includes new updates.
Now that Suspense retries have their own dedicated set of lanes (#19287), we can determine if a render includes only retries by checking if its lanes are a subset of the retry lanes.
Previously we inferred this by checking
workInProgressRootLatestProcessedEventTime
. If it's not set, that implies that no updates were processed in the current render, which implies it must be a Suspense retry. The eventual plan is to get rid ofworkInProgressRootLatestProcessedEventTime
and instead track event times on the root; this change is one the steps toward that goal.The relevant tests were originally added in #15769.