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(compiler-ssr): ensure v-text renders correctly with custom directives in SSR output #12311

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

mefcorvi
Copy link
Contributor

@mefcorvi mefcorvi commented Nov 1, 2024

Fixes #12309: v-text now functions correctly in SSR, even when other custom directives are applied to the same element.

The fix ensures that when v-text is present, it takes priority over textContent and innerHTML provided by other directives. This prevents conflicts in the SSR output, allowing v-text to render as expected.

v-html already behaves correctly by directly modifying rawChildrenMap, so this change aligns v-text behavior with that of v-html in SSR scenarios.

Copy link

github-actions bot commented Nov 1, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 38 kB 34.2 kB
vue.global.prod.js 159 kB 57.9 kB 51.4 kB

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

Copy link

pkg-pr-new bot commented Nov 1, 2024

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-ssr

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

@vue/compiler-sfc

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 7fa537c

@mefcorvi mefcorvi changed the title fix(ssr): ensure v-text updates correctly with custom directives in SSR output fix(compiler-ssr): ensure v-text updates correctly with custom directives in SSR output Nov 1, 2024
@mefcorvi mefcorvi changed the title fix(compiler-ssr): ensure v-text updates correctly with custom directives in SSR output fix(compiler-ssr): ensure v-text renders correctly with custom directives in SSR output Nov 1, 2024
@edison1105 edison1105 added scope: ssr 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. regression labels Nov 4, 2024
@edison1105 edison1105 added wait changes ready to merge The PR is ready to be merged. and removed wait changes labels Nov 4, 2024
@yyx990803 yyx990803 merged commit 1f75d4e into vuejs:main Nov 15, 2024
13 checks passed
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 to merge The PR is ready to be merged. regression scope: ssr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v-text directive does not work after SSR if another custom directive is applied to the same element
3 participants