-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(render): Use renderToPipeableStream
instead of renderToStaticNodeStream
#1443
chore(render): Use renderToPipeableStream
instead of renderToStaticNodeStream
#1443
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
renderToStaticNodeStream
renderToPipeableStream
instead of renderToStaticNodeStream
efc31d9
to
32accee
Compare
…cNodeStream` due to it being deprecated
32accee
to
bbcd5d3
Compare
} | ||
const { | ||
default: { Writable }, | ||
} = await import("node:stream"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this gets compiled to a require statement by the build, I get the following in my native ESM project:
Error: Dynamic require of "stream" is not supported
All server-side JavaScript environment support dynamic imports. Could we not transpile the dynamic import?
This is needed since React 18.3 deprecated
renderToStaticNodeStream
so they are going to remove it on React 19 meaning we need to move out of this function into something else.From the actual warning given by
react-dom
̇This PR does exactly as the warning recommends us to do, calling
renderToPipeableStream
andpiping the stream once the
onAllReady
callback is called. Only piping it onceonAllReady
is called, makes it so that stuff like Suspense boundaries don't leave out trailing
<script>
tags.