Re: [w3c/webcomponents] [idea] Ability to define Custom Element attributes (and optionally enable getters/setters for those attributes). (#517)

@treshugart HTML elements are the standard that everyone uses. You've proposed a workaround, but it's not really a solution because libraries (React, Angular, virtual-dom, Riot.js, etc) can't guess what properties a Custom Element uses. f.e., React won't know which property to use for `some-attribute` in `<my-button some-attribute={foo} />`). HTML attributes are the explicit interface of communication (attributes *are* element properties) to/from DOM (including from the server-side, noting that JS properties exist only on the client-side). More details in https://github.com/w3c/webcomponents/issues/519. 

Now that we'll be writing ES6 classes, there's no reason why `setAttribute` calls should need to leave the JavaScript environment for Custom Elements, so the factor of 3 that you mentioned can probably be eliminated for Custom Elements if the browser implementation is designed to take advantage of this fact.

---
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/517#issuecomment-225455451

Received on Sunday, 12 June 2016 19:27:08 UTC