top | item 45537447

(no title)

daeken | 4 months ago

I 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.]

discuss

order

hasanhaja|4 months ago

Isn'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|4 months ago

Because 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

So you can have

   data-on-click__debounce.200ms="$landingGearRetracted && @post('/launch')"
Which is just bad design