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(hydration): avoid mismatch during hydrate text with newlines in interpolation #9232

Open
wants to merge 5 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 85.9 kB 32.6 kB 29.5 kB
vue.global.prod.js 132 kB (+96 B) 49.4 kB (+26 B) 44.3 kB (-13 B)

Usages

Name Size Gzip Brotli
createApp 47.9 kB 18.8 kB 17.2 kB
createSSRApp 50.6 kB 19.9 kB 18.2 kB
defineCustomElement 50.3 kB 19.6 kB 17.9 kB
overall 61.2 kB 23.7 kB 21.6 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?

packages/compiler-core/src/parser.ts Outdated Show resolved Hide resolved
@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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Review
Development

Successfully merging this pull request may close these issues.

Hydration error with \r in text #23234
3 participants