Skip to content

Commit c9c2bde

Browse files
authored
chore: do not emit invalidate_effect for select synchronization (#9830)
in runes mode
1 parent 384e3a4 commit c9c2bde

File tree

1 file changed

+24
-25
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors

1 file changed

+24
-25
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -227,36 +227,35 @@ function setup_select_synchronization(value_binding, context) {
227227
}
228228
}
229229

230-
const to_invalidate = context.state.analysis.runes
231-
? b.empty
232-
: b.stmt(
230+
if (!context.state.analysis.runes) {
231+
const invalidator = b.call(
232+
'$.invalidate_inner_signals',
233+
b.thunk(
234+
b.block(
235+
names.map((name) => {
236+
const serialized = serialize_get_binding(b.id(name), context.state);
237+
return b.stmt(serialized);
238+
})
239+
)
240+
)
241+
);
242+
243+
context.state.init.push(
244+
b.stmt(
233245
b.call(
234-
'$.invalidate_inner_signals',
246+
'$.invalidate_effect',
235247
b.thunk(
236-
b.block(
237-
names.map((name) => {
238-
const serialized = serialize_get_binding(b.id(name), context.state);
239-
return b.stmt(serialized);
240-
})
241-
)
248+
b.block([
249+
b.stmt(
250+
/** @type {import('estree').Expression} */ (context.visit(value_binding.expression))
251+
),
252+
b.stmt(invalidator)
253+
])
242254
)
243255
)
244-
);
245-
context.state.init.push(
246-
b.stmt(
247-
b.call(
248-
'$.invalidate_effect',
249-
b.thunk(
250-
b.block([
251-
b.stmt(
252-
/** @type {import('estree').Expression} */ (context.visit(value_binding.expression))
253-
),
254-
to_invalidate
255-
])
256-
)
257256
)
258-
)
259-
);
257+
);
258+
}
260259
}
261260

262261
/**

0 commit comments

Comments
 (0)