3 ms·
FWIW I've been tinkering with Astro this week and it's possible to build a website with zero client-side JavaScript. I wonder if it's possible to achieve somet
by kcrwfrd_ 3y ago
FWIW I've been tinkering with Astro this week and it's possible to build a website with zero client-side JavaScript.
I wonder if it's possible to achieve something similar in Next.js app router if you never have a "use client" component in your tree?
In any case it seems like that's the latest trend, allowing us to use full-fledged frameworks (powered by plenty of JavaScript) while minimizing (potentially down to zero) the client-side JavaScript.
- solardev 3y agoThis used to be possible with the page router, and was in fact one of the big selling points (graceful degradation down to raw HTML). I'd be surprised if the app router couldn't do something similar, though admittedly I haven't tried to do that yet. Anyone with experience?
- kcrwfrd_ 3y agoI’m pretty sure you can’t achieve zero client-side JavaScript with pages router. You get pre-rendered HTML and it will gracefully degrade without executing JavaScript, yes…but it still comes with a JS bundle that clients will normally execute to hydrate that pre-rendered HTML into react components. RSCs using the app router, on the other hand, don’t have that hydration phase.