Live data from Hacker News

Datastar: Lightweight hypermedia framework for building interactive web apps

data-star.dev

61–70 of 298 posts

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

#61
post #7
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.

I actively look for non-TS frameworks. To me it's always been useless overhead. It really is a outcome of startup/enterprise teams that are so far away from how money goes in and out of a business that they sit around and think TS is a good usage of time. It may hurt their feelings to know plenty of people run successful teams and entire businesses without type safety. It also makes the code look like shit. To each t…

I mostly agree with this. TS works great in large enterprises where developers don't trust each other. But if you're working on your own, or in a small team where you can easily agree with each other, TS just becomes unnecessary overhead.

At least, that's my experience and I don't like it when people say that everyone must absolutely use TS when they don't know anything about your situation.

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

#62

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?

You can use datastar with ANY backend and templating system that you want - you just have to return html with the appropriate (and standards-compliant) attributes and, optionally, js expressions.

Use php, python, rust, or anything else that you want. They all have various approaches to html templating.

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

#63
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…

Yeah, I have no idea why someone would want to consider this over turbo + stimulus

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

#64
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…

This is an example of the entitled subset of people who come out of the woodwork whenever an open source project has any kind of monetization or even just a non-standard license prohibiting billion dollar companies from selling their project as a service.

I guarantee the fact that I referred to a project with an anti Amazon clause as open source will piss some of the off so much that they’ll comment here about it.

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

#65
post #59
post #56

Earlier quoted context omitted.

I think my point is pretty straightforward. Datastar is a front end framework. If any frontend framework can’t survive HN traffic it’s doing something wrong in a truly unholy way. Surviving, or not surviving, a traffic influx is a backend restriction.

And yet, most frontend frameworks barely on even the simplest of sites. This is not only well documented, but most of them have now moved towards some sort of SSR hybrid - at great complexity cost.

I disagree with “most”. 99% of the sites featured on HN do just fine.

OP is a talented developer that wrote a backend capable of surviving a ton of traffic. Other developers on the internet have written backends that cannot sustain a ton of traffic.

The choice of frontend framework is separate from both. You can write a performant web app that uses React. I’m sure you can write one that falls over immediately with Datastar.

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

#66
post #58

Datastar is one of the few projects in the web ecosystem in years that feels like a paradigm shift for the better. The author (Delaney Gillilan) has put a lot of thought into how modern web development should be done from first principles, while leveraging core web technologies like SSE, and eschewing complexity as much as possible. His proposed GoNaDs stack[1] enables some truly impressive web applications. I highly…

I was just commenting to someone yesterday how it's a testament to how refined this is that he's been working hard for over 2 years to produce such a small amount of code. I can only imagine how many variations he's gone through in order to get to what we see today - a refined, simple, easy, powerful way to do SSR-driven declarative interactivity, etc

And if that isn't enough, he's also on the cusp on releasing a web component framework that puts Lit to shame, AND a css framework that looks equally impressive.

He takes some getting used to, but the guy is a genius and is enormously generous with his time and deep knowledge.

I really do hope that d* gains more traction - the web could be such a better place, just at a time when native apps are literally under assault and censure by app stores and autocratic governments.

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

#67
post #36

Earlier quoted context omitted.

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

I can see what you're saying.

But again, the API design woes are subjective and I think it's perfectly fine to iterate on getting this to a nicer state.

"Wrong" to me suggests a gap in the understanding of fundamentals or of how things work. If the ideas of Datastar are fine to all of us, and our issues with it are ergnomics, then that can be a more focused discussion.

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

#68
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…

Didn't find anything about this on the main page.

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

#69
post #13

Earlier quoted context omitted.

So your answers is no, you cannot provide any arguments.

The poster provided an example of poor abstraction. HTML for display, JS for client side logic. Combining them is part of the problem with other popular frameworks.

No, it's the entire point of datastar - that you don't need much JavaScript at all because some simple html attributes do most of it for you, and any extra can either go in-line, or you can also just fallback to separate js scripts if needed.

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

#70
post #46
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 do think this is the most sustainable approach for monetizing open source projects, as long as the developer is fair about it. That is, truly make features that only large and/or enterprise users would have a use for, and only charge for those, instead of arbitrarily deciding to put core features of the software behind a paywall. In the case of a web framework, that choice is a bit difficult. But if the software is…

I'm skeptical about this business model because it can become worse than proprietary software dependency over time. You get lured in by thinking it's open source and free, and might end up paying as much as the developer wants for essential features a few years later.
Post reply on HN