pipeToNodeWritable -> renderToPipeableStream #104
sebmarkbage
announced in
Announcement
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just a heads up that the Node specific api for streaming server rendering (the preferred api) has changed.
Instead of
pipeToNodeWritable(children, writable, options).startWriting();
it is nowrenderToPipeableStream(children, options).pipe(writable);
Meaning you can pass the writable in later when you’re ready to start streaming bytes. In the future it might also be possible to pipe it to multiple writables.
This more closely mimics the pattern using readable streams, but only allows the pipe() subset of the api to ensure that the flush() method is respected.
Additionally, the callback
onReadyToStream
is now renamed toonCompleteShell
. React will be ready to stream earlier than this for things like preload tags. However, it won’t be ready to stream the root body tag and shell until it reaches the first Suspense boundary.Beta Was this translation helpful? Give feedback.
All reactions