by daeken · 1y ago · 0 comments
[Edit: this should've actually been attached to the GP comment. I agree with the parent.]
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
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
So you can have
data-on-click__debounce.200ms="$landingGearRetracted && @post('/launch')"
Which is just bad designBut 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.
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?
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>