Skip to content

Prepend the doctype to a streamed document that doesn't suspend - #498

Merged
JoviDeCroock merged 1 commit into
mainfrom
fix/stream-doctype
Nov 19, 2026
Merged

JoviDeCroock merged 1 commit into
mainfrom
fix/stream-doctype

Conversation

@JoviDeCroock

Copy link
Copy Markdown
Member

renderToPipeableStream and renderToReadableStream only prepend <!DOCTYPE html> to a full document when something in it suspends. Once the data or lazy() modules a page waits on are cached on the server, the same page streams without a doctype and the browser renders it in quirks mode. Users can't add the doctype themselves either, since they'd get two whenever something does suspend.

The doctype is now prepended to every streamed <html> shell.

This PR was authored by Opus 5.5.

Only the branch for a shell with pending boundaries added it, so the
same page rendered in quirks mode once nothing in it suspended anymore.
@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3487bd3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
preact-render-to-string Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@JoviDeCroock
JoviDeCroock marked this pull request as ready for review November 19, 2026 15:58
@JoviDeCroock
JoviDeCroock merged commit c316883 into main Nov 19, 2026
1 check passed
@JoviDeCroock
JoviDeCroock deleted the fix/stream-doctype branch November 19, 2026 15:59
@github-actions github-actions Bot mentioned this pull request Nov 19, 2026
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