webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.13k stars 165 forks source link

[scoped-custom-element-registry] The polyfill should not conditionally install itself #549

Closed justinfagnani closed 2 weeks ago

justinfagnani commented 10 months ago

The Scoped Custom Element Registry proposal is not finalized, and does not have a spec, or any native implementations. The current conditional install based on a shallow feature detection causes an extreme forward-compatibility risk. If a native implementation ships that defined ShadowRoot.prototype.createElement but behaves differently from the polyfill, pages with the polyfill deployed could break.

The polyfill should unconditionally install itself to ensure the current behavior until there is a finalized spec and shipping implementations.

regevbr commented 6 months ago

I found another case why this is bad - if you enable chrome://flags/#enable-experimental-web-platform-features the polyfill will not be installed, but importNode feature is not implemented by the chrome flag and as such there is no way to add it and things break

artem-sedykh/mini-climate-card/issues/137

justinfagnani commented 2 weeks ago

Fixed by https://github.com/webcomponents/polyfills/pull/581