|
This. This gets us 98% of the way. The people that have to worry about the 2% are not you, because your web app almost certainly doesn’t need offline-first of FPS-like user interaction, so in 98% of cases, hypermedia + tech like htmx gets you 100% of the way. For pete’s sake, just let your server serve html. Replace only the parts of the page that need to update… with html. From your server. The poor thing is just sitting there, idling, bored, borderline depressed because it doesn’t get much of chance to do what it is meant to do, which is, you know… serve.
“But it serves JSON” … is like buying a Bugatti Veyron, just to park it in your garage and use its exhaust fumes to dry your clothes 6 days of the week, with a 2 minute drive around the block on Sundays. |
That is a very creative analogy, but not one I agree with.
My servers should do as little as possible. They should not serve files just for the sake of it, because they have all these shiny serving features.
And I like JSON as it is not as verbose as html and I can directly work with it in javascript. And then update my html where I need it locally.
If you prefer it differently, than this is fine. The web supports many ways.