Skip to content

Commit 22811ac

Browse files
committed
more
1 parent 9f1d1e7 commit 22811ac

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,8 +2777,8 @@ export const template_visitors = {
27772777
}
27782778
},
27792779
LetDirective(node, { state }) {
2780-
// let:x --> const x = $.derived(() => $.unwrap($$slotProps).x);
2781-
// let:x={{y, z}} --> const derived_x = $.derived(() => { const { y, z } = $.unwrap($$slotProps).x; return { y, z }));
2780+
// let:x --> const x = $.derived(() => $$slotProps.x);
2781+
// let:x={{y, z}} --> const derived_x = $.derived(() => { const { y, z } = $$slotProps.x; return { y, z }));
27822782
if (node.expression && node.expression.type !== 'Identifier') {
27832783
const name = state.scope.generate(node.name);
27842784
const bindings = state.scope.get_bindings(node);
@@ -2800,7 +2800,7 @@ export const template_visitors = {
28002800
b.object_pattern(node.expression.properties)
28012801
: // @ts-expect-error types don't match, but it can't contain spread elements and the structure is otherwise fine
28022802
b.array_pattern(node.expression.elements),
2803-
b.member(b.call('$.unwrap', b.id('$$slotProps')), b.id(node.name))
2803+
b.member(b.id('$$slotProps'), b.id(node.name))
28042804
),
28052805
b.return(b.object(bindings.map((binding) => b.init(binding.node.name, binding.node))))
28062806
])
@@ -2811,10 +2811,7 @@ export const template_visitors = {
28112811
const name = node.expression === null ? node.name : node.expression.name;
28122812
return b.const(
28132813
name,
2814-
b.call(
2815-
'$.derived',
2816-
b.thunk(b.member(b.call('$.unwrap', b.id('$$slotProps')), b.id(node.name)))
2817-
)
2814+
b.call('$.derived', b.thunk(b.member(b.id('$$slotProps'), b.id(node.name))))
28182815
);
28192816
}
28202817
},

packages/svelte/src/internal/client/render.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
push_destroy_fn,
3030
execute_effect,
3131
UNINITIALIZED,
32-
derived,
3332
untrack,
3433
effect,
3534
flushSync,
@@ -38,8 +37,7 @@ import {
3837
managed_effect,
3938
push,
4039
current_component_context,
41-
pop,
42-
unwrap
40+
pop
4341
} from './runtime.js';
4442
import {
4543
current_hydration_fragment,
@@ -58,7 +56,7 @@ import {
5856
} from './utils.js';
5957
import { is_promise } from '../common.js';
6058
import { bind_transition, trigger_transitions } from './transitions.js';
61-
import { observe, proxy } from './proxy/proxy.js';
59+
import { proxy } from './proxy/proxy.js';
6260

6361
/** @type {Set<string>} */
6462
const all_registerd_events = new Set();

0 commit comments

Comments
 (0)