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

[Feature request] Run computed properties in dependency order #5143

Comments

@kevinpschaaf
Copy link
Member

kevinpschaaf commented Mar 9, 2018

Description

Currently computed properties with invalidated dependencies are re-computed based on a combination of order they exist in the properties block and the order that dependencies are set, and will continue re-computing if subsequent dependent properties change. This can result in computed properties running more than once in a turn, which is both inefficient if the computed property has expensive computation/side-effects, and may violate user expectation.

Live Demo

https://jsbin.com/lofapu/1/edit?html,console

Expected Results

Note that computeZ is run twice for the same change to x

Actual Results

Ideally computeZ would only be run once

Browsers Affected

All

Versions

  • Polymer: v2.x
@kevinpschaaf
Copy link
Member Author

Proof-of-concept mixin that recurses to run computed dependencies of a computed proeprty first: https://jsbin.com/dewewah/edit?html,console

@stale
Copy link

stale bot commented Mar 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 13, 2020
@rubenlg
Copy link

rubenlg commented Mar 13, 2020

Stale? Isn't it fixed already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment