Hacker News new | ask | show | jobs
by artooro 17 days ago
Go + Datastar is simpler, I much prefer it.
2 comments

Yeah this combo fits as easily as a custom sized/fitted gloves would.

I would add a-h/templ for templates and it has Datastar support as well.

It is staggering how Datastar is not more popular.

I think people see the "pricing" and are turned off. The base is completely free! Some of the ecosystem is not. The big selling point for me, is the size of the library. HTMX and Alpine are a bit larger. The downside for me is needing to have a template type that supports streaming. (Thymeleaf in Java vs JTE) My controllers also have imperative code to support the streaming. None of this is enough of a turnoff however. For my simple apps, I'm extremely happy with how simple both HTMX and Datastar make my logic. (I replaced a React front-end and got rid of the whole build step).
I also prefer Datastar but the new features coming in HTMX4 closes the gap more. Happy to see the ecosystem converging on good patterns.
But the point is that Datastar only exists because htmx rejected all of those ideas. Now it's becoming a cheap, more complex, less powerful, heavier copy of Datastar. Just use the genuine article.
Last I checked Datastar doesn't support progressive enhancement. I like using <a href hx-boost=true> and <form method action hx-boost=true> so almost all my functionality works even without JavaScript. See https://dev.to/yawaramin/why-hx-boost-is-actually-the-most-i...
Its not evident to me that that is really a concern when datastar is so small, and most of the js is written inline.

Moreover, htmx can only do a fraction of what datastar does - you'd need to add on something like alpinejs to be able to try to fill the gaps. Both combined are much larger than datastar, and not nearly as integrated.

It’s a concern because I use htmx for loading and updating resources and I want those operations to work as well as possible even without JavaScript. I’ve never felt the need for Alpine.js, I have very little I need to do with custom JS, and it’s trivial to maintain that by hand.
I would just go all the way to using https://unpoly.com/ if I wanted the full-bang whiz.
Datastar has evolved into a suite of tools [1]. If anything the gap has widened.

Off-course these additional tools are not free [2].

[1] Rocket for WebComponents, Stellar for CSS

[2] Nothing wrong in charging but $349 is a tad too expensive for me. I will happily pay if it was in double digits.