News for hackers. Stuff that matters.
Re:Datastar: Lightweight hypermedia framework for building i... by hasanhaja on Friday October 10, 2025 @08:00AM (#45537930)
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 i... by troupo on Friday October 10, 2025 @08:22AM (#45538150)
> But again, the API design woes are subjective

They aren't. This is not good API design

    <button data-on-click__window__debounce.500ms.leading="$foo = ''"></button>
> "Wrong" to me suggests a gap in the understanding of fundamentals or of how things work.

Snide vaguely dismissive remarks don't make such remarks true.

> If the ideas of Datastar are fine to all of us

Who's us? Are these "us" in the room with us right now?

Re:Datastar: Lightweight hypermedia framework for building i... by sudodevnull on Friday October 10, 2025 @09:43AM (#45538958)
We are limited to what is possible in the data dash-* spec. If you have better syntax that's going to work everywhere in every browser please let us know!
Re:Datastar: Lightweight hypermedia framework for building i... by troupo on Friday October 10, 2025 @10:35AM (#45539591)
You literally have a custom Javascript-like DSL already https://data-star.dev/guide/datastar_expressions

This wilful insanity is completely incomprehensible to me (HTMX and lit are also fully infected with it): "Oh no, we are just HTML, we can't do anything" while literally doing tons of things outside of HTML.

Re:Datastar: Lightweight hypermedia framework for building i... by sudodevnull on Friday October 10, 2025 @01:44PM (#45541698)
What's your alternative that stay HTML spec compliant? Instead of whining show code
Re:Datastar: Lightweight hypermedia framework for building i... by troupo on Friday October 10, 2025 @03:09PM (#45542600)
> What's your alternative that stay HTML spec compliant?

Again: you literally have a custom Javascript-like DSL in Datastar. Use that.

It's like the "it's just HTML" or "it's HTML-compliant" mantra somehow damages the brain, or something.

Edit: this custom JS-like DSL is so prominent and such a crucial part of Datastar, that it's referenced in the very first paragraph of reference: https://data-star.dev/reference

Oh, look, your HTML-spec-compliant thing in which it is apparently impossible to do anything outside data-* attributes somehow calls external functions, and updates signals, and reads signals, and does all sorts of things:

    <div data-signals-result>
        <input data-bind-foo 
           data-on-input="myfunction(el, $foo)"
           data-on-mycustomevent__window="$result = evt.detail.value"
        >
        <span data-text="$result"></span>
    </div>
But no! It's absolutely impossible to do something about data-on-click__window__debounce.500ms.leading
Re:Datastar: Lightweight hypermedia framework for building i... by hasanhaja on Friday October 10, 2025 @08:39AM (#45538295)
> They aren't. This is not good API design

Why isn't it a good API design?

> Snide vaguely dismissive remarks don't make such remarks true.

Agreed! I don't believe I was doing anything of the sort.

> Who's us?

People on this thread.