3 ms·
Show HN: React Server Components without a framework – Demo
I tried to migrate an existing React SPA to RSC without a framework, and made a demo / playground about it.
This demo includes:
- an unorthodox RSC "SSR" implementation with Fastify, inspired from common React / Redux SSR technique of inlining serialized state in the HTML document.
- RSC data-fetching from server components, consumed in other components, either server or client ones, with <Suspense />.
- Client-side routing using the a-route library.
- Refreshing an RSC tree from the client.
- Usage of some react-server-dom-webpack undocumented APIs & other React Canary / Experimental APIs such as use().
The code of this demo is available at https://github.com/ziir/rsc-demo https://github.com/ziir/rsc-demo and there's a longer form blog post available for anyone who's interested https://timtech.blog/posts/react-server-components-rsc-no-framework/ https://timtech.blog/posts/react-server-components-rsc-no-fr...
Feedback is welcome ! :)