Htmx 1.9.3 Released
htmx.org
htmx.org
- You cannot have reusable components. If you want that, you need to combine server side templating.
- Because rendering HTML is OK and HTML is the UI, if not disciplined enough, your app would be generating shards and shreds of application UI that are highly contextual and not as repeatable or reusable.
- A client other than browser can't consume HTML as easily such as a cron job or Flutter/Android/iOS app .
But other than that, I think htmx is innovative enough that it should be part of the browser natively.
EDIT: About browser implementation
what you do is to return a json representation of the data if the 'Accept' header is json from the client (which, you control or can direct them to send right?).
This is basically the good old days of server side rendering, and html fragments, and you'd used to use jquery to just wholesale replace portions of the dom with the returned value from the server via an ajax request.
Server-side rendering has a huge advantage though: it needs one less "layer". With client-side rendering you have code in the browser, code on the server, and code in the database. You need defined protocols between every layer. With three layers and two hops, that's effectively 5 things you need to develop.
With HTML-based development, the client side code basically doesn't exist any more. You don't need to send the browser JSON via an API to be decoded and converted to HTML. You just send the HTML as-is. Just write the web server and the database, connect them, and you're done. That's 3 things you need to develop.
I've watched developer after developer start trivial web pages -- not even really apps -- with stacks like Angular and get bogged down in the complexity of things like client-side authentication protocols, multi-API security, making sure JSON APIs don't leak information inadvertently, having to batch queries with GraphQL, and on, and on, and on...
None of that is necessary with HTML being generated by the server.
Trying to get good user feedback during the automatic inflight ajax seems impossible.
Complex multi target ui is nastier than just using vue/react.
In the end complex ui gives me worse code than reactive js. I have to think alot harder about page or htmx dom scope with htmx.
but often you don't
https://htmx.org/essays/when-to-use-hypermedia/
i'd de-escalate the whole thing by turning it from an "either/or" into a "sometimes/as well"
htmx & hypermedia is a tool, nothing more
who are you to say so?