-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Reactivity regression in 3.14.15 #10185
Comments
That's the expected behavior, because |
Thanks but I think that the refered issue (and explanation) refers to returning an object.
I think that this is a regression caused by multiple levels of reactivity and tracking/triggering from within the same computed. Note that this worked up to version 3.4.14. As a sidenote, I implemented a good part of the original reactivity system before the 3.4 refactoring. |
I got you now, sry for my misunderstanding. But I still think this is the desirable behavior. |
I agree that the computed is dirty immediately after getting it. And I did notice the dirtyLevel still being on 2. But this did usually lead to a re-evaluation when accessing it. But these are just internals. A computed should always produce the latest valid value, and trigger its dependencies whenever it changes. This is how it always worked up to now. Imho anything different should be regarded as a regression. Just like #10114 was regarded as a regression. The fix just didn't handle this more complex edge case. The problem lies in the fact that |
Or alternative solution: re evaluate computeds until they end up not dirty. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Wait... I think maybe this should work like this case? |
I agree with @basvanmeurs that this is a reactivity regression now. |
Thanks @Doctor-wu You made me realize that this is an anti-pattern in my code. But it would be nice if we could support recursive triggering and fix this one. The reactivity refactoring in 3.4 could actually work in favor of this. If a computed retriggers itself we now have the chance to immediately re-evaluate as part of the value getter, before even triggering deps! Of course we needto watch out for infinite recursion and console.warn in case it happens.. |
It should be fixed by #10187. It would be helpful if you could provide a minimal test case. |
|
A PR that explores this opportunity: #10189 |
Vue version
3.14.15
Link to minimal reproduction
https://play.vuejs.org/#eNqdVE1z0zAQ/StbX5IMiU0pHJqmpcB0hnIApjDTiy6uvbHVypJHkp12Mv7vrOSPuGlggBwy1r79ePtWq23woSzDusJgGaxMonlpwaCtygsmeVEqbWELGtdzMHkshNrcuO9EFWVlMYUG1loVMKEEEyaZTJQ0FgqTwbmLmk4+IwXBrdIiPZrMvIuIjYFriwVsmQT61Z3z69kZk80uDScfQ9iu8tR59DCh5RuCezLT6QzOL/qkUQQ3mGk0hisJeWzAKkgVbLjNweo4eeAyA5ujpBPPMtR0nsMdJnFlEBKNsXUenqiqrOEpglq7iF37Bbc8iy1ScjKXWt0JLMKWgEALCdHzXYR1LCok8g7ha5geJbOeqfs5R4kbX8032QOjaNdqh3iR3IemUWkJSVgPFZqxRkLFKfFs9V3HwuBzBenvsICeYxvdZp71tVggFQvOnMC3pCVJQ81zMyc8TiyvuX2CjdIPxuvQBflZdW28pxRPaFgAyz7ZHmuaWiUOMHN8Ozbem+7ZIA0LRjVcYnjV5RmUYXLcEMVY3dn/OdHugr6YsDv14yDw9PT0/0qsonYdaRHp4AIE3TQ6Aazy44vt1q9Z06wiOnkrlyQW1ItCpSjOWUA4pY4IXEWj+GAetJu9KOIyvDdK0u77obMOoNks+9vJAtptd2ZBbm1pllGUpJLCqAavdSjRRrIsoktyi3QlLS9wkari8iR8Gx6/i1Ju7NgeoikWd1ptDGrKwoL5qE5Exhr1QqNMUaP+27p7Yc9q72Ev6rvytE8NyWINzXXNsz1R3C3kAvW30tJb8lwc/zJ98TZ3m4ZmkhyThwP2e/PYNvWdBu6YjQSwsc7QtvDVj6/4SN8DSEOtRDeI34A3aJSoHMfW7WMlU6I98vNsr/2M6W37aa4eLUr3QA5EvRre3w/k0x9a39E9CU8GFZtfULwgAQ==
Steps to reproduce
What is expected?
Input should show
temp2.value: yes
because item.v.value is updated which should trigger temp2, test and the watcher.What is actually happening?
Input shows
temp2.value: no
System Info
No response
Any additional comments?
In vue 3.14.12 a similar problem was introduced, which was fixed in 3.14.13. Then in 3.14.15 the same problem was re-introduced but for a more narrow edge case. Faulty commit: c2b274a
The text was updated successfully, but these errors were encountered: