3 ms·
htmx is focused on hypermedia exchanges in the mode of normal HTML, so client-side stuff is out it does, however, have an extensive event model to hook into, i
by recursivedoubts 4y ago
htmx is focused on hypermedia exchanges in the mode of normal HTML, so client-side stuff is out
it does, however, have an extensive event model to hook into, including pre and post request processing:
https://htmx.org/reference/#events https://htmx.org/reference/#events
as well as an extensions API:
https://htmx.org/extensions/#defining https://htmx.org/extensions/#defining
for client side scripting, I think you are talking about hyperscript, which is definitely more speculative than htmx, but I wouldn't call it half baked: a lot of people are using it successfully in production
a less-esoteric alternative would be to use alpine.js, which is similarly embedded but uses plain ol' javascript (and offers reactivity as well, hyperscript is more of a pure event-driven language)
- hliyan 4y agoJust checked alpine.js. While it's very nice, was a bit worried about this potentially risky eval use: <div x-html="(await axios.get('/some/html/partial')).data">
- remram 4y agoWhat's risky about evaluating your own code on your own pages?
- boxed 4y agoThe hooks are very limited unfortunately.
- recursivedoubts 4y agocan you be more specific? there are a large number of events and the extension mechanism has enabled a diverse number of extensions: https://htmx.org/extensions/ https://htmx.org/extensions/ generally I consider htmx to be on the high side of JS libraries when it comes to events and hooks that can be used