11 ms·
Datastar: Lightweight hypermedia framework for building interactive web apps
- teekert 1y agoThat movie at the bottom makes me want to use it for any next project. Gold. "The planet uncomplicanus" :D
- gregoriol 1y agoEverything about this seems so bad! The website doesn't look serious at all. The code adds crazy html attributes, even more crazy than other crazy front-end frameworks like `data-on-input__debounce.200ms="@get('/examples/active_search/search')"`... this level of wrong is incredible.
- macmac 1y agoCould provide actual arguments for why these aspects of Datastar are "crazy", "even more crazy" and "wrong"?
- gregoriol 1y agoWhat more do you need than writing something like `data-on-input__debounce.200ms="@get('/examples/active_search/search')"` in the DOM as being crazy and wrong?
- macmac 1y agoSo your answers is no, you cannot provide any arguments.
- palmfacehn 1y agoThe 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.
- nchmy 1y agoNo, 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.
- array_key_first 1y agoI think you, and others, just don't understand what hypermedia is or what the idea is trying to achieve. Which is weird, because this is (was?) the predominant way to make websites for decades.
- sudodevnull 1y agoYou mean like onclick?
- afavour 1y agoI think OPs point argues for itself. The example provided is awful developer ergonomics.
- array_key_first 1y agoOkay but why. Surely if you have auto complete this works just fine.
- daeken 1y agoI 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.]
- hasanhaja 1y agoIsn'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
- troupo 1y agoBecause 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 https://data-star.dev/guide/datastar_expressions So you can have data-on-click__debounce.200ms="$landingGearRetracted && @post('/launch')" Which is just bad design
- jmstevers 1y agoWhat design do you think would be better?
- troupo 1y agoBoth Datastar and HTMX have the same issue: they want to pretend to be HTML. So they force themselves into writing several DSLs like this to pretend that this is still "just HTML". Since they have a full "Datastar expression" language, I'd just expand that. Then you wouldn't need these weird constructs: <button data-on-click__window__debounce.500ms.leading="$foo = ''"></button>
- 1y ago
- robinhood 1y agoTo me, it doesn’t seem any more far-fetched than, say, instantiating a virtual DOM in the browser.
- deleted 1y ago[deleted]
- brazukadev 1y agoDo you dislike Lisp too?
- IshKebab 1y agoSeems 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.
- ivape 1y agoI 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 their own I guess.
- IshKebab 1y ago[flagged]
- ivape 1y agoI just think you are wrong. It mostly takes mindshare from rookie developers that are insecure and need to cover all their bases lest they be called bad at being a developer. Many grow out of this insecurity and see things for what they are. TS is OKAY, but it's not worth my time.
- IshKebab 1y agoWell I'm objectively correct about it preventing bugs. This is one of the few things that has been fairly conclusively shown by studies. As for productivity, maybe it doesn't matter on tiny projects or short-lived one-man projects, but for anything else I don't see how you can argue it. You basically can't refactor reliably without static types, you can't navigate the codebase quickly without static types, and it makes it more difficult to understand other people's code without static types. Sure it might take slightly longer to write in the first place but that is easily outweighed by all those other benefits. Like, by an order of magnitude. It sounds like you are one of those "well I don't make mistakes" developers.
- armarr 1y agoThis feels like an interation on Hotwire
- yxhuvud 1y agoYes, with pay to play for trivial features.
- sudodevnull 1y agoThen fork it, it's MIT
- dev_ila 1y agothis looks awesome dude
- VoidWhisperer 1y agoMaybe 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. When you consider users with extremely bad internet connections (there are still people on dsl/older satellite/2G), having to make more requests to the backend that return larger blobs of html (as opposed to fewer requests that return JSON when it is relevant) will result in a significantly more degraded user experience
- withinboredom 1y agoIn my experience from using react apps on 2g/3g… I would much prefer the html. Usually, you get the content in 1-2 seconds with html, where you could end up with a react apps that never loads at all. Why does it never load? Because enterprising engineers usually invent their own timeouts that make no sense when you are dealing with bytes-per-second. There’s already a one minute timeout on the socket, and it knows if it is still receiving where your application has no sense of progress. Please don’t reinvent things.
- VoidWhisperer 1y agoThe issue is that if you have to make more requests overall, there is a non-negligible rtt for each of those requests, which on slow connections can add up very fast
- andersmurphy 1y agoTry my demo [1] on 3G slow. It works fine. Turns out brotli compression does wonders. [1] https://checkboxes.andersmurphy.com https://checkboxes.andersmurphy.com
- withinboredom 1y ago
- bradly 1y agoIt 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 signal values. data-replace-url - Replaces the URL in the browser. data-scroll-into-view - Scrolls an element into view. data-view-transition - Sets view-transition-name styles. Prices are $299 for a solo dev and $999+ for teams https://data-star.dev/reference/datastar_pro https://data-star.dev/reference/datastar_pro
- mbvisti 1y agonot 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?
- foofoo12 1y ago> exploring models This model of using deception to hide costs isn't exactly "exploring". It's tried and tested.
- mbvisti 1y agoyou're stretching the definition of deception here my guy-what do you want them to do? plaster a big sign on the landing page stating that this framework ALSO contains pro features that you have to pay for?
- porridgeraisin 1y ago> plaster a big sign Yes!! That's table stakes. It's the bare minimum needed to not be considered malice.
- 1y ago
- Blahagun 1y agoOh great, yet another front-end framework, but this one is with paid features as well. Are we seriously going to pretend this isn't getting out of hand?
- hasanhaja 1y agoWhat's your concern with the paid features? https://news.ycombinator.com/item?id=45537335 https://news.ycombinator.com/item?id=45537335
- nchmy 1y agothey're a 501c3 non profit and they actively dissuade people from buying the pro license, because YAGNI. If you want those features, or just want to support a genuinely innovative framework that people spent years building, you can get the license. Its not that expensive and is a one-time purchase.
- sudodevnull 1y agoit's really a full stack back end agnostic framework. i haven't really seen anything like it.
- andersmurphy 1y agoFor those of you who don't think Datastar is good enough for realtime/collaborative/multiplayer and/or think you need any of the PRO features. These three demos each run on a 5$ VPS and don't use any of the PRO features. They have all survived the front page of HN. Datastar is a fantastic piece of engineering. - https://checkboxes.andersmurphy.com/ https://checkboxes.andersmurphy.com/ - https://cells.andersmurphy.com/ https://cells.andersmurphy.com/ - https://example.andersmurphy.com/ https://example.andersmurphy.com/ (game of life multiplayer) On both the checkboxes/cells examples there's adaptive view rendering so you can zoom out a fair bit. There's also back pressure on the virtual scroll.
- afavour 1y ago> They have all survived the front page of HN Right but this says “bring your own backend” in big letters on the splash page. So surviving HN isn’t really something Datastar is doing here.
- nchmy 1y agoI don't understand what point you're trying to make. He shared examples of some immensely dynamic apps that are running on a potato and survived HN, showing that this simplifies things greatly and can scale. Hypermedia-first is a very viable, and simplified, approach.
- afavour 1y agoI 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.
- nchmy 1y agoAnd 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.
- emschwartz 1y agoDoes 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.
- nchmy 1y agoI 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.
- teekert 1y agoIt sounds like some form of Event Sourcing? I didn't get much technical details from the page, and the (otherwise excellent) movie.
- nchmy 1y agoIt 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.
- Mizza 1y agoReinventing the wheel and then charging for simple features? If this paradigm excites you, just use Phoenix, dawg. It's so far ahead, everything else feels primitive.
- Alifatisk 1y agoI can't use Phoenix with Rails now, can I?
- nchmy 1y agoWhat here has been reinvented? There's nothing out there like datastar. Htmx + alpine is similar, but much heavier and less functional. And God forbid someone try to make open source sustainable by charging for largely-unnecessary functionality and actively dissuading you from buying it - as the devs do regularly in their discord. And phoenix doesn't work with ANY backend language or framework.
- hasanhaja 1y agoSimple features? Making those imperative APIs declarative is not very simple for me, but you're welcome to not use those features and write them yourself. A couple of things on the Phoenix point: - Requires the adoption of Elixir and Datastar is backend agnostic - Adopting Phoenix feels more suited to greenfield projects, but Datastar is suited for that and brownfield ones. - Websockets vs Server Sent Events has been really interesting and nuanced
- TeddyDD 1y agoIn what specific areas Phoenix Live View is so far ahead? Do you mind elaborating? The unfortunate disadvantage of Live View is that you need to write Elixir. A lovely language, but it would be hard to sell in company that use only <SOME_LANGUAGE>. The hypermedia libraries like d* and htmx can be used with any backend.
- mawadev 1y agoThis post and other posts about datastar on the hn frontpage seem unnatural to me. It's like a marketing effort to astroturf this, especially with newly created accounts interacting with this...
- cjs_ac 1y agoI'm using HTMX and had never heard of Datastar until today. I imagine there's a fair few people who saw the first post, looked into it and found other things about Datastar, and decided to post them.
- nchmy 1y agoThis and other negative, yet argument-free, comments about datastar are what seem unnatural to me...
- penultimatename 1y agoI thought the same before I saw your comment. Several posters are new or have also posted on previous posts about Datastar (and are oddly aggressive.)
- evilduck 1y agoYeah, why does hypermedia attract folks who always sound so aggressive? It's a weird but common theme.
- sarchertech 1y agoThat’s a common HN pattern. Someone posts something about “why I switched to x” and it inspires someone else to link to the the x website, or even to other similar projects websites, and they all make it to the front page. It’s just a common synergistic phenomenon.
- ksec 1y agoOne submitted by me, and this one by others, both accounts are ~2012. Not exactly new account.
- dang 1y ago
- philipallstar 1y agoI 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?
- nchmy 1y agoYou 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.
- markusw 1y agoFor Go, something like gomponents [0] or Templ [1] would fit that. (Disclaimer: I wrote gomponents.) I even have a Datastar integration now. [2] [0]: https://www.gomponents.com https://www.gomponents.com [1]: https://templ.guide https://templ.guide [2]: https://www.maragu.dev/gomponents-datastar https://www.maragu.dev/gomponents-datastar
- philipallstar 1y agoThanks - interesting! I was more thinking of a workflow where a designer makes a component in Figma, and it's probably polished and made available in a component library by a frontend/UI person, and it's probably a React component or a Web component. I was wondering whether that workflow was at all compatible with any of the non-JS backends that are reclaiming frontend a little.
- sudodevnull 1y agoAnd gomponents is great!
- imiric 1y agoDatastar 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 recommend watching this talk[2] to get a sense of what's possible. I wish the best of luck to the core team and contributors, and hope that this framework, or something like it, disrupts the modern ecosystem of popular web frameworks and stacks. [1]: https://gonads.net/ https://gonads.net/ [2]: https://www.youtube.com/watch?v=0K71AyAF6E4 https://www.youtube.com/watch?v=0K71AyAF6E4
- nchmy 1y agoI 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.
- imiric 1y ago> 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. In the words of some famous people: > Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better. > Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. I think Delaney definitely follows these principles, which is refreshing to see in modern web development. The author of htmx, Carson Gross, also deserves a mention. > 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. Ah, I wasn't aware of that. I'll keep an eye out for those. I see they're also opposed to Tailwind, which is an absolute abomination IMO. I don't have experience with Lit, but it seemed like a nice abstraction over core Web Components, which feel like a half-baked solution. Ideally, I want these things to be part of core web technologies, and for web developers to not need to rely on 3rd-party frameworks. Web browsers should be better. Web servers should be better. The entire web development and user experience should be simpler, more secure, robust, etc. But given that large corporations dictate what that experience is like, I'm glad that we have fresh thinking from people who are not already engrained in this system. While the ecosystem catches up, I would use anything they produce, or build my own[1], over using established and popular technologies any day of the week. [1]: https://github.com/hackfixme/miu https://github.com/hackfixme/miu
- Imustaskforhelp 1y agoNot sure why the community is being so hostile like use phoenix or it charges or its hostile Like no its not. This is a genuinely cool project and most parts of it is open source and it can run on any language and its interesting that they are looking at a way so that they can fund the development of it in the process as well Its their project and they are the only ones entitled to really push things the way they want. It looks cool and I might hack with it in golang. Thanks a lot for your work. One minor feedback I want to share is that although I don't mind having a charge for things, 299$ especially in my country is a seriously lot of money and I think that some of these might be needed by me if I go full in on it but I genuinely can't afford even the single tier one. Could the non profit atleast have some dynamic pricing for all countries sort of like steam? And/or donating to people.... like I mean genuinely no shade whatsoever at the datastar team but animation etc. are already available in sveltekit for free and I don't want it for free but I just genuinely can't afford it here... Another suggestion could be to lean very heavily on the entreprise who can afford such things much rather easily or maybe even more and maybe you/team can lower the price for solo so that solo devs can try things out and not be worried for 299$-ish y'know? Deep respects for the project, Its another tool which is mostly free so the community's reaction is very weird for that... But if I can be genuinely honest, I am saying this as a guy who has never paid any community/anything online but I would for the first time genuinely sponsor the project for 5-10$ (I know it ain't much but that's all I am comfortable with donating as a teenager right now) Can you please charge atleast the solo level to atleast be the price of the silksong? I don't know but I will try the project out as it looks super cool
- cindyllm 1y ago[dead]
- sarchertech 1y agoThe problem is that a small company still needs to provide support from their own very high cost of living country. $5 doesn’t cover the cost of you filing a single support ticket.
- Imustaskforhelp 1y ago
- esjeon 1y agoThis pattern isn't new per-se. The industry already went through it when moving from DHTML to XHR, and it was (mostly) abandoned for good reasons. Modern DOM patching techniques gave rise to some newer variations, but they still make the same old trade-offs. They don't really solve engineering issues like tight coupling and brittleness, nor network issues like latency and larger payload volume. So, to me, this feels more like an effort to offer a more affordable solution (in terms of engineering cost) for small-/mid-sized companies, rather than a push to expand the boundaries of the technology. Not a bad thing, but it's just a bit disappointing to see history kinda looping back on itself.
- NaomiLehman 1y agoDoesn't Astro solve this already?
- sudodevnull 1y agoNot in the slightest
- sudodevnull 1y agoDatastar author here. Yes nothing is new here, that's kind of the point. You seemingly lost her way with jQuery which was just sprinkle on the page but then spa wasn't interesting approach at reactivity while missing all the points of the back end controlling most the state. I'm not trying to be innovative I'm just trying to get us back to some normalcy
- masfoobar 1y agoSeems interesting. I don't think its going to make me swap from htmx, though. We shall see.
- oulipo2 1y agoInteresting, but do I understand correctly that: - this would mostly work if the sole consumer of your API is the frontend, since it returns HTML, rather than, eg JSON that would be consumed by a CLI, some streaming tools, clients, etc - this would not really be suited to some Capacitor app?
- andersmurphy 1y agoYeah it assumes your building a full stack app driven by the backend. So the client and backend are tightly coupled and built for each other.
- chuckadams 1y agoDatastar's ideas look wonderful, and I've thought of adopting it myself, but hobbling the open source version to not compete with pro this early on sounds like a fast ticket to a hard fork. It's not like they command a vast ecosystem that would be reluctant to switch. [edit: Seems like the model with an open core and some closed plugins could work out fine. If not, everyone's got options. Wishing success for both the D* developers and the users.]
- nchmy 1y ago> sounds like a fast ticket to a hard fork. Indeed! Could you do us all a favour and fork the pre-pro plugins and make them compatible with the current iteration of d* pro? They're all like 50 LOC, after all, so should be simple.
- chuckadams 1y agoWere I so inclined, I'd make them compatible with non-pro. And more likely just take my fork in whatever direction I cared to, just keeping the wire format compatible (and likely negotiable). But it's a project best left for people actually using Datastar, not curious onlookers like me.
- nchmy 1y agoGiven the simplicity of doing such a fork, and that no one has done it yet, perhaps this is a non-issue?
- jopicornell 1y agoSame as my other comment, it seems like you are involved in the project. Stop responding like this is facebook or reddit. Here we offer our expertise with all good intentions. They haven't said it is a simple task, you are assuming that they said that. If you can't take constructive criticism or even respond to opinions you disagree, then it is better to not respond at all, because it is bad PR. I understand that maintaining a project like this is hard, that you need to be compensated and that open source corporate usage tends to be disgraceful. But that's not what they are telling you. They are just shating their opinion, which is part of your potential customer opinions. Share the rationale behind paywalling common features. Give us, if you have to respond, why you hide the pro features off the homepage, etc. Instead of this kind of childish reaction that adds nothing
- azemetre 1y agoIs there documentation on how they made that slick Star space animation on the front page? Very cool and retro looking
- sudodevnull 1y agoIt's just a basic 1kb web component driven by datastar attributes
- azemetre 1y agoDo you have a link to the web component? I can't find the site code anywhere on their github org.
- dang 1y agoRelated ongoing thread: I switched from Htmx to Datastar - https://news.ycombinator.com/item?id=45536000 https://news.ycombinator.com/item?id=45536000 - Oct 2025 (223 comments) There is also https://news.ycombinator.com/item?id=45537372 https://news.ycombinator.com/item?id=45537372, which I'm trying to figure out what to do with (bear with me... edit: ok, I found a place to merge it: https://news.ycombinator.com/item?id=45536535 https://news.ycombinator.com/item?id=45536535) Previously: Datastar: Web Framework for the Future? - https://news.ycombinator.com/item?id=43655914 https://news.ycombinator.com/item?id=43655914 - April 2025 (155 comments)
- joshdavham 1y agoThanks dang! Question also: do you somehow keep a "mental catalogue" of related articles or do you use some tool to find these?
- dang 1y agoMostly I just use HN Search but in a sped-up way that relies on a browser extension. https://news.ycombinator.com/item?id=44861185 https://news.ycombinator.com/item?id=44861185 (and the other stuff linked from there) has more details
- sigmonsays 1y agoas a newb, does datastar work on mobile? Most web pages I try to build never look right on firefox on android.
- pst 1y agoI've been building a frontend with Go, Templ and Datastar for a few months now. I really like the @actions and how the page is updated with the response. I'm on the fence about signals though. They are fine for simple things like individual text form fields or opening closing a drop-down. But my backend is a Kubernetes style API server. And storing a JSON Kubernetes style resource in a signal does not work because of how Datastar implements parsing the structure into child signals. For me it would be better to just be able to turn this off. One example where it breaks are K8s labels. They are map[string]string and the key is often hostname prefixed. E.g. example.com/label-key. Datastar can't handle these keys at all and the resulting signals are a mess. I'm aware that I may be using signals not as intended. But something as simple as data-signals-resource="k8sJson" and then data-bind="resource.metatdata.name" is a great way to work. And it works for metadata name. But it doesn't work if any part of the path needs to be an index in a list or a label key in hostname style. The other thing I find painful about Datastar signals are the magic about how attributes written something-something in HTML become somethingSomething in JS and all all the snake, camel etc. __modifiers. It's just error prone to work with. Not a great experience. But overall I still stuck with it so far and am happy with the general idea of HTMX and Alpine functionalities implemented as one and using hypermedia as a general approach. Anything so I can avoid the NodeJS ecosystem really. When a few RCs back the wire format changed, it was quite a laborious update for me, because using Fiber I can't use the Go SDK and implemented my own. But the wire format clearly changed for the better so it was worth it. I think the developers are on to something and should keep iterating.
- GiffertonThe3rd 1y agoHaving followed Data-* from its beginning, it's now fascinating seeing how these threads play out. The troll-y takes from those who took one brief look at the front-page and felt compelled to tear it down in their own 'worthy, hot-take'. Like T3, the critiques usually compare to JS stacks or how non-HTML it looks(!). It just doesn't make sense to them, so... "I know what I must do, instead of looking into this more, make sure I have a fuller picture of this thing, HN NEEDS to know now". You have every right, of course. But you undermine yourselves as soon as you post - you clearly have not taken any time to understand where it came from, why it is what it is. Your responses are not, say, genuine questions for clarification or helpful critiques. For the most part they are straight out judgements: 'This is just wrong'. Of course in your minds the front-page MUST provide you all that in under 30secs, yes? Like, the 'hidden', 'real cost' is ON ANOTHER PAGE?! - instead of reading the reasoning behind it and why YOU won't need it. You don't need to immediately post here - you are not really looking for answers, are you? You could've just read the website and history of Data- for that? To all the 'clarfiers' here like Delaney, Anders, nchmy, and others, thank you for the comments refuting most of this stuff, it must be tiring. All the best, An old, grumpy, ex-HyperCard 'programmer'. *You don't need to validate your comment by reply to this, many comments here are valid and you know it.
- didip 1y agoAnything that’s using server side rendering gets my vote. But isn’t HTMX+Websocket basically the same as datastar?
- replwoacause 1y agoMine too. I’ve been playing with this lately https://www.zjax.dev/ https://www.zjax.dev/ And I like what the author is doing
- nchmy 1y agoNot at all, for many reasons. HTMX doesn't do any client side interactivity. You need something like alpinejs for that. And alpine doesn't have signals, which are super useful (when used judiciously) Datastar uses sse rather than websockets, which is simpler and more compatible http,web standards etc. Htmx can use either sse or ws, but both are a separate plugin. Consequently, datastar does much more than htmx+alpine+ws/sse, in a fraction of the js size. Htmx (and alpine, I think) introduces it's own html attributes whereas datastar uses spec-compliant data-* attributes (hence the name) Htmx's api is much more complicated due to all of the extra attributes. Datastar is more concise. Datastar has backend SDKs for all popular languages, to make it easy to send html fragment and signals updates via sse. There's lots more as well. Very worth checking out.
- melasadra 1y agoIs there a good Datastar tutorial creating a small project that shows off Datastar's strengths and how the DX feels like? I saw the game of life and checkbox examples but I've never used Clojure
- nchmy 1y agodatastar is backend agnostic - you generate the html however you want. you can check out this repo if you want to see a simple golang implementation. https://github.com/zangster300/northstar https://github.com/zangster300/northstar And all of the sdks have some simple examples. https://github.com/starfederation https://github.com/starfederation
- andersmurphy 1y agoYeah. That's the real rug pull all my code is in Clojure. Which is rough if you're not familiar with reading lisp. There's a few examples in typescript and go floating around. Here's one: https://github.com/Mortalife/datastar-chat-example-ts https://github.com/Mortalife/datastar-chat-example-ts
- JSR_FDED 1y agoDatastar is run by some principled (and opinionated) guys who are immensely generous with their time and supportive to newcomers. What’s getting lost in the whole kerfufflw over the Pro version is that this is NOT a monetization strategy. There is no intent to hook you - in fact they go out of their way to tell your you don’t need it. And the company is a registered non-profit. Based on their own extensive experience they know which tiny set of features are likely to appeal to a very small group of people and at the same time are likely to incur the vast majority of support burden. By keeping these features out of the core they keep the base product simple and universal. It is in fact an innovative and fair way of (a) signaling that these features are likely footguns, (b) getting just some of their costs covered by the people who either need the most support or are getting so much value from Datastar that they’re paying, (c) thereby freeing up their time to spend on the larger community.
- esperent 1y agodata-animate - Animates element attributes over time. data-on-resize - Runs an expression on element resize. data-scroll-into-view - Scrolls an element into view. If these are footguns then they can't be designed very well. I also don't think you can say that they'd only appeal to a small group. I don't have any problem with them charging for whatever they want to. But let's not make up excuses.
- andersmurphy 1y ago1. You should be using CSS for animations 2. You should be using data-on to listen to the window level resize event (which doesn't require a pro plugin). 3. Scroll element into view can be replicated with data-on-load="el.scrollIntoView()" The main benefit of pro is supporting the project.
- HiPhish 1y ago> You should be using CSS for animations CSS can only animate appearance, not HTML attributes like the `value` of a `<meter>` > You should be using data-on to listen to the window level resize event That event is fired when the window is resized, not when an element is resized
- pragmatic 1y agoAre we back to asp.net webforms? Manage all state in the server?
- pragmatic 1y agoYes we've come full circle. Sending chunks of html from the backend and updating only parts of the page is what webforms did 20ish years ago. I'm trying to figure out what the appeal is here?
- d--b 1y agoso all the UIs I work on have some form of pivotable grids handling some decent quantity of data (several 100k rows) Obviously in react I can find components that work fine. But is that something datastar can deal with well, or is this something where Î’d need datastar and some frontend js?
- replwoacause 1y agoI like what https://www.zjax.dev/ https://www.zjax.dev/ has done
- est 1y ago<input data-on-input__debounce.200ms="@get('/examples/active_search/search')" /> seems a little crazy, why can't we use traditional methods like this? <input oninput="debounce(0.2).get('/examples/active_search/search')" /> just an idea
- webcoon 1y agoDocs mention absolutely nothing about offline use, service workers, or PWAs. How am I supposed to build a modern web app with that? Rely on always having internet?
- hu3 1y ago> Rely on always having internet? Yes? Very few cases need offline capabilities. Why complicate things unnecessarily?
- nchmy 1y agoI'm extremely interested in this sort of use case and am regularly disappointed to find that very few others are. And even fewer are interested in doing it in a hypermedia-first way. There's two ways this could be approached. 1. Just cache the backend-generated html that has datastar attributes in it, and serve it from a service worker. Datastar library in the main thread won't know or care whether it came from service worker, edge worker or your backend. 2. If there's a need for dynamic data/templating (eg user-specific into), you can do so in the service worker - if you've stored the templates and data already. But that has little to do with datastar - you'd have to do that in any case. However, service workers have limitations with regards to things like dynamic script imports, using es modules etc. You can send messages to a dedicated web worker which handles rendering and returns the html, but it does get complicated. Sharedworker would be even better but android chromium still doesn't support it - but they're finally trialing it and hopefully it'll be available in 6 months. The only datastar-specific consideration is if you want to do something like stream sse events from the "backend" to the datastar library in the main thread/dom. The TypeScript/JavaScript sdk works just fine in the service worker as well, and can maintain a long-lived connection to periodically stream new messages. Of course, service worker lifecycle is somewhat of a black box and out of your control, but that has nothing to do with d*. So, overall, yes you can use datastar offline. But it comes with all the issues that you'd face with another approach.
- rrgok 1y agoIt amazes that we are a still solving low level problems for CRUD applications. No, you cannot develop highly interactive non CRUD app with Datastar/HTMX/Unpoly. We need higher level abstractions and solutions. How the client and the server communicate is still low level for developing apps, more so CRUD apps.
- 0xcb0 1y agoThe more I look at it, the more it feels like knowing Vue will vastly help when learning to transmit ones workflow. Will use it on of my next projects and try it out. Looks interesting. Thanks for the good work!