Skip to content

docs: clarify that resumeAndPrerender prelude stream is partial when postponed - #8768

Open
pawannyadav05 wants to merge 1 commit into
reactjs:mainfrom
pawannyadav05:docs/clarify-resumeAndPrerender-prelude
Open

pawannyadav05 wants to merge 1 commit into
reactjs:mainfrom
pawannyadav05:docs/clarify-resumeAndPrerender-prelude

Conversation

@pawannyadav05

Copy link
Copy Markdown

Fixes #8755

Summary

Clarifies in the resumeAndPrerender reference documentation that the returned prelude Web Stream is not necessarily a standalone, complete HTML document if rendering was postponed or aborted.

Problem

The documentation for resumeAndPrerender previously stated:

prelude: a Web Stream of HTML. You can use this stream to send a response in chunks, or you can read the entire stream into a string.

And showed a code snippet returning new Response(prelude) directly.
This caused confusion for developers (as noted in #8755) who expected the prelude stream to always yield a fully formed HTML document. In reality, with partial pre-rendering (PPR), if components postpone or abort during prerendering, the prelude only contains the static shell and resolved segments. Developers who return prelude directly as the response body without combining it with a resumed stream end up serving an incomplete document.

Solution

  • Updated the return description for prelude in resumeAndPrerender.md to explicitly state that the stream contains the rendered shell and resolved segments, and is not necessarily a complete HTML document if postponed or aborted.
  • Added guidance that delivering a complete response requires combining the static prelude with the resumed stream or ensuring root tags without unhandled postponed boundaries.

Changes

  • src/content/reference/react-dom/static/resumeAndPrerender.md: Updated the prelude return value description.

…postponed

Clarifies in the resumeAndPrerender reference documentation that the returned
prelude stream is not necessarily a standalone, complete HTML document if
rendering was postponed or aborted, preventing confusion where developers attempt
to send the prelude directly as the entire HTTP response body.

Fixes reactjs#8755
@github-actions

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@leo60228

Copy link
Copy Markdown

Note that this stream is not necessarily a complete HTML document if rendering was postponed or aborted.

Is there any way to use resumeAndPrerender where this is not the case?

This branch was successfully deployed

1 active deployment
Preview — 2a229aaa Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resumeAndPrerender behavior doesn't seem to match documentation

2 participants