Closed theengineear closed 2 years ago
@theengineear why would they be disinclined to declare this in the property block? Can you include a material example? Not resisting the change per se but I don't yet follow when/why I would use this
Why would they be disinclined to declare this in the property block?
Yah for sure. Here are a couple thoughts:
observedAttributes
— we can append logic to connectedCallback
, disconnectedCallback
, attributeChangedCallback
via super.*()
, why not this one particular method? It just strikes me as an unnecessary restriction. That is, "I'm an expert — let me do the thing."☝️ — Sorry, that got wordier than I intended! I hope these arguments are still readable! I'm also going to drop some additional thoughts in a note below (just want to keep ideas somewhat organized).
AND, some other thoughts:
input
element! I don't know whether we should support such interfaces, but it's been on my mind lately.Wew, I can't believe I left this hanging since May. I will admit I don't fully grok the technical problem, and a code level example would help, but I don't want to level more burden contextualizing this. You had me at "I can add behavior to the other standard methods, why not observedAttributes
" — philosophically this is misaligned with the project, and we should get out of your way when possible.
Super minor change, but we expect all
observedAttributes
to come from our statically-declaredproperties
. Instead, we should assume that authors may want to observe additional attributes beyond what they declared in the properties block. That is, we should allow this: