Re: [w3c/webcomponents] Custom Element - untrackable upgrade (#671)

The problem of pre-upgrade properties can be addressed from two different places: outside the element, where the properties are set, or inside the element when it boots up.

I think the problem with offering APIs like `whenDefined(element)` or something else that lets the setter wait until the element is upgraded to set properties is that this waiting would need to be implemented in any framework that wants to handle custom elements upgrades - they'll need to do work and opt-in to this behaviors.

If we help custom elements themselves consume pre-upgrade properties, then frameworks won't need to do anything, and custom elements will be upgradable in more cases.

Would it be possible to add something to upgrading like:
  1. Remove and store all own properties on the element
  2. Perform existing upgrade
  3. Re-set the properties from (1)

If that's too drastic, could there be a static property similar to `observedAttributes` that opts into the properties that need to be removed and re-set? CE base-classes/frameworks could implement a getter that returns the properties that it generates accessors for, or use the property to know what accessors to generate.

-- 
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/671#issuecomment-333324070

Received on Saturday, 30 September 2017 17:39:53 UTC