Re: [w3c/webcomponents] Element Behaviors, and the has="" attribute. A useful alternative to Custom Elements in many cases! (#727)

@annevk @Nashorn Hey guys, you both mentioned `mixins` and `@traits` at the JS level, but besides the fact that class-factory mixins have existed for a long time, there's issue with them being defined on a class:

- They aren't declarative.
- They are not added or removed _at runtime_.
  - You can update an element from `has="foo bar"` to `has="foo"` in order to remove the trait/behavior/feature.

If we want to go the JS approach (which is nice for JS regardless of DOM existing or not), we may as well just remove HTML for defining trees that have features, and just use plain JS. We already have `jQuery.fn` to accomplish all of this repo without Custom Elements.

-- 
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/727#issuecomment-451869526

Received on Monday, 7 January 2019 09:16:23 UTC