-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
refactor: don't run components in detached effectScopes #13303
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
base: minor
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/runtime-core
@vue/reactivity
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
For some reason I couldn't find documentation for, each component's effect scope runs detached, so every effect component has its own effect scope. In my opinion, this doesn't make sense:
provide/inject
Hence, it doesn't make any sense that I'm not able to walk the
effectScope
of components in the same way.This Pull Request makes every component's effect scope scoped to the parent's component effect scope, instead of being detached. Only the root component runs in a detached effect scope to take into account cases like:
The
effectScope
of components being a tree as well allows, among other things:onScopeDispose
, instead of being different hooks to reduce duplications?).Additional notes
Although all tests are passing, there's one component in my application that it's currently not reacting to changes in computed properties with this change (here's a reproduction).
I believe it's caused due to computeds being created outside the effect scope of the component (not at setup), but I'm still investigating. Hopefully, ecosystem-ci tests can shed more light into this issue, but any advice in the meantime is appreciated.