Live data from Hacker News

Datastar: Web Framework for the Future?

chrismalek.me

71–80 of 161 posts

Re: Datastar: Web Framework for the Future?

#71
I just wanted to say I love this entire "ecosystem", if I may call it. Hypermedia is cool. HTMX looks like the natural evolution of HTML we all were expecting from the 90s. The simplicity of hx tags and the fact they get the work done is really refreshing. Datastar looks promising as well. It is already on my radar for a hobby project. Kudos to the dev team!

Re: Datastar: Web Framework for the Future?

#73

Datastar author here... AMA, but know that Datastar is pure yak shaving for me to do real work stuff so I have no golden calves, just approaches I've seen work at scale.

Hello, I've heard of Datastar before but didn't really pay attention to it since all the air in the room was sucked up by HTMX.

I tried HTMX and I found that it is really, really hard to manage complexity once the codebase gets big.

Is there an example of Datastar being used with Go in a highly interactive application that goes beyond just a TODO app so I could see how the project structure should be organized?

Re: Datastar: Web Framework for the Future?

#74
post #72

Reading tfa I kept wondering "is this yet another framework where every click is a server round trip?" Judging by the demos¹, the answer is yes? If this is "the Future", I'm branching off to the timeline where local-first wins. ¹. https://data-star.dev/examples/click_to_edit

Our free shared fly.io was not built to handle hackernews. We are looking into alternatives but in the mean time checkout https://andersmurphy.com/2025/04/07/clojure-realtime-collabo... as it's the same tech but on a slight better machine.

Re: Datastar: Web Framework for the Future?

#75

Datastar author here... AMA, but know that Datastar is pure yak shaving for me to do real work stuff so I have no golden calves, just approaches I've seen work at scale.

Hello, I've heard of Datastar before but didn't really pay attention to it since all the air in the room was sucked up by HTMX. I tried HTMX and I found that it is really, really hard to manage complexity once the codebase gets big. Is there an example of Datastar being used with Go in a highly interactive application that goes beyond just a TODO app so I could see how the project structure should be organized?

the site is just a Go app, https://github.com/starfederation/datastar/tree/develop/site

Re: Datastar: Web Framework for the Future?

#76
post #69

Earlier quoted context omitted.

Data may live in the backend, but it is used more in the frontend. Having it local (in memory, or even indexeddb) makes more responsive apps, especially if it's a typical CRUD app with 70/30 or more split between reads/writes.

Its possible to run the datastar TS/JS SDK in a service worker, if you want to do (isomorphic with the backend) templating from there or just returning pre-cached html fragments.

Datastar is fully plugin based. If you don't like my take on SSE, cool let's talk. The core is just making data-* attribute into reactive expressions, everything else is a plugin by design. I want it to be OK for me to be wrong without losing the declarative approach

Re: Datastar: Web Framework for the Future?

#77

Earlier quoted context omitted.

Hello, I've heard of Datastar before but didn't really pay attention to it since all the air in the room was sucked up by HTMX. I tried HTMX and I found that it is really, really hard to manage complexity once the codebase gets big. Is there an example of Datastar being used with Go in a highly interactive application that goes beyond just a TODO app so I could see how the project structure should be organized?

the site is just a Go app, https://github.com/starfederation/datastar/tree/develop/site

Amazing! Thank you.

Re: Datastar: Web Framework for the Future?

#78
Nitpicking but

> SSE enables microsecond updates, challenging the limitations of polling in HTMX.

How is this true? SSE is just the server sending a message to the client. If server and client are in opposite sides of the world, it will not be a matter of microseconds...

Re: Datastar: Web Framework for the Future?

#79
post #6

This is the second post I’ve seen praising Datastar in the last 24 hours, and once again no mention of the requirement to punch a gaping hole in one’s Content-Security-Policy. If this is the framework of the future, cyber criminals are going to have a bright future!

That's the nature of anything that does this kind of work. React, Svelte, Solid. Alpine has a CSP version but it does so little that I recommend you just accept being a Web1 MPA basic site. I have ideas around ways around this but it's a per language template middleware.

Alpine CSP version works fine. You just can't write JS code in strings, which one may wish to avoid anyway.

I also didn't have a problem with CSP and HTMX.

Nor with SvelteKit.

I'm not sure why you think these are all equivalent to DataStar's hard requirement on unsafe-eval.

FYI, this is the reason I didn't try out DataStar.

Re: Datastar: Web Framework for the Future?

#80
Future? Looking at some of the examples, this seems a lot like the same old web server frameworks we had like 15 years ago, maybe more. Granted they didn’t have SSE but regardless the DX was pretty bad. I don’t see a compelling reason to go back.
Post reply on HN