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: When the app is unmounted, the onMounted of suspense in Transition should not be called #11059

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

Conversation

linzhe141
Copy link
Contributor

close #11037

@linzhe141 linzhe141 changed the title fix: When the app is unmounted, the effects of suspense in Transition should not be added to queuePostFlushCb fix: When the app is unmounted, the onMounted of suspense in Transition should not be called Jun 3, 2024
@edison1105
Copy link
Member

edison1105 commented Jun 3, 2024

  • The afterLeave here is meant to render page2 to the container after the transition of page1 has ended. This afterLeave only needs to be executed once. Therefore, I believe the correct fix should be:
activeBranch!.transition!.afterLeave = () => {
  // ....

  // remove afterLeave
  activeBranch!.transition!.afterLeave = undefined
}
  • The test case passes without your PR.

@edison1105
Copy link
Member

@linzhe141
Hi, The test case passes without your PR.
Could you please check it?

@linzhe141
Copy link
Contributor Author

linzhe141 commented Aug 1, 2024

@linzhe141 Hi, The test case passes without your PR. Could you please check it?

3.4.27 playground

3.4.28 playground

my bad, and in version 3.4.28, it has been fixed

@linzhe141 linzhe141 closed this Aug 1, 2024
@edison1105
Copy link
Member

@linzhe141
I don't think the underlying problem is fixed. The afterLeave function still executes during app unmounting, which should be avoided.

@linzhe141
Copy link
Contributor Author

@linzhe141 I don't think the underlying problem is fixed. The afterLeave function still executes during app unmounting, which should be avoided.

Thanks for your review, I will look into this issue again.

@linzhe141 linzhe141 reopened this Aug 2, 2024
@linzhe141 linzhe141 marked this pull request as draft August 2, 2024 09:58
Copy link

github-actions bot commented Aug 2, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+31 B) 38 kB (+6 B) 34.2 kB (+28 B)
vue.global.prod.js 159 kB (+31 B) 57.9 kB (+5 B) 51.5 kB (+32 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.9 kB 18.3 kB 16.7 kB
createApp 55 kB 21.3 kB 19.4 kB
createSSRApp 59 kB 23 kB 20.9 kB
defineCustomElement 59.8 kB 22.8 kB 20.8 kB
overall 68.7 kB (+31 B) 26.4 kB (+7 B) 24 kB (+15 B)

@linzhe141 linzhe141 marked this pull request as ready for review August 2, 2024 15:53
Copy link

netlify bot commented Oct 30, 2024

Deploy Preview for vue-next-template-explorer failed.

Name Link
🔨 Latest commit 9f8be34
🔍 Latest deploy log https://app.netlify.com/sites/vue-next-template-explorer/deploys/6721fb636a4dce00082b0cae

Copy link

pkg-pr-new bot commented Oct 30, 2024

Open in Stackblitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@11059

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@11059

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@11059

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@11059

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@11059

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@11059

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@11059

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@11059

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@11059

vue

pnpm add https://pkg.pr.new/vue@11059

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@11059

commit: 5a62284

Copy link

netlify bot commented Oct 30, 2024

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit 7e68aeb
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/6721fb2b55ad8d0008b0ecdc

Copy link

netlify bot commented Oct 30, 2024

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit 9f8be34
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/6721fb6355ad8d0008b10ec5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hook onMounted has been called when app unmount
2 participants