Hacker News new | ask | show | jobs
by dsego 5 days ago
Why not? You can have server side routing that returns the page and then react then takes over and hydrates a small part within the page or the complete page. A similar approach is used for the islands architecture, and you can even combine different frontend frameworks for maximum flexibility, e.g. developer preference. You can decide to load your frontend libraries lazily or as shared scripts so they are cached and only take up some bandwidth on initial load (a couple of kB minified and zipped).
1 comments

An islands architecture can be implemented with web components when hydration is needed.

Writing vanilla JS to manage state and backend data loading can be done with a script that is less than 2kB zipped. The script can then be reused.

At that point, gzipped Preact is only 1k larger (and 10k smaller than htmx) and provides a pretty comprehensive and common set of solutions to the majority of front end problems compared to hand rolling everything.