Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store syncInfo on instance and don't sync paths. Fixes #5629 #5630

Merged
merged 3 commits into from
Feb 21, 2020

Conversation

kevinpschaaf
Copy link
Member

@kevinpschaaf kevinpschaaf commented Feb 13, 2020

  • 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 Array changes don't propagate into dom-if=false #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.

Reference Issue

Fixes #5629

* 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`.
lib/elements/dom-if.js Show resolved Hide resolved
lib/elements/dom-if.js Outdated Show resolved Hide resolved
lib/elements/dom-if.js Outdated Show resolved Hide resolved
(same as invalidProps for non-fastDomIf)
@kevinpschaaf kevinpschaaf merged commit 537da37 into legacy-undefined-noBatch Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants