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

> These two would result in a flush of contents, and would be very confusing for users.

how weird, I've written this on Chrome and it doesn't even lose the focus
```js
document.body.innerHTML = '<input is="my-input">';
setTimeout(() => {
  document.registerElement(
    'my-input',
    {
      extends: 'input',
      prototype: Object.create(
        HTMLInputElement.prototype
      )
    }
  );
}, 2000);
```

> each web page needs to be written that doesn't assume that custom elements are always available.

precisely, a form or a list of images, as example, without special powers, without that carousel.


> people don't write code whereby which they deal with js files being asynchronously loaded in arbitrary order

This is your assumption which contradicts `customElements.whenDefined(name).then(...)` principle.
Custom Elements can be composed on demand at runtime, I've no idea why you have decided to limit the platform the way you think the Web is written.

> Do you have any examples of a large Web app in which they can continue to function while some or all custom elements have failed to load?

of "_a large Web app_" ? Have you realized developers are scared to even go close to this mess that is Custom Elements in the last 2 years? People moved to React instead, some courage one at Google wrote some Polymer based app because nobody wants to deal directly with Web Components these days and if there's one thing Web developers asked for was the ability to extend native components.

Something not even close to be on the plate. TL;DR no, I don't have that large example; with such state of the art I wouldn't dare myself to write one.

However, I am pretty sure AMP HTML doesn't load everything at once (or maybe it does, but I don't have other examples).


> Browsers would not be able to do this because in practice, the assistive technology looks at what's rendered to the screen (CSS box model), not DOM.

If JS fails and a form was there to work it will work regardless, this is what HTML and CSS is about: failsafe.

Others already mentioned screen readers I believe would ignore CSS completely.

As summary: these counter arguments are weak while `is=""` attribute has been already used in major projects such Polymer and in production: it just works, as ugly as it looks!

Keep saying we don't need it while products that used it have already shipped is simply negating facts.



-- 
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-302336782

Received on Thursday, 18 May 2017 08:28:36 UTC