core icon indicating copy to clipboard operation
core copied to clipboard

fix(hydration): avoid mismatch during hydrate text with newlines in interpolation

Open edison1105 opened this issue 2 years ago • 6 comments

close #9229

image

image

edison1105 avatar Sep 16 '23 07:09 edison1105

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+41 B) 38.1 kB (+25 B) 34.3 kB (+25 B)
vue.global.prod.js 158 kB (+41 B) 58 kB (+25 B) 51.7 kB (+43 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.5 kB 18.2 kB 16.7 kB
createApp 54.6 kB 21.3 kB 19.4 kB
createSSRApp 58.8 kB (+41 B) 23.1 kB (+26 B) 21 kB (+15 B)
defineCustomElement 59.4 kB 22.9 kB 20.8 kB
overall 68.6 kB 26.4 kB 24 kB

github-actions[bot] avatar Sep 16 '23 07:09 github-actions[bot]

/ecosystem-ci run

edison1105 avatar Jun 22 '24 01:06 edison1105

Any reason not to include test cases for the change to hydration.ts?

It seems that jsdom's innerHTML does not normalize \r\n into \n. I did not figure out a way to test it.

edison1105 avatar Jun 22 '24 01:06 edison1105

📝 Ran ecosystem CI: Open

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

vue-bot avatar Jun 22 '24 01:06 vue-bot

Any reason not to include test cases for the change to hydration.ts?

It seems that jsdom's innerHTML does not normalize \r\n into \n. I did not figure out a way to test it.

But can't you create a node that has the relevant content directly, rather than relying on jsdom to normalize it?

skirtles-code avatar Jun 22 '24 03:06 skirtles-code

Any reason not to include test cases for the change to hydration.ts?

It seems that jsdom's innerHTML does not normalize \r\n into \n. I did not figure out a way to test it.

But can't you create a node that has the relevant content directly, rather than relying on jsdom to normalize it?

Done

edison1105 avatar Jun 22 '24 12:06 edison1105

Open in Stackblitz

@vue/compiler-core

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

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

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

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

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

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

npm i https://pkg.pr.new/@vue/runtime-dom@9232
@vue/server-renderer

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

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

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

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

commit: 5d368bc

pkg-pr-new[bot] avatar Feb 18 '25 06:02 pkg-pr-new[bot]