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

fix(keep-alive): avoid duplicate mounts of deactivate components #12042

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

yangxiuxiu1115
Copy link
Contributor

@yangxiuxiu1115 yangxiuxiu1115 commented Sep 26, 2024

try to fix #12017
also fix vuejs/router#626

Copy link

github-actions bot commented Sep 26, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+301 B) 38.1 kB (+113 B) 34.3 kB (+83 B)
vue.global.prod.js 158 kB (+301 B) 57.9 kB (+94 B) 51.6 kB (+93 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.6 kB (+203 B) 18.3 kB (+73 B) 16.7 kB (+64 B)
createApp 54.5 kB (+203 B) 21.2 kB (+65 B) 19.4 kB (+72 B)
createSSRApp 58.8 kB (+203 B) 23 kB (+64 B) 20.9 kB (+65 B)
defineCustomElement 59.4 kB (+203 B) 22.8 kB (+80 B) 20.8 kB (+47 B)
overall 68.7 kB (+301 B) 26.4 kB (+106 B) 24.1 kB (+99 B)

Copy link

pkg-pr-new bot commented Sep 26, 2024

Open in Stackblitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@12042

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@12042

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@12042

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@12042

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@12042

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@12042

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@12042

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@12042

@vue/shared

npm i https://pkg.pr.new/@vue/shared@12042

vue

npm i https://pkg.pr.new/vue@12042

@vue/compat

npm i https://pkg.pr.new/@vue/compat@12042

commit: 436296c

@edison1105
Copy link
Member

edison1105 commented Sep 26, 2024

I tested the preview package(pnpm add https://pkg.pr.new/vue@12042) of this PR in the reproduction of #12017.
The b.vue is still mounted twice.

@yangxiuxiu1115
Copy link
Contributor Author

It seems that only the examples in the playground have been fixed, I thought they were the same issue

@yangxiuxiu1115 yangxiuxiu1115 marked this pull request as draft September 26, 2024 15:33
@yangxiuxiu1115 yangxiuxiu1115 marked this pull request as ready for review September 26, 2024 15:52
@yangxiuxiu1115 yangxiuxiu1115 marked this pull request as draft September 26, 2024 16:06
@yangxiuxiu1115 yangxiuxiu1115 marked this pull request as ready for review September 26, 2024 16:52
@yangxiuxiu1115 yangxiuxiu1115 marked this pull request as draft September 27, 2024 02:40
@yangxiuxiu1115 yangxiuxiu1115 marked this pull request as ready for review September 27, 2024 03:08
@edison1105
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Sep 27, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt success success
pinia success success
primevue success success
quasar success success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros failure failure
vuetify success success
vueuse success failure
vue-simple-compiler success success

@yangxiuxiu1115
Copy link
Contributor Author

kind of strange, doesn't seem to have much relevance, might need to merge the master branch 😄

@edison1105 edison1105 added 🐞 bug Something isn't working scope: keep-alive labels Sep 29, 2024
@edison1105 edison1105 added the ready for review This PR requires more reviews label Sep 29, 2024
@edison1105 edison1105 force-pushed the fix/keepAlive branch 2 times, most recently from a1306f9 to fcee326 Compare February 5, 2025 08:19
@edison1105
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Feb 5, 2025

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools success success
nuxt success success
pinia success success
primevue success success
quasar success success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue failure success
vitepress success success
vue-i18n success success
vue-macros failure success
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Feb 5, 2025

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools success success
nuxt failure success
pinia success success
primevue success success
quasar success success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n success success
vue-macros failure success
vuetify success success
vueuse success success
vue-simple-compiler success success

@edison1105 edison1105 added wait changes and removed ready for review This PR requires more reviews labels Feb 5, 2025
@edison1105
Copy link
Member

@yangxiuxiu1115
I've made some minor tweaks, see 436296c

@edison1105 edison1105 added ready for review This PR requires more reviews and removed wait changes labels Feb 5, 2025
@yangxiuxiu1115
Copy link
Contributor Author

fcee326 might be more appropriate, being able to omit some of the loops, though it might need some tweaking(which probably won't have much of an impact on performance, maybe it's not necessary?)

@edison1105
Copy link
Member

edison1105 commented Feb 5, 2025

@yangxiuxiu1115
I tested fcee326 with #12017's reproduction and it's not correct. Although the test case of this PR passed, #12017 is still not working as expected. Perhaps the current test cases do not fully match the reproduction of #12017.
so I reverted it.

@edison1105 edison1105 added the 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working ready for review This PR requires more reviews scope: keep-alive
Projects
None yet
3 participants