Skip to content

Refactor Partial Hydration#16346

Merged
sebmarkbage merged 13 commits intofacebook:masterfrom
sebmarkbage:dehydratedrefactor
Aug 12, 2019
Merged

Refactor Partial Hydration#16346
sebmarkbage merged 13 commits intofacebook:masterfrom
sebmarkbage:dehydratedrefactor

Conversation

@sebmarkbage
Copy link
Contributor

This is a pretty invasive refactor of the SuspenseComponent and DehydratedSuspenseComponent.

The primary purpose of this refactor is to avoid the hacky "upgrade" and "downgrade" by mutating the tag.

In the new model, a boundary is always represented by the same SuspenseComponent fiber. Inside it I store a "DehydratedFragment". The inner fiber represents the dehydrated nodes in the tree. This can be used to delete the whole thing or insert before it.

I also switched legacy mode to always client-render the boundary content since we can't hydrate partially in legacy mode. It also warns.

Otherwise, this (hopefully) shouldn't have an semantic differences.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants