-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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(reactivity): allowRecurse
effects's dirtyLevel
unreliable
#10101
Conversation
Size ReportBundles
Usages
|
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
Hi, this change causes our code base to get into a deadlock situation with two components which appear to be awaiting one another's resources, though it's not obvious. Is anyone able to explain more about this fix and what behaviour it affects? We aren't using allowRecurse explicitly anywhere. We're using SFCs and Pinia stores. Pinia stores load in the background and their values are injected into the setup of components which then receive updates via computed properties that depend on storeToRefs() to map the store state to the local component state. The way that the Pinia stores are loaded in the background is that they return their initial (previously known) state when their computed properties are accessed and as a side-effect they asynchronously fetch from apis and then update their state values. The intention behind our modified stores is that the act of setting a store state value would mark a computed property as dirty and recompute it as needed. We are depending on Vue to allow side-effects, or more specifically to regard any side-effects such as asynchronous closures as non-dirty. As far as I can tell we have built our stores to look similar to the new test case EDIT: For those reading this later, I solved the above problem by following this pattern (can be added to Computed.spec.ts):
|
This resolves the regression introduced by #10091 and re-fix #10082.
Also fix a test of #10085, #10090.