Mark Dalgleish
@markdalgleish
🇦🇺🐨 / Working on 💿 @ReactRouter + @remix_run at @shopify / co-creator of 🦄 CSS Modules, 🧁 Vanilla Extract / @MelbJS organiser / dad x4
We wrote a blog post that explains the new @ReactRouter RSC architecture a bit more, and how it makes our library APIs almost as powerful as Framework Mode. remix.run/blog/react-rou…
React Router takes a unique approach to React Server Components. It’s “guts out” meaning each piece of the process is exposed. You can easily hook into how the React client calls the React server, for example. The whole system is designed to be as accessible as possible.
React Router now has support for React Server Components We're introducing a more powerful RSC-powered Data Mode that brings most of Framework Mode's features to our lower level library APIs
Huge shout out to Parcel for pioneering the RSC APIs that made this possible. It’s had a big influence on us, and now the Vite implementation too.
Very happy that Parcel helped enable this! 🤩
So excited we got this out.
React Router now has support for React Server Components We're introducing a more powerful RSC-powered Data Mode that brings most of Framework Mode's features to our lower level library APIs
`const statusCode = …` ☝️ constant `const STATUS _CODE = …` ☝️ constant, but louder
SSR when using React as a library: - Function you call on your SSR server - Function you call in the browser RSC when using React Router as a library: - Function you call on your RSC server - Function you call on your SSR server - Function you call in the browser
The lightbulb moment for me with RSC support in React Router was realising that, to me, it’s not about server components. The real win is that frameworks can become much more portable, decoupled from specific bundlers. RSC handles bundler stuff, frameworks handle the runtime.
For those interested in RSC in Vite 👀
Super exciting that @hiroshi_18181's RSC plugin for Vite has landed under the official @vite_js org on npm. This is a huge step towards RSC support in React Router. npmjs.com/package/@vitej…
When your kid starts humming along to your lame old person music.
Realised that the Switch 2 is a squircle but the dock isn’t. Sorry if I ruined this for you.
When comparing framework downloads, it seems logical to look at @react-router/dev instead of react-router. BUT... I’ve been thinking, this kinda misses the fact that React Router’s Data Mode is pretty much a framework for SPAs. It's not that different from the Vite plugin.