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(runtime-core): inherit comment nodes during block patch in production build #10748

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

Conversation

tonliver
Copy link

@tonliver tonliver commented Apr 20, 2024

close #10747
close #12650

@tonliver tonliver changed the title fix #10747 fix(runtime-core): TypeError when using html comment in teleport[fix #10747] Apr 20, 2024
Copy link

netlify bot commented Apr 20, 2024

Deploy Preview for vue-sfc-playground failed.

Name Link
🔨 Latest commit 46f6f3b
🔍 Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/66231674bd858b000859c462

Copy link

netlify bot commented Apr 20, 2024

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

Name Link
🔨 Latest commit 46f6f3b
🔍 Latest deploy log https://app.netlify.com/sites/vue-next-template-explorer/deploys/662316740aee4500083b5a0e

@tonliver tonliver changed the title fix(runtime-core): TypeError when using html comment in teleport[fix #10747] fix(runtime-core): TypeError when using html comment in teleport(fix #10747) Apr 20, 2024
@tonliver tonliver force-pushed the fix/teleport-comment branch from 46f6f3b to 8e82e54 Compare April 20, 2024 01:43
@tonliver
Copy link
Author

@edison1105 I think assuming that all comments should be removed in production mode, then there shouldn't create vnodes for comments in production mode for performance reason. However, comment vnodes are created, also removed by nodeOpt.remove method during unmounting, except for traversStaticChildren, which lacks consistency. Indeed this inconsistency in handling caused the exception.

@edison1105
Copy link
Member

@tonliver Could you add a test case?

@edison1105 edison1105 added the need test The PR has missing test cases. label Apr 24, 2024
@tonliver
Copy link
Author

@tonliver Could you add a test case?

Sure, I'll work on it as soon as possible.

Copy link

github-actions bot commented May 6, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+31 B) 37.9 kB (+9 B) 34.2 kB (+20 B)
vue.global.prod.js 158 kB (+31 B) 57.8 kB (+10 B) 51.5 kB (+67 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.3 kB (+31 B) 18.2 kB (+12 B) 16.6 kB (+11 B)
createApp 54.3 kB (+31 B) 21.1 kB (+10 B) 19.3 kB (-1 B)
createSSRApp 58.5 kB (+31 B) 22.9 kB (+11 B) 20.8 kB (+6 B)
defineCustomElement 59.1 kB (+31 B) 22.7 kB (+15 B) 20.7 kB (-4 B)
overall 68.3 kB (+31 B) 26.3 kB (+8 B) 24 kB (+67 B)

@tonliver
Copy link
Author

@edison1105 I've added some test cases.

@tonliver
Copy link
Author

@edison1105 What else can I do?

@tonliver
Copy link
Author

@yyx990803 What else can I do?

@haoqunjiang haoqunjiang added scope: teleport 🔩 p2-edge-case and removed need test The PR has missing test cases. labels May 27, 2024
@edison1105 edison1105 added the ready for review This PR requires more reviews label Oct 22, 2024
@edison1105 edison1105 added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. and removed 🔩 p2-edge-case labels Jan 6, 2025
Copy link

pkg-pr-new bot commented Jan 6, 2025

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-sfc

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

@vue/compiler-dom

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

@vue/compiler-ssr

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/reactivity

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: af25c8c

@edison1105 edison1105 changed the title fix(runtime-core): TypeError when using html comment in teleport(fix #10747) fix(runtime-core): inherit comment nodes during block patch in production build Jan 6, 2025
@edison1105 edison1105 changed the title fix(runtime-core): inherit comment nodes during block patch in production build fix(runtime-core): inherit comment nodes during block patch in production build Jan 7, 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. ready for review This PR requires more reviews scope: teleport
Projects
None yet
3 participants