←back to thread

69 points jdkoeck | 2 comments | | HN request time: 0s | source
1. svieira ◴[] No.44436782[source]
The piece that I don't like about this is trying to standardize how to "spell" setting attributes, properties, and events in a single namespace by using sigils. JavaScript isn't Perl or K and the whole `@` vs. `.` vs `?` feels alien to the language (in my opinion). It also doesn't feel like something that could be used correctly by a component author who wanted to pass props _through_ the component they own to another component they don't.

I would expect to use something more like namespaces, where the default would be shorthand `on:`, `attr:`, `prop:`, `propOrAttr:` (maybe this is the default?) but where an explicit namespace declaration could move them if you for whatever reason needed to support XHTML 5.1 and your document already used the `on:` namespace for something else (not that _that_ is a thing right now, but why not be prepared?)

replies(1): >>44437561 #
2. jfagnani ◴[] No.44437561[source]
Author here. Property and event disambiguation syntax is definitely far on the easy to change side of things.

I personally think the sigils are easier to read and write than perfixes, and these particular sigils have popped up independently in multiple libraries like Vue, Lit, and LighterHTML.

But this API could use prefixes, or like Vue, it could support both.