Re: [w3c/webcomponents] The is="" attribute is confusing? Maybe we should encourage only ES6 class-based extension. (#509)

> I believe custom elements generally aren't supposed to depend on other custom elements being in the page, so they work independently.

Have you looked at for example `<iron-routing>, <iron-location>, <iron-ajax>, <neon-animated-pages>, etc.`?  We have barely scratched the surface of what we will be doing with custom elements, but one thing that is very clear is that they will be collaborating.  

> is already in the spec but it still needs to identify what element you wish to apply it to because HTMLButtonElement is an interface and elements share interfaces so there is a small problem about what element is being targeted, if its native.

> customElements.define('fancy-button', FancyButton);

Identifies that we are creating a `<fancy-button>` that is also a `<button>`.  The `<button>` part can be derived from `FancyButton extends HTMLButtonElement`.

In some case we have the same super class for two elements.  In that case the additional specificity can be given or the class hierarchy can be modified such that all native elements get their own superclass.

> Why would a customized built-in element have more tests?

Everything you said in this section is correct if we are using the customized built in element in the element form without using `is`.

If we are using `is` then it depends on how many levels of PE you have.  For example you pointed out that this issue application uses mostly html.  Suppose it was composed of many custom elements and some of them did not work right, like the <preview-tab>, because the `PreviewTab` class did not load.  So if we want to have a PE level that we accept that the `PreviewTab` is not going to load then we should create a test case for this, evaluate to see whether that is actually a satisfying enough customer experience, etc.  And doing this across all the browsers is expensive and time consuming.

So I agree with you that we should be able to customize built ins.  And that way that should be done is by first extending the corresponding built in element's class, then using a define call to target the corresponding custom element, and then using that element in full element form only.  
   



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/509#issuecomment-265765274

Received on Thursday, 8 December 2016 15:19:47 UTC