polyfills icon indicating copy to clipboard operation
polyfills copied to clipboard

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

Open justinfagnani opened this issue 2 years ago • 1 comments

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.

justinfagnani avatar Aug 16 '23 17:08 justinfagnani

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

regevbr avatar Dec 26 '23 11:12 regevbr

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

justinfagnani avatar Jun 20 '24 17:06 justinfagnani