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

Inconsistent behavior for stop() at a computed ref between 3.4.38 and 3.5.6 #11968

Closed
nine-fox opened this issue Sep 18, 2024 · 2 comments
Closed

Comments

@nine-fox
Copy link

Vue version

3.5.6

Link to minimal reproduction

https://play.vuejs.org/#eNp9UslOwzAQ/ZWRLxS1SotYDpBWLOIAB0DA0RIK7qQEEtuyx6VSlH9n7NAFCfWWeZveTNyKK2uzZUBxLnKvXGUJPFKwM6mrxhpH0ILDcgSejB2BMo0NhHPooHSmgQO2HkgttTLaE9NBEzqYRs9gcnixpQoG1+7B4BCmM2ilBhZScHrtzJZFHRCGcDSZsLnrE8qgFVVGpxJvWJaoiCOSP0KDIuo6qfNxvwO354GwsXVByBNA/nE0a9tNw67Lx4wk5j0Qcfilqiv1NZXiVzMcSjG70yof94IUugkq9kb8KcoxcYZ+3onLxzsVxUiQ51uV1SL79EbzH0kLxj6NrWp0jzYewUtx3q8euaKuzfd9wsgFHK1x9YHq6x/8068iJsWTQ49uiVJsOCrcAqmnb18ecMXfG7Ix81Czeg/5jN7UIXbsZddBz7n2ji61vUvvqtKLV3+7ItR+vVQsGpVd0kvBb+tmz+rbusfZSfLxG+Arvi3RxUw+4HF2mp2J7gdI4vgA

Steps to reproduce

Click stop_effect button, then error occured: TypeError: runner.effect.stop is not a function.

Please note, the error is not emitted under vue version 3.4.38.

What is expected?

No errors.

The same behavior between these 2 versions.

What is actually happening?

TypeError: runner.effect.stop is not a function.

System Info

playground

Any additional comments?

No response

@skirtles-code
Copy link
Contributor

skirtles-code commented Sep 18, 2024

I can't find any mention of the stop function in the documentation, so I'm unclear whether it is intended to be used in this way. As far as I'm aware, using effectScope is the only documented way to dispose of a computed manually.

#10397 deprecated the effect property of ComputedRefImpl, but it seems to have been kept for backwards compatibility:

https://github.com/vuejs/core/pull/10397/files#diff-95734490ac7bb277f876f1c6e635a2718f5f8ac75615d0d72403df5a8903e652R55

That backwards compatibility doesn't include the effect.stop() method, which is needed by the stop function.


Update: After reading the PR description for #10397 a bit more carefully, it looks like a computed can no longer be stopped, even using effectScope. The documentation for effectScope may need updating, as it currently mentions computed.

@edison1105
Copy link
Member

duplicate of #11886

@edison1105 edison1105 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants