News for hackers. Stuff that matters.
Re:Datastar: Lightweight hypermedia framework for building i... by troupo on Friday October 10, 2025 @08:20AM (#45538129)
Both 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>
Re:Datastar: Lightweight hypermedia framework for building i... by sudodevnull on Friday October 10, 2025 @09:44AM (#45538966)
Datastar is spec compliant HTML. Please point me to the code that's not HTML spec compliant
Re:Datastar: Lightweight hypermedia framework for building i... by jmstevers on Friday October 10, 2025 @08:41AM (#45538321)
Well they are both "just HTML", Datastar being better about being spec compliant using the dataset attributes and all.

By expanding the "Datastar expression" language, do you mean a compiled language or moving all the expressions into JS files or something else?

Re:Datastar: Lightweight hypermedia framework for building i... by troupo on Friday October 10, 2025 @09:58AM (#45539143)
> By expanding the "Datastar expression" language, do you mean a compiled language or moving all the expressions into JS files or something else?

Doesn't matter. They literally already have a Javascript-like DSL: https://data-star.dev/guide/datastar_expressions