From: chirokas <157580465+chirokas@users.noreply.github.com>
Date: Wed, 5 Aug 2026 06:50:07 +0000 (+0800)
Subject: fix(ssr): normalize hidden states during hydration (#13125)
X-Git-Tag: v3.5.41~1
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e467d7ae2cd7d0af031fac8865dcff73cb1cf16;p=thirdparty%2Fvuejs%2Fcore.git
fix(ssr): normalize hidden states during hydration (#13125)
---
diff --git a/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts b/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts
index f4f29f6cdc..e507372473 100644
--- a/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts
+++ b/packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts
@@ -389,6 +389,23 @@ describe('stringify static html', () => {
])
})
+ test.each(['false', '0'])('should remove `hidden` with value `%s`', value => {
+ const { ast } = compileWithStringify(
+ `
+ ${repeat(
+ ``,
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ )}
+
`,
+ )
+ expect(ast.cached).toMatchObject([
+ cachedArrayStaticNodeMatcher(
+ repeat(``, StringifyThresholds.ELEMENT_WITH_BINDING_COUNT),
+ StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
+ ),
+ ])
+ })
+
test('should stringify svg', () => {
const svg = `