-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Partial Hydration #14717
Merged
Merged
Partial Hydration #14717
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
bc3e2f9
Basic partial hydration test
sebmarkbage 433e6e5
Render comments around Suspense components
sebmarkbage 2d28a52
Add DehydratedSuspenseComponent type of work
sebmarkbage f06a540
Add comment node as hydratable instance type as placeholder for suspense
sebmarkbage 97a6664
Skip past nodes within the Suspense boundary
sebmarkbage 1b3e0a2
A dehydrated suspense boundary comment should be considered a sibling
sebmarkbage 6febcae
Retry hydrating at offscreen pri or after ping if suspended
sebmarkbage 7af0b8a
Enter hydration state when retrying dehydrated suspense boundary
sebmarkbage dac0688
Delete all children within a dehydrated suspense boundary when it's d…
sebmarkbage 92fb62a
Delete server rendered content when props change before hydration com…
sebmarkbage 6ae914c
Make test internal
sebmarkbage e144a5e
Wrap in act
sebmarkbage eb3ea2d
Change SSR Fixture to use Partial Hydration
sebmarkbage 97eb545
Changes to any parent Context forces clearing dehydrated content
sebmarkbage c91092b
Wrap in feature flag
sebmarkbage 2e16dc1
Treat Suspense boundaries without fallbacks as if not-boundaries
sebmarkbage 1db9dd2
Fix clearing of nested suspense boundaries
sebmarkbage 3a89f65
ping -> retry
acdlite e0e1ded
Typo
acdlite ca2d628
Use didReceiveUpdate instead of manually comparing props
sebmarkbage 34a132c
Leave comment for why it's ok to ignore the timeout
sebmarkbage File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ping -> retry
Co-Authored-By: sebmarkbage <[email protected]>
- Loading branch information
commit 3a89f65f6d828f7a011327e8d42ab788cc1e9006
There are no files selected for viewing
This file contains 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
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.
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.
Since this branch doesn't suspend (it doesn't call
renderDidSuspend
) I would expect React to keep rendering the same level over and over until the promise resolves. Is that what's happening?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.
No. What happens is that only the first path schedules remaining work at "Never" expiration time. Then if it throws, it doesn't suspend but it also doesn't leave any work on it. Instead it commits. Then it waits for the retry. The retry gets scheduled at normal priority. If that update also throws a promise, then it commits in the dehydrated state again and waits for the retry.
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.
I see so when something suspends inside a dehydrated Suspense boundary it always bails out and clears the expiration time. The ping/retry adds the expiration time back. There’s no need to suspend the commit because it’s not blocking anything.