vitejs / vitejs/vite-plugin-react
Use `renderToPipeableStream` instead of `renderToString` in `ssr-react` playground
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 269
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 19
Description
Description
The playground ssr-react uses in the entry-server.jsx the method ReactDOMServer.renderToString which does not support streaming or lazy / suspense components. I'd suggest to replace it with ReactDOMServer.renderToPipeableStream.
Suggested solution
I have made a working example based on the playground (a tiny bit more complex, but in essence the same) here:
If desired, I can make a PR to add these changes. As far as I can tell, nothing else would need to be changed.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in playground/ssr-react/entry-server.jsx and inspect how the server-rendered output is produced. Compare it with the linked streaming example, then verify that the playground uses renderToPipeableStream so streaming and lazy or Suspense components are supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100