-
Notifications
You must be signed in to change notification settings - Fork 166
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
[Custom Elements] Support extending elements #102
Comments
@imelnych do you have a code snippet of what you are trying to do?. Sometimes, just some text doesn't help people understand specifically what you are trying to say From what I learnt, you can not extend native elements yet. you can only extend the generic HTMLElement. |
The spec tells that you can extends built-in elements |
but the specs need to be implemented yet. #6 you can follow the specs, only after the browsers support them natively, or when a polyfill is ready to support it. At this point neither are! |
To clarify, the code:
and:
My question was about it being supported by the polyfill. |
@justinfagnani when will the v1 polyfill support customized built-ins? |
I'm not working on it at the moment. We have to patch all the built-ins to make it work, which might be better as a separate script. PRs definitely accepted. |
I may be able to help out with implementing this. If I understand the spec correctly, custom built-in elements (which extend So implementing this consists of: Sounds like work has definitely not started on patching the built in elements, but has work started on the |
You also have to patch |
TRUE! However, then you do not get the updated |
Hi guys, Is this still an issue? It's not listed in "Known Bugs and Limitations", so I'm a bit confused. |
@wanttofly88 I really recommend using those battle tested and feature-complete custom-elements V1 polyfills provided by WebReflection:
|
@AndyOGo people could use those, but I guess the question is—what does that mean for this project? Patching built-ins could remain an add-on to the baseline custom elements polyfill, but shouldn't the ideal goal be to provide a polyfill path via the webcomponents org? |
@emilio-martinez I just can tell, I used this project before, had this Demo: https://ungap.github.io/custom-elements-builtin/test/ The only "caveat", you can't use |
We've been hesitant to support customized built-ins only because Safari is dead-set against it and we don't want applications to be stuck with a polyfill on Safari. As Firefox and Edge implement Custom Elements supporting customized built-ins, our calculus changes a bit and we've been considering it more recently, but requiring the polyfill for a very large portion of mobile users is still something to consider carefully. As for a couple of points specifically:
This is not true anymore: https://github.com/ampproject/amphtml/blob/master/src/polyfills/custom-elements.js
This is a really unacceptable caveat for us. The other unacceptable caveat is that it doesn't work with ShadowDOM. See https://codesandbox.io/s/q292jm2nw |
Thanks for your reply.
I know, what a bummer...
Interesting, I only know that WebReflection is sponsored by Google to bake it 🤔
Here I disagree, it comes with far less problems if any component just relies upon
IMHO ShadowDOM itself is a caveat, just because it never can't be 100% polyfilled. You can't stop the CSS cascade... |
What is your example supposed to do / not do? When I click the autonomous element containing the shadow root containing a built-in button, it seems to work ? Thanks. |
@prushforth in Safari that doesn't work. |
@justinfagnani right, of course |
I am curious if the polyfill here: https://github.com/ungap/custom-elements-builtin could help? I would love to see this be better supported across the browsers who are behind the W3C spec!! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
After trying to follow this article and adding a custom button element I found that extend is not currently supported. Am I missing something? Are there any estimates on when it will be?
This seems very important but it's not even mentioned in https://github.com/webcomponents/custom-elements#differences-from-spec.
The text was updated successfully, but these errors were encountered: