Eureka exclaimed the "full-stack" developer, who needs javascript!?
Eureka exclaimed the "full-stack" developer, who needs javascript!?
If only browsers could somehow retain the parts of a web page that did not change, like images and css and js, in some sort of local storage or cache.
If you can get the HTML within the same order of magnitude as JSON itself, then it's perhaps a compelling argument to ditch SPAs. The bandwidth delta would be minimal, and the development overhead would be much less substantial.
Note that this is how the web used to be. Small HTML markup.
We even started baking structured meaning into the HTML (Semantic Web, "Web 3.0") so that documents could be consumed like APIs. But then JSON and the platform giants put an end to p2p web payloads and rich document schemas. That was a mistake.
SPAs can be great for large teams with different skills/profiles, and large companies with a lot of money though.
I tried using HTMX recently for mainly a CRUD app for personal use, with limited dynamic loading. Still felt the need to rely on JS(Jquery) for loading images and triggering refresh on list of items without full page reload[1].
Did a small A/B test from dev POV using Vue.js, as it is one of the more lighter frameworks. Ended up leaning more towards Vue.js, as had to do some non-conventional(from HTMX POV)[1] things for a simple CRUD app not relying on full page loads/refreshes. Hopefully there is another step in this evolution.
htmx at bigsky dot software
or you can jump on the discord if that works:
thanks for taking a look at htmx
Essentially, your web "client" is now the HTML-generating server-side code instead of a JavaScript app. Other clients are unaffected and can work the same as they otherwise would.