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

I've built web components for many years and talk with a lot of web developers regularly about them. I'd like to look at this question from their perspective. Devs don't care about implementation challenges or diving into the weeds.

We need to keep customized built-in elements. **CE v1 is not a spec without a way to extend existing HTML elements.**  [My talk](https://youtu.be/pBCDdeqzUlY?t=14m11s) at the Progressive Web App Summit highlights some of the reasons why it's important to keep:

- Utilize built-in a11y features of the element. This is one of the primary reasons to keep it. I've seen far too many devs build custom elements that miss out on basic a11y...forget it altogether 👎. 
- More DRY. One gains native features for free (keyboard behavior, imperative API, and styling). Even recreating all the benefits of `<button>` requires [way too much code](http://jsbin.com/samowataqa/edit?html,output).
- Autonomous elements don't have the black magic that native elements have (e.g. creating an element that participates in `<form>` is painful). Same with extending other types of children.
- Existing tools understand built-in elements
- Existing CSS theming libraries work better with it
- In Polymer, folks really the extended helpers (`<template is="dom-repeat">`, `<template is="dom-if">, `<body is="dom-bind">`. They're easy to reason about, declarative, and simple to use. You know exactly what you're getting.
- I talk to a lot of web developers. They don't mind `is=""`.
- No other component library gives you all ^ for free.

Whether  `is=""` is the way to extend elements or not doesn't matter to much.  But we definitely need a solution rather than no solution and currently, that's `is=""`. Personally, I see nothing wrong with `is=""`. It's worked great for the last couple of years in Chrome's v0 implementation. It's been implemented in a browser and proven. There may be edge cases with subclassing certain elements, but TBH, I haven't seen many (any?) developers run into them.

Ultimately, **developers have to write less code** with `is=""`. That's huge. Extensions bring more reuse and keep best practices to our platform. Not less. Let's not remove such a useful feature.


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

Received on Wednesday, 6 July 2016 14:03:23 UTC