4 ms·
Could provide actual arguments for why these aspects of Datastar are "crazy", "even more crazy" and "wrong"?
by macmac 1y ago
Could 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]