Repository navigation
Preserve SSR Suspense fallback across client re-suspend (#37620) - #37694
theworker02 wants to merge 1 commit into
Conversation
|
Hi @theworker02! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
|
Warning These sizes are for f6ad245, which is no longer the head of this pull request. A build for 3664ce5 is in progress. The build for this commit did not complete, so there is no size report. See the workflow run for details. Generated by sizebot against f6ad245 |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
When use(browser()) paints a permanent SSR fallback and hydration re-suspends on a client-created promise, keep the dehydrated fallback DOM mounted so CSS animations and local DOM state are not reset. Co-authored-by: Cursor <[email protected]>
f6ad245 to
3664ce5
Compare
Summary
$100): whenuse(browser())leaves a permanent SSR Suspense fallback and hydration re-suspends on a client-created promise (setTimeout/localStorage/ IndexedDB shape), keep the dehydrated fallback DOM mounted instead of deleting and remounting an identical fallback.browser()digest so ordinary error fallbacks still take the existing client-render path.Implementation
In
updateDehydratedSuspenseComponent, when a permanent fallback re-suspends on the client:Also teach
updateSuspenseFallbackChildren/bailoutOffscreenComponentnot to treat a preservedDehydratedFragmentas renderable children.Test plan
yarn test --build=false ReactDOMFizzServer-test --testNamePattern="browser-only|does not remount|replaces the SSR|keeps the SSR fallback"→ 7 passeduse(browser())keeps the same<span>node identity across hydrationBounty
Claiming the BountyHub bounty on #37620.