4 ms·
The libraries cover a similar ground, but there are some fundamental differences. With Turbo, by default all your links/forms will use XHR to fetch new pages wh
by danjac 6y ago
The libraries cover a similar ground, but there are some fundamental differences. With Turbo, by default all your links/forms will use XHR to fetch new pages which do a full body swap (unless you want to use frames/streams or opt out entirely), whereas with htmx you have to be specific which links/forms and targets you want - there is an hx-boost attribute that does something similar but it lacks a corresponding data-turbo-permanent attribute (at least in the current production version) when you want to exempt certain elements. Both are valid approaches but it depends on what suits your requirements better.
- recursivedoubts 6y agohtmx supports the `hx-preserve` attribute since v1.1: https://htmx.org/attributes/hx-preserve/ https://htmx.org/attributes/hx-preserve/
- danjac 6y agoGood to know! Didn't see it in the attribute reference list.
- recursivedoubts 6y agosorry about that, i have updated the docs
- derkoe 6y agoI did a server-side version of the TododMVC app with both. I think Hotwire (Turbo and Stimulus) and htmx have exactly the same goal. I found htmx easier to understand and handle. Here are the two implementations (backend is in Quarkus/Java): - https://github.com/derkoe/quarkus-hotwire-todos https://github.com/derkoe/quarkus-hotwire-todos - https://github.com/derkoe/quarkus-htmx-todos https://github.com/derkoe/quarkus-htmx-todos