To me CustomElements V1 is the API that would have benefited most from origin trials. It was specced unpolyfillable (relying on ES6 syntax) which real dev exposure would have immediately found. Classic failure of backroom standardizationhttps://twitter.com/slightlylate/status/1139626438766673920?s=19 …
They core problem is that to be "truly native", subclasses of host objects and intrinsic types (e.g. Array, Number, etc.) need a way to signal to the runtime that they are "special". For DOM, this means wiring up a C++-side pointer to a backing struture (in ~all impls).
-
-
I think it was an architectural mistake to rely on inheritance instead of composition. There is literally no reason to actually inherit from built-in elements instead of supplying a bunch of lifecycle callbacks
-
Again, we need to wire "DOMness" at new-time. Can't happen later, sorry = ( Agree we should break up the internal lifecycles of the rest of DOM stuff into mixins that are purely pollyfilable.
- 2 more replies
New conversation -
-
-
This has to be done super early in the object's lifetime. In V0, we did this by looking at the swizzled prototype chain at new-time. This allowed the runtime to allocate the required backing data and wire up property lookup to use it. In V1, `super()` has to happen *first*.
-
Both approaches get you temporally coherent "DOMness", with the syntactic approach opening up the same thing for other intrinsic types at the cost of
@cramforce's regretted compat/polyfillability - 6 more replies
New conversation -
-
-
Lol, thanks for describing that as if I wasn't literally sitting next to you when JS class inheritance was designed :P I remember early sketches of custom elements using class syntax, but I stopped tracking the development, which is why I didn't know that there was a dependency
-
This here twitter-dot-com is a big room and other people might be listening! Didn't mean any disrespect.
- 1 more reply
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.