Wish Vue used the React component model, and wish Custom Elements could model it 1:1, but `constructor` sucks.
-
-
Replying to @tbranyen @TheLarkInn and
Can you unpack that last part? I don't understand the role constructor plays in this context (thanks!)
1 reply 0 retweets 0 likes -
Replying to @rwaldron @TheLarkInn and
React Components are passed `props` in `constructor`, not possible to emulate w/ Custom Elements (attrs not set, can't change whats passed)
1 reply 0 retweets 0 likes -
Replying to @tbranyen @TheLarkInn and
So custom elements' constructor is broken?
1 reply 0 retweets 0 likes -
Replying to @rwaldron @TheLarkInn and
For full parity with how React Components work right now yea :-/. React impl will use constructor, Web Component must use createdCallback
2 replies 0 retweets 0 likes -
Replying to @tbranyen @TheLarkInn and
Ah! now I remember all of this crap from when
@ErikArvidsson argued for custom elements to be describable in terms of ES classes.1 reply 0 retweets 2 likes -
Replying to @rwaldron @TheLarkInn and
Yea, something like this would be great, but the DOM has to be a special snowflake right?https://gist.github.com/tbranyen/57b64798a0ec02f178492f29b6cdba46 …
4 replies 0 retweets 0 likes -
@slightlylate always argued for the constructor to take a bag of props. It didn't work out for reasons I no longer recall.2 replies 0 retweets 2 likes -
Replying to @ErikArvidsson @rwaldron and
By default it probably shouldn't take anything, but making HTMLElement super-able would allow devs to use `new` on their shiny-ES Custom Els
2 replies 0 retweets 1 like -
You can do that... (disclaimer I haven't followed web components closely after leaving Google)
2 replies 0 retweets 2 likes
It's *almost* like we had a plan this whole time to bring JS and DOM closer together...
-
-
Replying to @slightlylate @ErikArvidsson and
hahaha sooo... not sure why I'm getting illegal invocation sometimes... but a basic demo, proves you are correct!pic.twitter.com/WmehrveFRC
4 replies 0 retweets 3 likes - 7 more replies
New conversation -
-
-
Replying to @slightlylate @ErikArvidsson and
Interesting that this `new` invocation only works if you've registered the Custom Element.
0 replies 0 retweets 2 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.