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

fix(runtime-core): disable deps collection in watch callbacks #2765

Closed
wants to merge 1 commit into from

Conversation

luwuer
Copy link
Contributor

@luwuer luwuer commented Dec 8, 2020

Close #2728

@edison1105
Copy link
Member

@luwuer
Copy link
Contributor Author

luwuer commented Dec 9, 2020

Seems like that code executed synchronously does not have this problem because of code below:

https://github.com/vuejs/vue-next/blob/d87bc2b3b48dc3094f50e4a87227ddb09b8c7e38/packages/runtime-core/src/component.ts#L704-L711

@LinusBorg
Copy link
Member

@edison1105 Thoughts on the last comment? Does that cover the case you mentioned?

packages/runtime-core/src/apiWatch.ts Outdated Show resolved Hide resolved
@HcySunYang
Copy link
Member

@edison1105 Thoughts on the last comment? Does that cover the case you mentioned?

@LinusBorg yes, that comment covers that case.

@luwuer luwuer force-pushed the watch-cb-disable-collect-effect branch from 2fb0694 to 21c0dfd Compare February 26, 2021 07:41
@posva posva changed the title fix(runtime-core): disable deps collection in watch callbacks (#2728) fix(runtime-core): disable deps collection in watch callbacks Mar 8, 2021
@yyx990803
Copy link
Member

See d5824b9 - the tracking happens because the watcher callbacks are flushed during updateComponentPreRender, so it makes more sense for the tracking to be disabled there instead.

@yyx990803 yyx990803 closed this Mar 26, 2021
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.

Data property read in prop watch treated as a rendering dependency
5 participants