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(Teleport): hydrate disabled Teleport with undefined target #11235

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

Conversation

linzhe141
Copy link
Contributor

close #11230

@linzhe141 linzhe141 changed the title fix(runtime-core): When hydrateTeleport, the targetNode of disabled Teleport should use the node of nextSibling fix(runtime-core): When hydrate Teleport, the targetNode of disabled Teleport should use the node of nextSibling Jun 27, 2024
@TotomInc
Copy link

TotomInc commented Jul 6, 2024

Hello, thanks for the PR. Is there any chance it will get merged?

@@ -406,6 +406,21 @@ function hydrateTeleport(
}
updateCssVars(vnode)
}
if (!target && isTeleportDisabled(vnode.props)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!target && isTeleportDisabled(vnode.props)) {
else if (isTeleportDisabled(vnode.props)) {
if (vnode.shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
vnode.anchor = hydrateChildren(
nextSibling(node),
vnode,
parentNode(node)!,
parentComponent,
parentSuspense,
slotScopeIds,
optimized,
)
vnode.targetStart = node
vnode.targetAnchor = nextSibling(node)
}
}

Copy link
Member

@edison1105 edison1105 Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try to extract a hydrateDisabledTeleport method.
Could you please add a test case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review, I will improve it

Copy link

github-actions bot commented Aug 9, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+69 B) 38 kB (+31 B) 34.2 kB (+26 B)
vue.global.prod.js 159 kB (+69 B) 57.9 kB (+27 B) 51.4 kB (-60 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 26.3 kB 24 kB

@TotomInc
Copy link

Sorry for the bump, but is there any chance it will get merged? Thanks a lot for your work @linzhe141 🙏

@linzhe141
Copy link
Contributor Author

Sorry for the bump, but is there any chance it will get merged? Thanks a lot for your work @linzhe141 🙏

Maybe the current modification is not correct, so it may not be merged.

@edison1105
Copy link
Member

/ecosystem-ci run

@edison1105 edison1105 removed the need test The PR has missing test cases. label Sep 20, 2024
@edison1105 edison1105 changed the title fix(runtime-core): When hydrate Teleport, the targetNode of disabled Teleport should use the node of nextSibling fix(Teleport): hydrate disabled Teleport with undefined target Sep 20, 2024
@edison1105 edison1105 added the ready to merge The PR is ready to be merged. label Sep 20, 2024
@vue-bot
Copy link
Contributor

vue-bot commented Sep 20, 2024

📝 Ran ecosystem CI: Open

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

Copy link

pkg-pr-new bot commented Sep 20, 2024

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-sfc

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

@vue/compiler-dom

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/shared

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

@vue/server-renderer

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

vue

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

@vue/compat

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

commit: 9f1d198

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

Successfully merging this pull request may close these issues.

Conditional children inside an optional Teleport (with disabled) doesn't work
4 participants