vike
vike copied to clipboard
React Server Components
In the context of Shopify's Hydrogen framework, Shopify developed a Vite plugin for React Server Components.
We should explore how we to integrate Vite/vite-plugin-ssr with React Server Components.
Contribution welcome, e.g.:
- Developing a standalone Vite plugin for React Server Components (@frandiox told me that the plugin developed by Shopify is tightly coupled to Hydrogen).
- Add a new
examples/react-server-componentsto this repository.
See:
- https://reactjs.org/blog/2020/12/21/data-fetching-with-react-server-components.html
- https://github.com/facebook/react/pull/22952
The plugin developed in this PR is not coupled anymore with Hydrogen. Ideally anyone can use that plugin for RSC.
Latest discussion about Vite + RSC: ~~https://github.com/Shopify/hydrogen/discussions/2225#discussioncomment-4050199~~.
Edit: Shopify removed the disucssion.
The link you shared is currently 404ing, do you have an update on this situation? Seems like a dependency on Vite (https://github.com/vitejs/vite/discussions/4591) which depends on React (https://github.com/facebook/react/pull/22952)? This is an awesome framework and it would be great if RSCs were supported
Both Vite and the React team are interested. The main piece missing is updating https://github.com/facebook/react/pull/22952 to the v2 convention.
There just needs someone championing this. @thomasgauvin if you're up for the task, definitely let us know.
Thanks for letting me know! Taking this on isn't something that I can commit to at this time, though I plan to keep an eye on this. Any good resources you would share for someone looking to contribute to Vite plugins and this project?
Vite's docs + poking around :-).
Closing in favor of https://github.com/brillout/vite-plugin-ssr/issues/735.