From 1b4c43b8e59e22c1b8185421307fbab91e573866 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Wed, 3 Jun 2026 01:12:25 +0200 Subject: [PATCH 01/15] fix: ignore declaration tags for animation directive (#18366) Fixes #18365 --- .changeset/tangy-keys-drop.md | 5 +++++ .../phases/2-analyze/visitors/shared/element.js | 1 + .../animation-each-with-declaration-tag/errors.json | 1 + .../animation-each-with-declaration-tag/input.svelte | 10 ++++++++++ 4 files changed, 17 insertions(+) create mode 100644 .changeset/tangy-keys-drop.md create mode 100644 packages/svelte/tests/validator/samples/animation-each-with-declaration-tag/errors.json create mode 100644 packages/svelte/tests/validator/samples/animation-each-with-declaration-tag/input.svelte diff --git a/.changeset/tangy-keys-drop.md b/.changeset/tangy-keys-drop.md new file mode 100644 index 0000000000..38f0c10543 --- /dev/null +++ b/.changeset/tangy-keys-drop.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: ignore declaration tags for animation directive diff --git a/packages/svelte/src/compiler/phases/2-analyze/visitors/shared/element.js b/packages/svelte/src/compiler/phases/2-analyze/visitors/shared/element.js index 725a4aded8..ff02dee02a 100644 --- a/packages/svelte/src/compiler/phases/2-analyze/visitors/shared/element.js +++ b/packages/svelte/src/compiler/phases/2-analyze/visitors/shared/element.js @@ -100,6 +100,7 @@ export function validate_element(node, context) { (n) => n.type !== 'Comment' && n.type !== 'ConstTag' && + n.type !== 'DeclarationTag' && (n.type !== 'Text' || n.data.trim() !== '') ).length > 1 ) { diff --git a/packages/svelte/tests/validator/samples/animation-each-with-declaration-tag/errors.json b/packages/svelte/tests/validator/samples/animation-each-with-declaration-tag/errors.json new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/packages/svelte/tests/validator/samples/animation-each-with-declaration-tag/errors.json @@ -0,0 +1 @@ +[] diff --git a/packages/svelte/tests/validator/samples/animation-each-with-declaration-tag/input.svelte b/packages/svelte/tests/validator/samples/animation-each-with-declaration-tag/input.svelte new file mode 100644 index 0000000000..680efa7eed --- /dev/null +++ b/packages/svelte/tests/validator/samples/animation-each-with-declaration-tag/input.svelte @@ -0,0 +1,10 @@ + + +
+ {#each [] as n (n)} + {const a = n} +
+ {/each} +
From 94bd27953e0a5ffef80e9451b27e122d185d093f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20L=C3=AA?= <115204145+DucMinhNe@users.noreply.github.com> Date: Wed, 3 Jun 2026 09:41:15 +0700 Subject: [PATCH 02/15] docs: fix invalid `rows` CSS property in {#each} chess-board example (#18367) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem The `{#each}` docs page has a runnable "chess board" example whose `