[w3c/webcomponents] Reserve hyphenated or `$`-including properties/attributes for customization (#700)

For the sake of enhancing individual element instances (or their prototypes), having the peace of mind to add a method (or other property) via JS without fear of conflict would be helpful, even if it doesn't meet all use cases of customized built-in elements. It would also avoid the ugliness of adding symbols (or worse, maps) during attachment and method invocation (though admittedly hyphens are still somewhat awkward for JS given the need for calling methods like `elem['my-method']()`). An alternative would be reserving `$` so `elem.$myMethod()` would not only work without the need for brackets, but would also clearly signal a non-standard method/property.

While this might not deal with custom elements per se, since the spec is reserving the hyphen for elements, and since the suggestion relates to one of the use cases for customized built-in elements (being able to enhance them as is, including intuitively using `this` scoped to the element along with convenient access through that `this` to other such custom methods), I thought it might be appropriate to add the suggestion here.

-- 
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/700

Received on Wednesday, 8 November 2017 09:33:14 UTC