Skip to content

Support vinext SSR stream bootstrap#9

Draft
southpolesteve wants to merge 1 commit intoTanStack:mainfrom
southpolesteve:codex/redact-ssr-stream-vinext
Draft

Support vinext SSR stream bootstrap#9
southpolesteve wants to merge 1 commit intoTanStack:mainfrom
southpolesteve:codex/redact-ssr-stream-vinext

Conversation

@southpolesteve
Copy link
Copy Markdown
Collaborator

Summary

  • Add bootstrapScriptContent support to the server stream options and emit escaped inline bootstrap scripts.
  • Retry root-level thenable suspension during shell rendering, rolling back partial shell chunks, boundary records, and ids before awaiting and retrying.
  • Normalize document shells where top-level head tags are emitted before <!DOCTYPE html><html>, moving those tags into the existing <head>.
  • Add SSR tests for inline bootstrap content, root suspension retry, and document shell normalization.

Why

vinext App Router SSR uses Vite RSC output. The browser entry is provided to the HTML renderer as inline bootstrap script content, matching React DOM's bootstrapScriptContent option. Without this, the server HTML can render but the vinext client runtime does not start.

The same flow can suspend at the root while the RSC stream is resolved. In React, this is allowed; in Redact, the root throw escaped because there is no Suspense boundary above it. vinext needs Redact to await and retry the shell without leaking the aborted render's partial chunks.

The document-shell normalization covers React 19-style metadata projection that vinext/Next-compatible app trees can produce, where head tags may appear before the document root in the render tree but must land inside <head> in HTML.

Validation

  • pnpm --filter tests test -- ssr

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.

1 participant