From 941f266827b6d869f06e352889af0d71642d9293 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 21 May 2025 20:57:12 -0400 Subject: [PATCH] simplify --- .../3-transform/client/transform-template/to-functions.js | 6 ------ packages/svelte/src/internal/client/dom/template.js | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/svelte/src/compiler/phases/3-transform/client/transform-template/to-functions.js b/packages/svelte/src/compiler/phases/3-transform/client/transform-template/to-functions.js index 7d9e4b6152..c9128591cd 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/transform-template/to-functions.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/transform-template/to-functions.js @@ -21,15 +21,9 @@ function build(item) { case 'element': { const element = b.object([b.prop('init', b.id('e'), b.literal(item.name))]); - if (item.attributes.is) { - element.properties.push(b.prop('init', b.id('is'), b.literal(item.attributes.is))); - } - const attributes = b.prop('init', b.id('p'), b.object([])); for (const key in item.attributes) { - if (key === 'is') continue; - const value = item.attributes[key]; attributes.value.properties.push( diff --git a/packages/svelte/src/internal/client/dom/template.js b/packages/svelte/src/internal/client/dom/template.js index 153a67ccbf..21ab64574d 100644 --- a/packages/svelte/src/internal/client/dom/template.js +++ b/packages/svelte/src/internal/client/dom/template.js @@ -78,7 +78,7 @@ export function template(content, flags) { } /** - * @typedef {{e: string, is?: string, p: Record, c: Array} | undefined | string | [string]} TemplateStructure + * @typedef {{e: string, p: Record, c: Array} | undefined | string | [string]} TemplateStructure */ /** @@ -102,7 +102,7 @@ function structure_to_fragment(structure, ns) { /** @type {NAMESPACE_SVG | NAMESPACE_MATHML | undefined} */ let namespace = item.e === 'svg' ? NAMESPACE_SVG : item.e === 'math' ? NAMESPACE_MATHML : ns; - var element = create_element(item.e, namespace, item.is); + var element = create_element(item.e, namespace, item.p?.is); for (var key in item.p) { set_attribute(element, key, item.p[key]);