Skip to content

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

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

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

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Sep 16, 2023

close #9229

image

image

@github-actions
Copy link

github-actions bot commented Sep 16, 2023

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

Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

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

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

@edison1105
Copy link
Member Author

/ecosystem-ci run

@edison1105
Copy link
Member Author

edison1105 commented Jun 22, 2024

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.

@vue-bot
Copy link
Contributor

vue-bot commented Jun 22, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools success 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 success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@skirtles-code
Copy link
Contributor

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?

@edison1105
Copy link
Member Author

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 edison1105 changed the title fix(compiler-core): normalize newlines in interpolation fix(hydration): avoid mismatch during hydrate text with newlines in interpolation Jun 23, 2024
@edison1105 edison1105 added 🐞 bug Something isn't working scope: ssr ready for review This PR requires more reviews labels Aug 16, 2024
Copy link

pkg-pr-new bot commented Feb 18, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working ready for review This PR requires more reviews scope: ssr
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Hydration error with \r in text #23234
3 participants