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

[BUGFIX canary] Ensure @tracked setter triggers a revalidation. #17682

Merged

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Feb 28, 2019

Prior to this change, setting a tracked property when there was on ambient runloop would never schedule a revalidation and would therefore never rerender.

This change ensures that any set of a @Tracked property will enqueue a revalidation regardless if there is a current runloop or not.

@rwjblue rwjblue force-pushed the failing-test-for-tracked-set-outside-runloop branch from d70e3eb to 47d201a Compare February 28, 2019 18:02
@rwjblue rwjblue changed the title WIP [BUGFIX canary] Ensure @tracked setter triggers a revalidation. [BUGFIX canary] Ensure @tracked setter triggers a revalidation. Feb 28, 2019
@rwjblue rwjblue requested a review from pzuraq February 28, 2019 18:08
@rwjblue rwjblue force-pushed the failing-test-for-tracked-set-outside-runloop branch from 47d201a to f49c873 Compare February 28, 2019 18:10
@rwjblue rwjblue requested a review from tomdale February 28, 2019 18:11
@rwjblue rwjblue force-pushed the failing-test-for-tracked-set-outside-runloop branch from f49c873 to 9ba35a1 Compare February 28, 2019 18:19
@tomdale
Copy link
Member

tomdale commented Feb 28, 2019

Looks good to me. I'm a little surprised that the lower-level abstractions (maybe dirty?) aren't responsible for scheduling the runloop, but maybe there are performance concerns I'm not aware of. Either way, this is a good fix for a bad bug.

Prior to this change, setting a tracked property when there was on
ambient runloop would never schedule a revalidation and would therefore
never rerender.

This change ensures that _any_ set of a `@tracked` property will enqueue
a revalidation regardless if there is a current runloop or not.
@rwjblue rwjblue force-pushed the failing-test-for-tracked-set-outside-runloop branch from 9ba35a1 to 028799f Compare February 28, 2019 18:24
@rwjblue rwjblue merged commit d333313 into emberjs:master Feb 28, 2019
@rwjblue rwjblue deleted the failing-test-for-tracked-set-outside-runloop branch February 28, 2019 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants