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

@csuwildcat Curious how you'd feel about a solving this problem through composition instead of direct inheritance. My thoughts stem from React and Higher Order Components that render out props.children. 
```html
<my-field>
  <input />
</my-field>
```
In the above case `<my-field>` doesn't have a traditional CE light/shadow dom. It becomes a virtual wrapper / proxy element for the `<input>`. By way of being a proxy element it would inherit the behavior and accessibility of the target.

Ideally this would be able to support arbitrary depths of nesting:
```html
<my-provider>
   <my-behavior>
     <select>
       ...
     </select>
  </my-behavior>
</my-provider>
```

>From the DOM perspective, selecting a decorator/proxy element would ultimately give you it's target.

You could define a decorator/proxy element the same way you do a custom element now but provide a flag to denote that it is a decorator/proxy.

@rniwa I'd be interested to hear what your thoughts on this are as well.

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

Received on Monday, 20 February 2017 04:05:07 UTC