vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.75k stars 8.34k forks source link

fix(hydration): avoid hydration mismatch on style variables with falsy values #12442

Open yangxiuxiu1115 opened 2 days ago

yangxiuxiu1115 commented 2 days ago

fix #12439

pkg-pr-new[bot] commented 2 days ago

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

``` pnpm add https://pkg.pr.new/vue@12442 ```

@vue/compat

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

commit: 8ce63aa

github-actions[bot] commented 2 days ago

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 37.9 kB 34.2 kB
vue.global.prod.js 158 kB 57.8 kB 51.4 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 47.2 kB 18.3 kB 16.8 kB
createApp 55.2 kB 21.3 kB 19.5 kB
createSSRApp 59.3 kB 23.1 kB 21 kB
defineCustomElement 60.1 kB 22.9 kB 20.8 kB
overall 69.1 kB 26.5 kB 24.1 kB
edison1105 commented 2 days ago

The isRenderableAttrValue should be applied here to filter values, aligning with SSR behavior. https://github.com/vuejs/core/blob/c4312f9c715c131a09e552ba46e9beb4b36d55e6/packages/runtime-dom/src/helpers/useCssVars.ts#L97