Repository navigation
Preserve SSR Suspense fallback across client re-suspend (#37620) - #37705
sidshehria wants to merge 1 commit into
Conversation
When use(browser()) leaves a permanent SSR fallback and hydration re-suspends on a client-created promise, keep the dehydrated fallback DOM mounted instead of deleting and remounting an identical fallback that restarts CSS animations. Co-authored-by: Cursor <[email protected]>
|
Hi @sidshehria! 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! |
|
The build for this commit did not complete, so there is no size report. See the workflow run for details. Generated by sizebot against 572b3d7 |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
please review |
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-testwith browser-only / remount / SSR fallback patterns → 7 passeduse(browser())keeps the same span node identity across hydrationBounty
Claiming the BountyHub bounty on #37620.