diff --git a/.changeset/calm-ranges-stream.md b/.changeset/calm-ranges-stream.md new file mode 100644 index 00000000..272931ec --- /dev/null +++ b/.changeset/calm-ranges-stream.md @@ -0,0 +1,11 @@ +--- +'preact-render-to-string': major +--- + +Mark the range of every `` boundary in the HTML, so the client hydrates each boundary as one unit once all of its content has arrived. + +- A boundary that is still to be streamed is written as `fallback`. Its content follows in ``, the same element as before. The island moves the content into the range once a node follows it (the server writes a newline after each island), then tells hydration the content is there. +- A boundary whose content is in the HTML is written as `…`, in `renderToString` and `renderToStringAsync` too. One that is left to the client is written as `fallback`. +- While streaming, the range of a boundary covers all of its children. What a boundary rendered before one of its children suspended is sent with its chunk, and a boundary nested in it is never sent before the HTML that holds its range. + +Hydrating these ranges needs the matching Preact release. The markup changes for every ``, so this is a major. diff --git a/.changeset/template-for-stream.md b/.changeset/template-for-stream.md new file mode 100644 index 00000000..0e6bb5b9 --- /dev/null +++ b/.changeset/template-for-stream.md @@ -0,0 +1,5 @@ +--- +'preact-render-to-string': major +--- + +Stream a boundary's content as `