Expand renderToPipeableStream()’s documentation
The documentation to renderToPipeableStream() is a sparse. For example, the current documentation links out the React source code for a full list of options. It also doesn’t explain that you can opt-out of the inline <script> approach by using the onAllReady callback.
This is a draft that I hope can be iterated on to clarify and expand the documentation. I won’t be offended if you don’t like my long headings or how I’ve structure it. I hope it provides a good first step to explain the core behaviour.
See: https://twitter.com/dan_abramov/status/1521297849593614339
Note that some terms seem interchangeable. I’ve tried using “ready” as that what the callbacks are named. It perhaps would be helpful to settle on canonical terms for:
- Suspended content blocks vs suspended content boundaries
- Ready vs Resolved vs Loaded vs Unsuspended
- Initial HTML vs Initial HTML shell
Size Changes
📦 Next.js Bundle Analysis
This analysis was generated by the next.js bundle analysis action 🤖
This PR introduced no changes to the javascript bundle 🙌
BTW in a quick search for usage of this function I didn’t find many examples of people “doing it right” with regards to error handling so I feel that documentation might help here: https://github.com/search?q=renderToPipeableStream&type=code
I have created a little project to test renderToPipeableStream() in different scenarios: https://github.com/BurntCaramel/renderToPipeableStreamPlayground
There might be some new stuff to document from the 18.2.0 release: https://github.com/facebook/react/releases/tag/v18.2.0
Addressed this via https://github.com/reactjs/reactjs.org/pull/5339. Thank you for starting this.