diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/DebugTag.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/DebugTag.js index ef9a070859..0711897c7b 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/DebugTag.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/DebugTag.js @@ -23,6 +23,6 @@ export function DebugTag(node, context) { const call = b.call('console.log', object); context.state.init.push( - b.stmt(b.call('$.template_effect', b.thunk(b.block([b.stmt(call), b.debugger])))) + b.stmt(b.call('$.template_effect', b.array([]), b.thunk(b.block([b.stmt(call), b.debugger])))) ); } diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js index 6a49a01fa4..a585765afb 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/Program.js @@ -5,6 +5,7 @@ import { build_getter, is_prop_source } from '../utils.js'; import * as b from '#compiler/builders'; import { add_state_transformers } from './shared/declarations.js'; import { get_rune } from '../../../scope.js'; +import { runes } from '../../../../state.js'; /** * @param {Program} node @@ -139,7 +140,7 @@ export function Program(node, context) { add_state_transformers(context); - if (context.state.is_instance) { + if (context.state.is_instance && runes) { return { ...node, body: transform_body(node, context) diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js index 3998770a71..264b8c3e34 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js @@ -476,6 +476,7 @@ function setup_select_synchronization(value_binding, context) { b.stmt( b.call( '$.template_effect', + b.array([]), b.thunk( b.block([b.stmt(/** @type {Expression} */ (context.visit(bound))), b.stmt(invalidator)]) ) @@ -654,7 +655,7 @@ function build_custom_element_attribute_update_assignment(node_id, attribute, co // this is different from other updates — it doesn't get grouped, // because set_custom_element_data may not be idempotent - const update = has_state ? b.call('$.template_effect', b.thunk(call)) : call; + const update = has_state ? b.call('$.template_effect', b.array([]), b.thunk(call)) : call; context.state.init.push(b.stmt(update)); }