-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
fix(runtime-core): fix the issue of passing incorrect parentComponent to patch when KeepAlive is activated #13218
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: main
Are you sure you want to change the base?
fix(runtime-core): fix the issue of passing incorrect parentComponent to patch when KeepAlive is activated #13218
Conversation
… to patch when KeepAlive is activated
Thanks for the PR, but the reproduction doesn't make sense. <KeepAlive>
<Test1 v-if=\"flag\" :key=\"key\" />
<Test2 v-else :key=\"key\" />
</KeepAlive> If the keys of if/else are different, there will be no issue. |
是的,这个例子是为了复现这个问题特意写的,实际情况下目前除了这样也几乎无法复现这个问题,但传给 patch 的 parentComponent 参数确实错了,主要是目前 patch 基本只在 mount 和 unmount 时使用到了 parentComponent,如果后续代码迭代中 patch 对传入的 parentComponent 有其它的使用方式就有可能会出现问题 |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
I tried running the reproduction against the Netlify deployment of this PR, but I get I had a go at converting it to use render functions, as we might be able to adapt that for a unit test: I'm also wondering whether there might be some overlap with #12915. They aren't exactly the same, but the fixes might end up being similar. |
WalkthroughThe update changes the parent component context used in the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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 (
|
This should be an issue with the reproduction example I provided. The However, under normal circumstances, this branch will not be entered. So the issue fixed by this MR does not currently exist. It is only possible for the issue to occur if Regarding the issue of |
https://play.vuejs.org/#eNqdUk1PwzAM/SvGlw1prGJwGt3EhzgAEiDgmMvo3BGWJVXijqFp/x03paOgwYFT6ufnV/vZazwriv6yJBxiGjKvC4ZAXBZjZfWicJ5hDZ7yHkwp15YunICWLMMGcu8W0JHajrLKZs4GhtxMZjCqKrrsS9o/aRJzehdcobwKBW3wJwp8KJkf8t21slB30t2HGICocuktCDAaQydWdkQKYKPspvpVW3Twb9HBd9E0qX0RRyRgWhRmwiQRQPpcMjsLp5nR2Xyk8HP8vepVOGZRS5OaVBfcEBVnRi/regHq+ZcHOv8sVwhDMUmiaBUkbeZAmGQC7aKkSVs8TVqdYg85iDW5nvVfg7Oy7Di9wky80Yb8XcFarFM4bHxRODHGvV1HrNplr8GzF8rmO/DXsKowhfeeAvklKdzmeOJnxHX68vGWVvK9TS7ctDTC/iP5QMGZsuqxpp2Xdiptt3ix26t4strOnsLlismGZqiq0bjUyFcoV1udxW+jf7V71D9ujgE3HwcRC6A=
Summary by CodeRabbit