← Back to context

Comment by yashasolutions

2 days ago

I have tried to use exclusively each of the libraries to better understand their limit, overtime I got to the following observations:

- htmx is more straightforward (because a lot of the magic basically happening in the backend) and helps a lot to keep some sanity.

- Alpine shines when you need more composition or reactivity in the frontend. But it gets verbose quickly. When you feel you are reimplementing the web, it means you went too far.

For pagination, page structure, big tables, confirmation after post etc. I usually go with htmx. Modals, complex form composition (especially when you need to populate dropdowns from differents APIs), fancy animations, I prefer Alpine. (I probably could do that with htmx and wrapping it in a backend - but often more flexible in the frontend directly.)

To me, the main reason why I use these libraries, is what I write today will still be valid in 5 years without having to re-write the whole thing, and it matters since I have to maintain most of what I write.