Hacker News new | past | comments | ask | show | jobs | submit login

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.



I 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-htmx-todos


htmx supports the `hx-preserve` attribute since v1.1:

https://htmx.org/attributes/hx-preserve/


Good to know! Didn't see it in the attribute reference list.


sorry about that, i have updated the docs




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: