also, I find your headline misleading. htmx uses javascript, there's no accessing anything "directly from html". you could say that about any framework with directives, ie vue, but we all know better.
a framework using a neat piece of technology isn't really a boon for the framework -- the technology of streaming itself is great, sure, but you can do that with any stack.
If a part of the page needs to change, the server figures out what it should change to and sends that page fragment.
At least, that's my cursory understanding from reading https://hypermedia.systems
In a video game the "server" doesn't figure out what's changed (that's too much work) it just redraws the frame. So rather than the complexity of working out what has changed you can just send down the whole page again whenever something changes.
This gives you view = f(state) over the wire and has great DX. It's called immediate mode in games.
Here's a basic google sheets clone that does just that:
HTMX Sucks mug: https://swag.htmx.org/products/htmx-sucks-mug
prein•3mo ago
I really appreciated the library of examples; they cover a lot of common use cases. Between that and the docs I had no trouble figuring out how things worked.