-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Enable native Custom Elements v1 #25173
✨ Enable native Custom Elements v1 #25173
Conversation
This will attempt to use native CEv1 when supported. Based on whether the anonymous class remains a real, native ES6 class, we can use 0 polyfill (fully native support). If it's transpiled into a `function () {}`, then we can use a minimal polyfill that wraps the `HTMLElement` constructor only.
e24c911
to
0e9cf82
Compare
@@ -377,6 +377,8 @@ describe('amp-img', () => { | |||
it('should propagate the object-fit attribute', () => { | |||
return getImg({ | |||
src: '/examples/img/sample.jpg', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these test breaking due to this change (if so why?)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the native Custom Elements implementations are able to fire connectedCallback
much quicker than the MutationObserver
the polyfill uses.
I created a new RTV experiment so that this can be tested on a smaller population. /cc @lannka and @zhouyx, I also updated the |
Sounds like a great idea! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be really convenient if we could change to a
.eslintrc.js
file, so that we could dynamically generate the defined experiment globals fromexperiments-config.json
. @rsimha?
This might be possible, but will require lots of testing with our existing lint toolchain, VS Code, Prettier, etc. Can you file a FR?
* Try enabling native Custom Elements v1 This will attempt to use native CEv1 when supported. Based on whether the anonymous class remains a real, native ES6 class, we can use 0 polyfill (fully native support). If it's transpiled into a `function () {}`, then we can use a minimal polyfill that wraps the `HTMLElement` constructor only. * Fix img tests * Bump travis * Define NATIVE_CUSTOM_ELEMENTS_V1 RTV Experiemnt
This will attempt to use native CEv1 when supported.
Based on whether the anonymous class remains a real, native ES6 class, we can use 0 polyfill (fully native support). If it's transpiled into a
function () {}
, then we can use a minimal polyfill that wraps theHTMLElement
constructor only.