Skip to content

feat(dpu): DPU out of order streaming replacement based html end stamp - #478

Open
MaxwellCohen wants to merge 1 commit into
preactjs:mainfrom
MaxwellCohen:dpu-end-stamp
Open

feat(dpu): DPU out of order streaming replacement based html end stamp#478
MaxwellCohen wants to merge 1 commit into
preactjs:mainfrom
MaxwellCohen:dpu-end-stamp

Conversation

@MaxwellCohen

Copy link
Copy Markdown

This is an alternative DPU template for streaming using an HTML end-stamp comment to let the mutation observer know when to run replacement code. This approach is more targeted and, in theory, more reliable than #474 for race conditions or edge cases, at the cost of slightly more HTML for each boundary of about 9 bytes per resolved suspence boundary resulting in a this sending more html at about 8 boundaries.

Metric main branch Δ
INIT_SCRIPT body 1135 1066 −69
createInitScript() tag 1168 1099 −69
createSubtree() 69 55 −14
Suspense fallback wrapper 33 56 +23
One boundary stamp overhead 77 86 +9
First suspend total (stamps + init) 1245 1185 −60

code sand box link to use this PR can be seen here
https://ci.codesandbox.io/status/MaxwellCohen/preact-render-to-string/pr/6/builds/691802

@changeset-bot

changeset-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9e6e8b1

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 Minor

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

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