7 ms·
Great to see this evolution! Realtime ssr hypermedia is definitely the future. But, my thoughts immediately go to Datastar, which has Fetch, SSE, declarative s
by nchmy 1y ago
Great to see this evolution! Realtime ssr hypermedia is definitely the future.
But, my thoughts immediately go to Datastar, which has Fetch, SSE, declarative signals and js expressions, dom morphing, and much more - in a tiny package. I find it to have a more flexible, expressive and standards-compliant API as well. And it'll soon have a simple reactive web components and css framework as well.
At this point, why use HTMX when it really seems like (a heavier) Datastar-lite?
- andersmurphy 1y agoThe irony that the Datastar author originally tried to have those features added to HTMX a few years ago.
- nchmy 1y agoBetter late than never. Everyone benefits with HTMX evolving and bringing more attention and capabilities to hypermedia-first approaches.
- arcanemachiner 1y agoBecause Datastar Pro isn't FOSS, and speaking from a purely probabilistic and historical standpoint, your odds of getting rugpulled (in some form or another) might as well be 100%.
- nchmy 1y agoI can appreciate why people would have this perspective - I have been rugpulled a few times recently by thoroughly unscrupulous companies (Augment Code are trash humans). But Datastar is different. The project is literally owned by a 501c3 non-profit. The devs have dayjobs and donate their spare time to this. Funds are for going to conferences or hosting their own And 99% of the features/value that I mentioned is MIT licensed, and the "rugpulled" code is still available to easily port via the plugin API.
- epolanski 1y agoYou don't know that, even if they were your brothers sitting in the room with you right now you don't know if they are or not.
- nchmy 1y agoHow does this differ from any other open source project (most of which are not non-profits, and are utterly unsustainable)?
- hatefulheart 1y agoAs much as I like Delaney, the discord server and Datastar I find this question baffling. If the Postgres team released PGPro, swore it just contained anti patterns and you can just write the code yourself if you needed that feature, you’d roll your eyes, no? It’s about the fact they went there, not about the intentions.
- sudodevnull 1y agoYou are right! If this is enough to put you off the project then I hope you find one that aligns with your ideals.
- hatefulheart 1y agoHey Delaney! Thanks for you and your teams work. It doesn't put me off the project! I will happily pay for great software that enables me to make money just like I'd pay for good tools around the house (once I get started with D*). I was just pointing out that in my mind the criticism is totally fair game because many OSS do not do this, that is all. By the looks of it you agree. I think I want to just mention something here that is really important. The Datastar team have done more to push for performance, better UX and the ways of thinking around SPAs and MPAs than multi billion dollar companies have done in the last couple of years. Not forgetting HTMX, this cooperation has been incredibly fruitful and I am very excited about the future with you guys.
- andersmurphy 1y agoYeah HTMX should rebrand as DATASTAR LIBRE.
- reverius42 1y agoPresumably Datastar is a trademark that shouldn't be used that way? (Or does the owner of HTMX also own Datastar?)
- nchmy 1y agoI dont think they have a trademark. I also think they'd be completely in favour of HTMX rebranding to Datastar Libre.
- sudodevnull 1y agoAs the Datastar author, I'd approve this effort
- yawaramin 1y agoIt's a joke.
- amanzi 1y agoOne important difference that I found is that HTMX (and Alpine AJAX) can easily push a URL into the browser's location history. I've used this feature often with my Django projects--essentially storing the state in the URL which is great for sharing URLs or bookmarking them. As far as I'm aware, Datastar have locked this feature behind the "Pro" paywall.
- nchmy 1y agoFair. Though, D*'s authors are pretty adamant that this is an anti-pattern - that's why they put it behind the paywall. Moreover, the FOSS code still exists and would take 2 minutes to update to the current plugin API (I have Datastar pro and the code is almost exactly the same) https://github.com/starfederation/datastar/blob/v1.0.0-beta.11/library/src/plugins/official/browser/attributes/replaceUrl.ts https://github.com/starfederation/datastar/blob/v1.0.0-beta....
- amanzi 1y agoI'm interested in why this would be an anti-pattern? What would the alternative be?
- nchmy 1y agoI'm not qualified to comment as I don't use the feature, but people in their Discord would be happy to explain/discuss - its a wonderful place for learning more about the web, backend architecture and more. I'm also sure this has already been explained in comments to other posts here as well.
- yawaramin 1y agoIt hasn't. Also, I'm definitely not going into the Datastar Discord. The main guy gets incredibly agitated and starts calling you names if you don't agree with him about anything lol
- AtlasBarfed 1y agoPay for the antipatterns? I'm too tired to parse this logic, but I suspect it is a novel entry in techcorp doublespeak/dirty tricks.
- alexpetros 1y ago> why use HTMX when it really seems like (a heavier) Datastar-lite? The reason to use htmx is that it has a simpler interface optimized for the majority use-case. With htmx, you are largely tied to a request/reply paradigm. Something happens that triggers a request (e.g. user clicks a button, or some element scrolls into view), htmx sends the request, and then it processes the response. The htmx interface (`hx-get`, hx-trigger`) is optimized to make this paradigm extremely simple and concise to specify. Datastar's focus (last I checked) is on decoupling these two things. Events may stream to the client at any time, regardless of whether or not they were triggered by a specific action on the client, and they get processed by Datastar and have some effect on the page. htmx has affordances for listening to events (SEE extension, new fetch support) and for placing items arbitrarily on the page (out-of-band swaps) but if your use-case is a video game or a dashboard or something else where the updates are frequently uncorrelated with user actions, Datastar makes a lot of sense. It's a bit like driving a manual transmission. Delaney is fond of saying that there's no need for htmx when Datastar can technically do everything htmx can [0]. But I think this misses the point of what makes htmx so popular: most people's applications do fit within a largely request/reply paradigm, and using a library that assumes this paradigm is both simpler to implement and simpler to debug. As an htmx maintainer, I often encourage people to even use htmx less than they want to, because the request/reply paradigm is very powerful and the more you can adhere to browser's understanding of it, the more durable and maintainable your website will be [1]. [0] https://data-star.dev/essays/v1_and_beyond https://data-star.dev/essays/v1_and_beyond [1] https://unplannedobsolescence.com/blog/less-htmx-is-more/ https://unplannedobsolescence.com/blog/less-htmx-is-more/
- andersmurphy 1y agoWhy bother with v4 at all? If it dilutes that simpler interface? I think that even with req/resp morph leads to a simpler majority use case and that's what Turbo and Datastar have both shown. No?
- alexpetros 1y ago> Why bother with v4 at all? If it dilutes that simpler interface? v4 makes almost no changes to the interface, other than to flip inheritance to be off by default. > I think that even with req/resp morph leads to a simpler majority use case and that's what Turbo and Datastar have both shown. No? Although you can use the idiomorph extension for htmx, I personally don't think idiomorph is simpler, because there's an algorithm choosing what parts of the page get replaced based on the server response; I prefer to specify exactly what parts of the page get replaced in much simpler terms, a CSS selector, with `hx-target`. Per [1] above, my style is minimize partial page responses wherever possible, so the ones that I do have are bespoke and replace a specific thing.
- jaredcwhite 1y agoI took a look at Datastar, and pretty quickly realized I really don't like libraries which try to do so many different things. The surface area of the API is way too big. htmx is already too big for me, I tend to reach for mostly vanilla-only or small vanilla-adjacent solutions I can either write by hand or import. But as I've been experimenting with htmx (including its very good extensions API), I'm realizing it's in a pretty good sweet spot overall. I'm very excited about htmx 4.0 and sounds like things are headed in a promising direction.
- sudodevnull 1y agoI hope you realize literally everything is a plug-in. The core is < 4kb. Also Datastar is literally smaller than HTMX so this is already kinda funny
- nymanjon 1y agoIf you are looking for a very tiny foot print, you might like htmz-be.