Repository navigation
Allow resumeAndPrerender to postpone an existing boundary again - #37876
Merged
gnoff merged 2 commits intoOct 19, 2026
Merged
Conversation
gnoff
force-pushed
the
jstory/fizz-resume-prerender-repeated-abort
branch
4 times, most recently
from
October 16, 2026 18:13
5327f6b to
656a766
Compare
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.
A second prerender can suspend or abort while filling a hole in an already emitted Suspense boundary. The resumed boundary lacked postponement metadata, and recording it again would replace the ID referenced by the original HTML. Initialize tracking for resumed boundaries and preserve their existing IDs. Flush completed segments as partial output while postponed holes still block revealing the boundary. Enable the full synchronous abort and final resume regression from the preceding PR, and cover repeated external aborts on the same boundary. The browser prerender suite passes in development and production on stable and experimental channels, and the Fizz static Node, browser and Node server, and SuspenseList suites pass.
Verify that resumeAndPrerender preserves a completed sibling's output while postponing another boundary again, then completes the remaining boundary on a final resume. Exercise both root-level replay and replay through an already completed Suspense ancestor so the tests cover boundary ownership across both paths.
gnoff
force-pushed
the
jstory/fizz-resume-prerender-repeated-abort
branch
from
October 19, 2026 14:58
656a766 to
f566173
Compare
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)
unstubbable
approved these changes
Oct 19, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 19, 2026
`resumeAndPrerender` fails when the same already emitted Suspense boundary needs to postpone again. This predates #37853: prerendering a suspended boundary, aborting, resuming it while it still suspends, and aborting again hits the missing postponement metadata even when both aborts happen outside rendering. Initialize tracking for resumed boundaries and preserve the boundary ID already referenced by the emitted HTML. When a pass finishes with postponed holes, flush completed segments as partial output and retain the fallback until a later resume completes the boundary. Switch the full-flow regression from #37853 from `it.failing` to `it`, asserting prerender → resumeAndPrerender → final resume, intermediate HTML, JSON round trips, and removal of placeholders. Add a regression using external aborts to directly cover the existing API bug. Also verify that one resumed boundary can complete while a sibling aborts and postpones again, both at the root and through an already completed Suspense ancestor. Follow-up to the merged #37853. This PR contains only the resumeAndPrerender fix and its regression tests. The browser prerender suite passes in development and production on stable and experimental channels. ESLint and Prettier pass. DiffTrain build for [e92156b](e92156b)
eps1lon
pushed a commit
to vercel/next.js
that referenced
this pull request
Oct 20, 2026
[diff react/react@ba39b32a...a6792708](react/react@ba39b32...a679270) <details> <summary>React upstream changes</summary> - react/react#37901 - react/react#37876 </details> --------- Co-authored-by: next-js-bot[bot] <279046576+next-js-bot[bot]@users.noreply.github.com>
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.
resumeAndPrerenderfails when the same already emitted Suspense boundary needs to postpone again. This predates #37853: prerendering a suspended boundary, aborting, resuming it while it still suspends, and aborting again hits the missing postponement metadata even when both aborts happen outside rendering.Initialize tracking for resumed boundaries and preserve the boundary ID already referenced by the emitted HTML. When a pass finishes with postponed holes, flush completed segments as partial output and retain the fallback until a later resume completes the boundary.
Switch the full-flow regression from #37853 from
it.failingtoit, asserting prerender → resumeAndPrerender → final resume, intermediate HTML, JSON round trips, and removal of placeholders. Add a regression using external aborts to directly cover the existing API bug. Also verify that one resumed boundary can complete while a sibling aborts and postpones again, both at the root and through an already completed Suspense ancestor.Follow-up to the merged #37853. This PR contains only the resumeAndPrerender fix and its regression tests.
The browser prerender suite passes in development and production on stable and experimental channels. ESLint and Prettier pass.