3 ms·
Never mind - I've just discovered Web Components are not supported at all on Safari, which sinks the idea of Web Components being a viable alternative to anythi
by andrewstuart 5y ago
Never mind - I've just discovered Web Components are not supported at all on Safari, which sinks the idea of Web Components being a viable alternative to anything.
https://caniuse.com/?search=web%20components https://caniuse.com/?search=web%20components
Here's the reasoning from Safari developers: https://bugs.webkit.org/show_bug.cgi?id=182671 https://bugs.webkit.org/show_bug.cgi?id=182671
- WickyNilliams 5y agoThey are supported! Safari does not (and will not, as explained in your link) support one specific API for web components, the `is` attribute: <button is="my-button"> But when people talk about web components, they are almost certainly talking about this kind of component: <my-button></my-button> Which is fully supported in safari. The former can be polyfilled, but i doubt (m)any components are being developed like that. Aside from this, safari has great support for WCs and is just as capable as any other evergreen browser.
- andrewstuart 5y agoI cannot see that Safari supports the "connectedCallback" in Custom Elements, which seems to be to be foundational to the entire technology. https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks https://developer.mozilla.org/en-US/docs/Web/Web_Components/... If you're correct about Safari's level of support can you referf me to where it supports connectedCallback?
- WickyNilliams 5y agoThe proof, as they say, is in the pudding: https://codepen.io/WickyNilliams/pen/dydoNez https://codepen.io/WickyNilliams/pen/dydoNez It's been supported for years AFAIK. As long as you extend HTMLElement, and not some other element, everything will work as expected
- bennypowers 5y agoshould have posted this in r/confidentlyincorrect Yeah, here's my youtube video from 3 years ago preemptively proving you wrong https://www.youtube.com/watch?v=Vz433mJR2ow https://www.youtube.com/watch?v=Vz433mJR2ow