Repository navigation
Revert sync abort replay restoration pending a complete fix - #37852
Merged
Merged
Conversation
Revert react#37710 and react#37850 while we revisit how a synchronous prerender abort should preserve replay structure. Restoring the aborted task root as a replay point can overlap child postpones; react#37850 handles one overlap but leaves indexed parent slots with descendant replay nodes that fail resumption. This restores the earlier behavior, including the react#37709 failure where resuming can omit markup produced before an abort. We should address that regression with a model that preserves both the rendered shell and valid replay paths.
|
Comparing: e25b4a4...ad9a250 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) Generated by sizebot against ad9a250 |
Collaborator
Author
samselikoff
approved these changes
Oct 14, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 14, 2026
Revert #37710 and #37850 while we revisit how synchronous prerender aborts preserve replay state. Restoring the aborted task root as a replay point can overlap postpones from child tasks. #37850 suppresses one form of the overlap, but an indexed parent slot can still coexist with a descendant replay node and fail during resumption. This removes the incomplete change so we can address the replay invariants together. This deliberately restores the behavior reported in #37709: if a prerender abort interrupts a task after it has rendered part of its shell, the later resume can omit that markup. That regression needs a follow-up fix. This supersedes #37851. Tests: `yarn test ReactDOMFizzStaticBrowser --runInBand` and `yarn test ReactDOMFizzStaticBrowser --prod --runInBand` (34 passed in each mode). DiffTrain build for [99c106c](99c106c)
sokra
pushed a commit
to vercel/next.js
that referenced
this pull request
Oct 15, 2026
[diff react/react@07dde64d...99c106c4](react/react@07dde64...99c106c) <details> <summary>React upstream changes</summary> - react/react#37852 - react/react#37850 - react/react#37846 - react/react#37764 </details> --------- Co-authored-by: next-js-bot[bot] <279046576+next-js-bot[bot]@users.noreply.github.com> Co-authored-by: Josh Story <[email protected]>
gnoff
added a commit
that referenced
this pull request
Oct 19, 2026
#37709 showed that a synchronous prerender abort can discard a retried task's rendered shell, then resume only an inner slot. #37710 addressed the missing markup by postponing the whole task, but that could overlap replay paths from child tasks; #37852 reverted that approach. Preserve the parent segment and continue rendering its text and host elements after abort. When a component or other render callback returns after abort, discard its children and track a postponed hole at that node. This includes function and class components, lazy and forward-ref components, Context.Consumer render props, iterables, and thenables. Already-created arrays are read normally; getters and host prop serialization follow React's render-purity rules. SuspenseList rows use the same postponement path and existing row task bookkeeping. Preserve individual holes only while rendering an unfinished Suspense boundary. Tasks without a blocked boundary unwind through the existing root abort path: a postponed root cannot flush any shell and must render again in full. Tests cover root aborts during the initial render, in a retried child, and during a subsequent resumeAndPrerender, followed by a complete final resume. This restores the tests from #37710, #37850, and #37851 and adds coverage for indexed retries, static host children after abort, iterators and thenables, forward refs, render-phase updates, nested fallbacks, and SuspenseList rows. A full-flow regression for repeated aborts during resumeAndPrerender is marked `it.failing`: it exposes an existing bug in postponing an already emitted boundary, fixed separately in #37876. The browser prerender suite passes in development and production on stable and experimental channels, including the expected failure. ESLint and Prettier pass.
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 19, 2026
#37709 showed that a synchronous prerender abort can discard a retried task's rendered shell, then resume only an inner slot. #37710 addressed the missing markup by postponing the whole task, but that could overlap replay paths from child tasks; #37852 reverted that approach. Preserve the parent segment and continue rendering its text and host elements after abort. When a component or other render callback returns after abort, discard its children and track a postponed hole at that node. This includes function and class components, lazy and forward-ref components, Context.Consumer render props, iterables, and thenables. Already-created arrays are read normally; getters and host prop serialization follow React's render-purity rules. SuspenseList rows use the same postponement path and existing row task bookkeeping. Preserve individual holes only while rendering an unfinished Suspense boundary. Tasks without a blocked boundary unwind through the existing root abort path: a postponed root cannot flush any shell and must render again in full. Tests cover root aborts during the initial render, in a retried child, and during a subsequent resumeAndPrerender, followed by a complete final resume. This restores the tests from #37710, #37850, and #37851 and adds coverage for indexed retries, static host children after abort, iterators and thenables, forward refs, render-phase updates, nested fallbacks, and SuspenseList rows. A full-flow regression for repeated aborts during resumeAndPrerender is marked `it.failing`: it exposes an existing bug in postponing an already emitted boundary, fixed separately in #37876. The browser prerender suite passes in development and production on stable and experimental channels, including the expected failure. ESLint and Prettier pass. DiffTrain build for [ba39b32](ba39b32)
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.
Revert #37710 and #37850 while we revisit how synchronous prerender aborts preserve replay state.
Restoring the aborted task root as a replay point can overlap postpones from child tasks. #37850 suppresses one form of the overlap, but an indexed parent slot can still coexist with a descendant replay node and fail during resumption. This removes the incomplete change so we can address the replay invariants together.
This deliberately restores the behavior reported in #37709: if a prerender abort interrupts a task after it has rendered part of its shell, the later resume can omit that markup. That regression needs a follow-up fix.
This supersedes #37851.
Tests:
yarn test ReactDOMFizzStaticBrowser --runInBandandyarn test ReactDOMFizzStaticBrowser --prod --runInBand(34 passed in each mode).