From 1f0700f5c597174e51d6e07407b078c8314486fc Mon Sep 17 00:00:00 2001 From: Paolo Ricciuti Date: Fri, 15 Nov 2024 23:40:08 +0100 Subject: [PATCH] fix: mark subtree dynamic for img with loading attribute (#14317) * fix: mark subtree dynamic for img with loading attribute * chore: unify conditions * chore: change conditions --- .changeset/rotten-turkeys-sniff.md | 5 +++++ .../compiler/phases/2-analyze/visitors/Attribute.js | 11 ++++++++--- .../_expected/client/index.svelte.js | 6 +++++- .../_expected/server/index.svelte.js | 2 +- .../snapshot/samples/skip-static-subtree/index.svelte | 5 ++++- 5 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 .changeset/rotten-turkeys-sniff.md diff --git a/.changeset/rotten-turkeys-sniff.md b/.changeset/rotten-turkeys-sniff.md new file mode 100644 index 0000000000..53fb5bd663 --- /dev/null +++ b/.changeset/rotten-turkeys-sniff.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: mark subtree dynamic for img with loading attribute diff --git a/packages/svelte/src/compiler/phases/2-analyze/visitors/Attribute.js b/packages/svelte/src/compiler/phases/2-analyze/visitors/Attribute.js index 6931f873fb..ca0ea55d1f 100644 --- a/packages/svelte/src/compiler/phases/2-analyze/visitors/Attribute.js +++ b/packages/svelte/src/compiler/phases/2-analyze/visitors/Attribute.js @@ -18,9 +18,14 @@ export function Attribute(node, context) { const parent = /** @type {SvelteNode} */ (context.path.at(-1)); - // special case - if (node.name === 'value') { - if (parent.type === 'RegularElement' && parent.name === 'option') { + if (parent.type === 'RegularElement') { + // special case - \ No newline at end of file + +
+ +
\ No newline at end of file