Previously the syncInfo used to store changed properties while the dom-if was false was stored on the dom-if. This means that even under restamp, any stored properties from a previous instance would be applied to the next instance. This change moves the syncInfo storage to the instance, so it naturally goes away when the instance is discarded. Any new instance will take current values from the host.
Due to limitations described in #4818, it is bad/illegal to allow paths to be batched and played through runEffects, since effect de-duping occurs by root property, so effects will only be running once for the first path matching an effect, with all other paths being dropped on the ground. This can be particularly bad if the user e.g. set a path to an object, and then subsequently nulled the object; the observer would then be acting on a path that is no longer valid. This change only stores the root property & value for any paths that come in, which matches the non-fastDomIf behavior with only storing root(prop) in __invalidProps.
syncInfo
used to store changed properties while the dom-if was false was stored on the dom-if. This means that even underrestamp
, any stored properties from a previous instance would be applied to the next instance. This change moves thesyncInfo
storage to the instance, so it naturally goes away when the instance is discarded. Any new instance will take current values from the host.runEffects
, since effect de-duping occurs by root property, so effects will only be running once for the first path matching an effect, with all other paths being dropped on the ground. This can be particularly bad if the user e.g.set
a path to an object, and then subsequently nulled the object; the observer would then be acting on a path that is no longer valid. This change only stores the root property & value for any paths that come in, which matches the non-fastDomIf
behavior with only storingroot(prop)
in__invalidProps
.Reference Issue
Fixes #5629