Partly because I almost never encounter people (at confs, JS meetups etc) actually using them, partly because I still believe if we'd designed the primitives slightly differently they would have more general utility
-
-
Replying to @Rich_Harris @dmitryshimkin and
If you want to engage on the later, let's discuss (assuming constructive collaboration; nobody treating folks like idiots who don't care about other's concerns, etc.)
1 reply 0 retweets 1 like -
Replying to @slightlylate @dmitryshimkin and
I appreciate the gesture, but hasn't the ship sailed? It seems hard to imagine that we'd e.g. undo the coupling of encapsulated styles to SD in favour of a declarative mechanism, or eliminate attributeChangedCallback in favour of a unified interface for passing data to components
2 replies 0 retweets 3 likes -
Replying to @Rich_Harris @dmitryshimkin and
Declarative layered on imperative very much possible (and as explained up thread, considered at length) Apple will be the ones to convince re: attribute changed.
1 reply 0 retweets 3 likes -
Replying to @slightlylate @Rich_Harris and
But "unified" is misleading. HTML and SVG elements have attributes *and* properties. We can't pretend they don't.
1 reply 0 retweets 3 likes -
Replying to @slightlylate @Rich_Harris and
We tried a way to unify data passing through DOM hierarchy (MDV); framework community had a *fit*
1 reply 0 retweets 2 likes -
Replying to @slightlylate @dmitryshimkin and
But you can imagine an alternate timeline in which we decided (for example) that (for custom elements only), attributes were simply the input value to a function that determined initial properties, and from that point forward weren't treated as an interface
2 replies 0 retweets 2 likes -
Replying to @Rich_Harris @dmitryshimkin and
What happens when someone calls setAttribute()?
1 reply 0 retweets 0 likes -
Replying to @slightlylate @dmitryshimkin and
if it's a standard HTML attribute like hidden or style, it does exactly what it would do for any other HTML element. But it doesn't trigger some lifecycle callback. If you want to pass new data, you have to set properties on the instance instead. (Not necessarily getters and
1 reply 0 retweets 0 likes -
Replying to @Rich_Harris @slightlylate and
setters, because it'd be nice if updates were batched naturally. But similar idea)
1 reply 0 retweets 0 likes
Hidden/style etc absolutely go through a system like attributeChanged inside setAttribute impl in C++ side of DOM
-
-
-
Replying to @Rich_Harris @dmitryshimkin and
So if you want "what other built-ins do", this is what they do!
2 replies 0 retweets 1 like - 13 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.