vike icon indicating copy to clipboard operation
vike copied to clipboard

React Server Components

Open brillout opened this issue 3 years ago • 1 comments

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-components to this repository.

See:

  • https://reactjs.org/blog/2020/12/21/data-fetching-with-react-server-components.html
  • https://github.com/facebook/react/pull/22952

brillout avatar Dec 31 '21 10:12 brillout

The plugin developed in this PR is not coupled anymore with Hydrogen. Ideally anyone can use that plugin for RSC.

frandiox avatar Dec 31 '21 13:12 frandiox

Latest discussion about Vite + RSC: ~~https://github.com/Shopify/hydrogen/discussions/2225#discussioncomment-4050199~~.

Edit: Shopify removed the disucssion.

brillout avatar Nov 08 '22 10:11 brillout

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

thomasgauvin avatar Mar 18 '23 01:03 thomasgauvin

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.

brillout avatar Mar 18 '23 09:03 brillout

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?

thomasgauvin avatar Mar 20 '23 02:03 thomasgauvin

Vite's docs + poking around :-).

brillout avatar Mar 20 '23 07:03 brillout

Closing in favor of https://github.com/brillout/vite-plugin-ssr/issues/735.

brillout avatar Mar 24 '23 18:03 brillout