fix: correct references between web and node.js stream apis#8104
fix: correct references between web and node.js stream apis#8104lakbychance wants to merge 1 commit intoreactjs:mainfrom
Conversation
|
Hi @lakbychance! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
| <Note> | ||
|
|
||
| This API depends on [Web Streams.](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) For Node.js, use [`resumeToNodeStream`](/reference/react-dom/server/renderToPipeableStream) instead. | ||
| This API depends on [Web Streams.](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) For Node.js, use [`resumeToPipeableStream`](/reference/react-dom/server/resumeToPipeableStream) instead. |
There was a problem hiding this comment.
There is no resumeToNodeSteam API. This should be resumeToPipeableStream instead and also the actual link should point to that instead of render one.
| <Note> | ||
|
|
||
| This API is specific to Node.js. Environments with [Web Streams,](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) like Deno and modern edge runtimes, should use [`resume`](/reference/react-dom/server/renderToReadableStream) instead. | ||
| This API is specific to Node.js. Environments with [Web Streams,](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) like Deno and modern edge runtimes, should use [`resume`](/reference/react-dom/server/resume) instead. |
There was a problem hiding this comment.
The link should be that of the resume equivalent in the Web Streams and not the render one.
| - If rendering the is successful, the Promise will resolve to an object containing: | ||
| - `prelude`: a [Web Stream](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) of HTML. You can use this stream to send a response in chunks, or you can read the entire stream into a string. | ||
| - `postponed`: an JSON-serializeable, opaque object that can be passed to [`resumeToNodeStream`](/reference/react-dom/server/resume) or [`resumeAndPrerenderToNodeStream`](/reference/react-dom/static/resumeAndPrerenderToNodeStream) if `resumeAndPrerenderToNodeStream` is aborted. | ||
| - `postponed`: an JSON-serializeable, opaque object that can be passed to [`resumeToPipeableStream`](/reference/react-dom/server/resumeToPipeableStream) or [`resumeAndPrerenderToNodeStream`](/reference/react-dom/static/resumeAndPrerenderToNodeStream) if `resumeAndPrerenderToNodeStream` is aborted. |
There was a problem hiding this comment.
No resumeToNodeStream exists so replaced that with resumeToPipeableStream as well as corrected the url for that.
Size changesDetails📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
| <Note> | ||
|
|
||
| This API is specific to Node.js. Environments with [Web Streams,](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) like Deno and modern edge runtimes, should use [`prerender`](/reference/react-dom/static/prerender) instead. | ||
| This API is specific to Node.js. Environments with [Web Streams,](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) like Deno and modern edge runtimes, should use [`resumeAndPrerender`](/reference/react-dom/static/resumeAndPrerender) instead. |
There was a problem hiding this comment.
Here I think we want to mention the resumeAndPrerender equivalent in web stream instead of just prerender
This PR aims to fix the references used in the documentation between Node.js and Web Streams. There are cases where we are referring to API name which doesn't exist or incorrect links which can confuse the developer. Comments have been added to the individual changes for more clarity