diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts index 58bde0ebae7d..e1807d6d3cba 100644 --- a/src/compiler/compile/Component.ts +++ b/src/compiler/compile/Component.ts @@ -112,7 +112,7 @@ export default class Component { slots: Map = new Map(); slot_outlets: Set = new Set(); - tags: Tag[] = [] + tags: Tag[] = []; constructor( ast: Ast, diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts index 73f51da41646..e47d3768b0f9 100644 --- a/src/compiler/compile/nodes/Element.ts +++ b/src/compiler/compile/nodes/Element.ts @@ -385,6 +385,7 @@ export default class Element extends Node { this.handlers.length > 0 || this.styles.length > 0 || this.name === 'option' || + this.is_dynamic_element || this.tag_expr.dynamic_dependencies().length || this.is_dynamic_element || component.compile_options.dev diff --git a/src/compiler/compile/render_ssr/handlers/Element.ts b/src/compiler/compile/render_ssr/handlers/Element.ts index f9442f11f43c..6fb98debaa7a 100644 --- a/src/compiler/compile/render_ssr/handlers/Element.ts +++ b/src/compiler/compile/render_ssr/handlers/Element.ts @@ -162,9 +162,7 @@ export default function (node: Element, renderer: Renderer, options: RenderOptio }); if (options.hydratable) { - if (options.head_id) { - renderer.add_string(` data-svelte="${options.head_id}"`); - } else if (node.children.length === 1 && node.children[0].type === 'RawMustacheTag') { + if (node.children.length === 1 && node.children[0].type === 'RawMustacheTag') { renderer.add_string(` data-svelte="${hash(JSON.stringify(node.children[0].expression.node))}"`); options = { ...options, optimised_html_hydration: true }; } else if (node.can_optimise_to_html_string && !options.has_added_svelte_hash) {