Live data from Hacker News

Datastar: Lightweight hypermedia framework for building interactive web apps

data-star.dev

31–40 of 298 posts

Re: Datastar: Lightweight hypermedia framework for building interactive web apps

#31
post #27
post #14

Earlier quoted context omitted.

not sure i think this is a good way to fund their work BUT exploring models to make open-source sustainable for the developers does seem like a good thing, no?

I have no problem with anyone charging what they would like, but I do think it should be mentioned on the homepage. It feels intentionally left off which makes me think the developers themselves aren't 100% comfortable with the model.

They're completely comfortable with and unapologetic about the model. And they're not hiding anything.

Re: Datastar: Lightweight hypermedia framework for building interactive web apps

#33
post #30
post #9

It isn't mentioned on the homepage, but Datastar does charge for the following features: data-animate - Animates element attributes over time. data-custom-validity - Adds custom validity to an element. data-on-raf - Runs an expression on every animation frame. data-on-resize - Runs an expression on element resize. data-persist - Persists signals in local storage. data-query-string - Syncs query string params with sig…

What a weird comment. Why bring this up unless you're just trying to make them look bad in a dishonest way? It is clearly documented on the site in multiple places. Moreover, they actively dissuade people from even buying the pro license because they are quite emphatic that most people/sites do not need any of these features. If you do need them, then it's a small price to pay for the functionality, as well as to mak…

I appreciated it. If I'm going to consider a framework I want to know if some of it costs money. Especially like 299usd.

Frankly your response seems very hostile and makes me wants to avoid them more.

Re: Datastar: Lightweight hypermedia framework for building interactive web apps

#34

Maybe it is because I'm a bit too deep in the React ecosystem at this point, but once you start trying to do any reasonably complex task, this seems like it would be significantly harder to reason about. Also, unless I'm misunderstanding it, this revolves a lot around the backend returning HTML to do backend-as-frontend, which given my previous experiences with the concept, I wouldn't want to touch with a 10ft pole.…

If you are truly offline, then of course this won't work.

Though, it is certainly possible to cache pages since most sites do not need persistent state - it's just ephemeral things like toggling a button, linking an input box and another caption, etc...

Though you could run the datastar js sdk from a service worker and if you've synced necessary state to browser storage, you could have your backend there.

Also, for slow connections, compression is very powerful - especially over an sse stream where there's redundant info being sent. Another comment here has links to immense demos and the compression ratios are north of 90%.

Also, slow internet is often also associated with slow devices, which cannot handle the bloat of React, css-in-js etc

Datastar VASTLY simplifies everything while sacrificing essentially nothing in the way of functionality.

Re: Datastar: Lightweight hypermedia framework for building interactive web apps

#35
post #27
post #14

Earlier quoted context omitted.

not sure i think this is a good way to fund their work BUT exploring models to make open-source sustainable for the developers does seem like a good thing, no?

I have no problem with anyone charging what they would like, but I do think it should be mentioned on the homepage. It feels intentionally left off which makes me think the developers themselves aren't 100% comfortable with the model.

I don't think that's a fair read of their intentions given how they talk about it everywhere [1]. Pro isn't there to paywall great features, but there to support the development of complex and annoying ones. The example of `data-on-signal-patch` that moved from pro to core speaks to how they're thinking about the project.

[1] Time-stamped it for convenience: https://youtu.be/eMIB4Bkl08U?si=IfTslvZoGXVbou0w&t=1270

Re: Datastar: Lightweight hypermedia framework for building interactive web apps

#36
post #15

Earlier quoted context omitted.

I mean, that seems ugly to me, but... Makes intuitive sense and is fine actually? Is HTML a rich language in which to embed stuff like this? No. Does this clearly get the point across? Yes. [Edit: this should've actually been attached to the GP comment. I agree with the parent.]

Isn't that the whole point of hypermedia frameworks like Datastar and HTMX? It's to extend the declarativeness of HTML. If you don't like the syntax, that's your preference. But I'm curious to hear why this is "wrong". Since that's a more objective thing, we can discuss it

Because it's a mish-mash of different ad-hoc DSLs.

You have a DSL based on data-* attributes

But then some attributes get this weird syntax-ish extension

Then some of those attributes accept a Datastar expressions DSL: https://data-star.dev/guide/datastar_expressions

So you can have

   data-on-click__debounce.200ms="$landingGearRetracted && @post('/launch')"
Which is just bad design

Re: Datastar: Lightweight hypermedia framework for building interactive web apps

#37

Does anyone have a detailed comparison of the functionality you get from Datastar versus HTMX + Alpine.js? My impression was that Datastar was trying to be a lighter weight combination of the other two.

I don't know about a detailed comparison, but datastar basically does everything those do combined, but in a smaller, simpler package.

It also sticks to web standards as closely as possible (whereas htmx is trying to propose it's api as web standards).

It also has SSE, idiomorph, and more baked in by default whereas those are optional extensions in htmx.

They're also releasing css and web component frameworks/tools soon that look VERY powerful and simple.

Datastar has the potential to completely change web development.

Re: Datastar: Lightweight hypermedia framework for building interactive web apps

#38
post #24

It sounds like some form of Event Sourcing? I didn't get much technical details from the page, and the (otherwise excellent) movie.

It can be, but doesn't need to be. It's highly compatible with cqrs and event driven in general, usually done with sowmthing like a pubsub event bus (NATS is most often used). Whether you want to go all the way to event sourcing is up to you - it's completely agnostic as to how you do your backend.

Re: Datastar: Lightweight hypermedia framework for building interactive web apps

#39
I think something I'd love is to see how to adopt some of the more decent frontend practices (e.g. having a component library) but rendering them using a backend that isn't something like NextJS. Can you import a component library and use it in a Flask app, say, or are the worlds just fundamentally too different?

Re: Datastar: Lightweight hypermedia framework for building interactive web apps

#40
post #4

Seems pretty elegant if you are willing to give up on the type safety of TSX. I wonder if this can be combined with it somehow. An example using Fresh would be great.

Datastar itself is written in TypeScript... And it is completely agnostic as to what language or approach you use in your backend, so long as you render html with the appropriate (web standards-compliant) attributes and expressions. Use ts, rust, lisp, or whatever you want on your server.
Post reply on HN