DEV Community

Discussion on: Conquering JavaScript Hydration

Collapse
 
bigbott profile image
bigbott

All those complications is the result of applying SPA frameworks to what they are not applicable.

Just create traditional multi page applications, use Web Components for encapsulation and reuse and be happy.

Collapse
 
ryansolid profile image
Ryan Carniato • Edited

If only it were that simple across the board. The frameworks highlighted in this article aren't actually SPA frameworks. And using frameworks at all is overkill for certain things.

Server rendering + hydrating Web Components is its own thing. Lit has been adding support for this but more of the same, trading one framework for another. It does serve as a good basis for Island architecture similar to Astro. But as you scale for certain types web applications hydration comes back to haunt you.

While complex what is cool about the approach discussed here is it does reduce the startup execution cost. Yes writing pure vanilla can do this as well, but then SSR gets trickier as relying on emulated DOM on the server is recipe for poor performance.