chore(render): Use renderToPipeableStream instead of renderToStaticNodeStream#1443
Merged
gabrielmfern merged 8 commits intocanaryfrom May 13, 2024
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
renderToStaticNodeStreamrenderToPipeableStream instead of renderToStaticNodeStream
efc31d9 to
32accee
Compare
…cNodeStream` due to it being deprecated
32accee to
bbcd5d3
Compare
bukinoshita
approved these changes
May 9, 2024
kentcdodds
reviewed
May 30, 2024
| } | ||
| const { | ||
| default: { Writable }, | ||
| } = await import("node:stream"); |
Contributor
There was a problem hiding this comment.
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?
kentcdodds
reviewed
May 30, 2024
| } | ||
| const { | ||
| default: { Writable }, | ||
| } = await import("node:stream"); |
Contributor
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is needed since React 18.3 deprecated
renderToStaticNodeStreamso 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-doṁThis PR does exactly as the warning recommends us to do, calling
renderToPipeableStreamandpiping the stream once the
onAllReadycallback is called. Only piping it onceonAllReadyis called, makes it so that stuff like Suspense boundaries don't leave out trailing
<script>tags.