Re: [w3c/webcomponents] [idea] Make use of `observedAttributes` optional (#565)

FWIW, I don’t feel particularly concerned about the extendability issue—I think the status quo for extension is fine. That said, I think making `observedAttributes` always a list (of strings and/or expressions) would be better than a list-of-strings-or-one-expression for two reasons:

- Extending an existing regular expression isn’t necessarily simple. For example, what if a super class uses `u` flag on the expression but you don’t want to on the subclass or vice-versa? Adding another expression onto a list avoids subtle errors people could have here.
- Extension in general, even if just adding more strings, is straightforward. Instead of handling four possible cases as above, there’s only one: `concat()` onto the list.

I think supporting some kind of expression would also be good in so far as it “explains the platform” for attributes `data-*` / the `dataset` property, which I don’t think could be handled through custom elements as-is right now (please correct me if I’m wrong on that).

-- 
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/565#issuecomment-248778451

Received on Thursday, 22 September 2016 00:07:47 UTC