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

Process paths regardless of accessor, & loop on computeLinkedPaths. #4546

Merged
merged 3 commits into from
Apr 19, 2017

Conversation

kevinpschaaf
Copy link
Member

@kevinpschaaf kevinpschaaf commented Apr 18, 2017

Fixes #4542

The _setPendingPropertyOrPath implementation that the public set leverages does not trigger _propertiesChanged if the root property being set has no accessor. Generally this is correct, except that linkPaths can result in triggering linked paths with accessors, but where the root property being set has none. As such, set should always result in _propertiesChanged running, to match the 1.x behavior and give computeLinkedPaths an opportunity to run.

Additionally, since computeLinkedPaths only did one loop over the links, if a newly generated link was subsequently linked to a path earlier in the list, it would never compute to that link. As such, computeLinkedPaths was moved to runComputedEffects and takes advantage of the same while loop that runs until no more pending properties are generated.

}
this.__dataHasPaths = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems broken. If there's no accessor then the value is not applied because _setPendingProperty will not actually set the value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider setting all the linked paths here and avoiding doing it in runComputedEffects.

Copy link
Member Author

@kevinpschaaf kevinpschaaf Apr 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For paths, the only time Polymer.Path.set is required to update the value is iff it is !isPathNotification; if it is a path notification, the value is guaranteed to have already been set.

Copy link
Contributor

@sorvell sorvell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sorvell sorvell merged commit e302661 into master Apr 19, 2017
@sorvell sorvell deleted the 4542-kschaaf-transitive-links branch April 19, 2017 22:19
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