-
Notifications
You must be signed in to change notification settings - Fork 47.6k
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
[Selective Hydration] Prioritize the last continuous target #16937
Conversation
ReactDOM: size: 0.0%, gzip: 0.0% Details of bundled changes.Comparing: 10277cc...cc67c72 react-dom
react-reconciler
|
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.
In general this looks pretty neat 👍
]); | ||
|
||
document.body.removeChild(container); | ||
}); |
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.
Nice test 👍
@@ -421,6 +425,19 @@ export function attemptUserBlockingHydration(fiber: Fiber): void { | |||
markRetryTimeIfNotHydrated(fiber, expTime); | |||
} | |||
|
|||
export function attemptContinuousHydration(fiber: Fiber): void { | |||
if (fiber.tag !== SuspenseComponent) { | |||
// We ignore HostRoots here because we can't increase |
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 comment seems to have been copy-pasted from above- but I'm not sure I understand why we specifically mention the Ah, I was missing the context of how HostRoot
type here, since we are ignoring everything other than SuspenseComponent
.attemptToDispatchEvent()
worked.
This ensures that the current focus target is always hydrated first. Slightly higher than the usual Never expiration time used for hydration. The priority increases with each new queued item so that the last always wins.
It's not useful for comparison purposes anyway.
645912f
to
cc67c72
Compare
This ensures that the current focus target is always hydrated first.
Slightly higher than the usual Never expiration time used for hydration. The priority increases with each new queued item so that the last always wins.
This is mostly to ensure that tooltips show up at a reasonable time.
If there's client rendered content that currently comes first though.