[Selective Hydration] Prioritize the last continuous target#16937
Merged
sebmarkbage merged 2 commits intofacebook:masterfrom Oct 2, 2019
Merged
[Selective Hydration] Prioritize the last continuous target#16937sebmarkbage merged 2 commits intofacebook:masterfrom
sebmarkbage merged 2 commits intofacebook:masterfrom
Conversation
|
ReactDOM: size: 0.0%, gzip: 0.0% Details of bundled changes.Comparing: 10277cc...cc67c72 react-dom
react-reconciler
|
bvaughn
approved these changes
Oct 2, 2019
Contributor
bvaughn
left a comment
There was a problem hiding this comment.
In general this looks pretty neat 👍
| ]); | ||
|
|
||
| document.body.removeChild(container); | ||
| }); |
|
|
||
| export function attemptContinuousHydration(fiber: Fiber): void { | ||
| if (fiber.tag !== SuspenseComponent) { | ||
| // We ignore HostRoots here because we can't increase |
Contributor
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.