Skip to content

Commit 7785d58

Browse files
authored
chore: use #client instead of ./types.js (#11259)
1 parent 1b688ea commit 7785d58

File tree

2 files changed

+43
-43
lines changed

2 files changed

+43
-43
lines changed

packages/svelte/src/internal/client/reactivity/deriveds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function derived_safe_equal(fn) {
6767
}
6868

6969
/**
70-
* @param {import('./types.js').Derived} signal
70+
* @param {import('#client').Derived} signal
7171
* @returns {void}
7272
*/
7373
function destroy_derived_children(signal) {

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

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -49,47 +49,47 @@ let is_inspecting_signal = false;
4949

5050
// Handle effect queues
5151

52-
/** @type {import('./types.js').Effect[]} */
52+
/** @type {import('#client').Effect[]} */
5353
let current_queued_root_effects = [];
5454

5555
let flush_count = 0;
5656
// Handle signal reactivity tree dependencies and reactions
5757

58-
/** @type {null | import('./types.js').Reaction} */
58+
/** @type {null | import('#client').Reaction} */
5959
export let current_reaction = null;
6060

61-
/** @param {null | import('./types.js').Reaction} reaction */
61+
/** @param {null | import('#client').Reaction} reaction */
6262
export function set_current_reaction(reaction) {
6363
current_reaction = reaction;
6464
}
6565

66-
/** @type {null | import('./types.js').Effect} */
66+
/** @type {null | import('#client').Effect} */
6767
export let current_effect = null;
6868

69-
/** @param {null | import('./types.js').Effect} effect */
69+
/** @param {null | import('#client').Effect} effect */
7070
export function set_current_effect(effect) {
7171
current_effect = effect;
7272
}
7373

74-
/** @type {null | import('./types.js').Value[]} */
74+
/** @type {null | import('#client').Value[]} */
7575
export let current_dependencies = null;
7676
let current_dependencies_index = 0;
7777
/**
7878
* Tracks writes that the effect it's executed in doesn't listen to yet,
7979
* so that the dependency can be added to the effect later on if it then reads it
80-
* @type {null | import('./types.js').Source[]}
80+
* @type {null | import('#client').Source[]}
8181
*/
8282
export let current_untracked_writes = null;
8383

84-
/** @param {null | import('./types.js').Source[]} value */
84+
/** @param {null | import('#client').Source[]} value */
8585
export function set_current_untracked_writes(value) {
8686
current_untracked_writes = value;
8787
}
8888

89-
/** @type {null | import('./types.js').ValueDebug} */
89+
/** @type {null | import('#client').ValueDebug} */
9090
export let last_inspected_signal = null;
9191

92-
/** @param {null | import('./types.js').ValueDebug} signal */
92+
/** @param {null | import('#client').ValueDebug} signal */
9393
export function set_last_inspected_signal(signal) {
9494
last_inspected_signal = signal;
9595
}
@@ -105,10 +105,10 @@ export let is_signals_recorded = false;
105105
let captured_signals = new Set();
106106

107107
// Handling runtime component context
108-
/** @type {import('./types.js').ComponentContext | null} */
108+
/** @type {import('#client').ComponentContext | null} */
109109
export let current_component_context = null;
110110

111-
/** @param {import('./types.js').ComponentContext | null} context */
111+
/** @param {import('#client').ComponentContext | null} context */
112112
export function set_current_component_context(context) {
113113
current_component_context = context;
114114
}
@@ -119,7 +119,7 @@ export function is_runes() {
119119
}
120120

121121
/**
122-
* @param {import('./types.js').ProxyStateObject} target
122+
* @param {import('#client').ProxyStateObject} target
123123
* @param {string | symbol} prop
124124
* @param {any} receiver
125125
*/
@@ -153,7 +153,7 @@ export function batch_inspect(target, prop, receiver) {
153153
/**
154154
* Determines whether a derived or effect is dirty.
155155
* If it is MAYBE_DIRTY, will set the status to CLEAN
156-
* @param {import('./types.js').Reaction} reaction
156+
* @param {import('#client').Reaction} reaction
157157
* @returns {boolean}
158158
*/
159159
export function check_dirtiness(reaction) {
@@ -218,7 +218,7 @@ export function check_dirtiness(reaction) {
218218

219219
/**
220220
* @template V
221-
* @param {import('./types.js').Reaction} signal
221+
* @param {import('#client').Reaction} signal
222222
* @returns {V}
223223
*/
224224
export function execute_reaction_fn(signal) {
@@ -229,7 +229,7 @@ export function execute_reaction_fn(signal) {
229229
const previous_skip_reaction = current_skip_reaction;
230230
const previous_untracking = current_untracking;
231231

232-
current_dependencies = /** @type {null | import('./types.js').Value[]} */ (null);
232+
current_dependencies = /** @type {null | import('#client').Value[]} */ (null);
233233
current_dependencies_index = 0;
234234
current_untracked_writes = null;
235235
current_reaction = signal;
@@ -238,7 +238,7 @@ export function execute_reaction_fn(signal) {
238238

239239
try {
240240
let res = signal.fn();
241-
let dependencies = /** @type {import('./types.js').Value<unknown>[]} **/ (signal.deps);
241+
let dependencies = /** @type {import('#client').Value<unknown>[]} **/ (signal.deps);
242242
if (current_dependencies !== null) {
243243
let i;
244244
if (dependencies !== null) {
@@ -273,7 +273,7 @@ export function execute_reaction_fn(signal) {
273273
dependencies[current_dependencies_index + i] = current_dependencies[i];
274274
}
275275
} else {
276-
signal.deps = /** @type {import('./types.js').Value<V>[]} **/ (
276+
signal.deps = /** @type {import('#client').Value<V>[]} **/ (
277277
dependencies = current_dependencies
278278
);
279279
}
@@ -311,8 +311,8 @@ export function execute_reaction_fn(signal) {
311311

312312
/**
313313
* @template V
314-
* @param {import('./types.js').Reaction} signal
315-
* @param {import('./types.js').Value<V>} dependency
314+
* @param {import('#client').Reaction} signal
315+
* @param {import('#client').Value<V>} dependency
316316
* @returns {void}
317317
*/
318318
function remove_reaction(signal, dependency) {
@@ -334,12 +334,12 @@ function remove_reaction(signal, dependency) {
334334
if (reactions_length === 0 && (dependency.f & UNOWNED) !== 0) {
335335
// If the signal is unowned then we need to make sure to change it to dirty.
336336
set_signal_status(dependency, DIRTY);
337-
remove_reactions(/** @type {import('./types.js').Derived} **/ (dependency), 0);
337+
remove_reactions(/** @type {import('#client').Derived} **/ (dependency), 0);
338338
}
339339
}
340340

341341
/**
342-
* @param {import('./types.js').Reaction} signal
342+
* @param {import('#client').Reaction} signal
343343
* @param {number} start_index
344344
* @returns {void}
345345
*/
@@ -359,7 +359,7 @@ export function remove_reactions(signal, start_index) {
359359
}
360360

361361
/**
362-
* @param {import('./types.js').Reaction} signal
362+
* @param {import('#client').Reaction} signal
363363
* @returns {void}
364364
*/
365365
export function destroy_effect_children(signal) {
@@ -375,7 +375,7 @@ export function destroy_effect_children(signal) {
375375
}
376376

377377
/**
378-
* @param {import('./types.js').Effect} effect
378+
* @param {import('#client').Effect} effect
379379
* @returns {void}
380380
*/
381381
export function execute_effect(effect) {
@@ -424,7 +424,7 @@ function infinite_loop_guard() {
424424
}
425425

426426
/**
427-
* @param {Array<import('./types.js').Effect>} root_effects
427+
* @param {Array<import('#client').Effect>} root_effects
428428
* @returns {void}
429429
*/
430430
function flush_queued_root_effects(root_effects) {
@@ -435,7 +435,7 @@ function flush_queued_root_effects(root_effects) {
435435
}
436436

437437
/**
438-
* @param {Array<import('./types.js').Effect>} effects
438+
* @param {Array<import('#client').Effect>} effects
439439
* @returns {void}
440440
*/
441441
function flush_queued_effects(effects) {
@@ -466,7 +466,7 @@ function process_microtask() {
466466
}
467467

468468
/**
469-
* @param {import('./types.js').Effect} signal
469+
* @param {import('#client').Effect} signal
470470
* @returns {void}
471471
*/
472472
export function schedule_effect(signal) {
@@ -499,10 +499,10 @@ export function schedule_effect(signal) {
499499
* bitwise flag passed in only. The collected effects array will be populated with all the user
500500
* effects to be flushed.
501501
*
502-
* @param {import('./types.js').Effect} effect
502+
* @param {import('#client').Effect} effect
503503
* @param {number} filter_flags
504504
* @param {boolean} shallow
505-
* @param {import('./types.js').Effect[]} collected_effects
505+
* @param {import('#client').Effect[]} collected_effects
506506
* @returns {void}
507507
*/
508508
function process_effects(effect, filter_flags, shallow, collected_effects) {
@@ -591,7 +591,7 @@ function process_effects(effect, filter_flags, shallow, collected_effects) {
591591
* Effects will be collected when they match the filtered bitwise flag passed in only. The collected
592592
* array will be populated with all the effects.
593593
*
594-
* @param {import('./types.js').Effect} effect
594+
* @param {import('#client').Effect} effect
595595
* @param {number} filter_flags
596596
* @param {boolean} [shallow]
597597
* @returns {void}
@@ -617,7 +617,7 @@ function flush_nested_effects(effect, filter_flags, shallow = false) {
617617
}
618618

619619
/**
620-
* @param {import('./types.js').Effect} effect
620+
* @param {import('#client').Effect} effect
621621
* @returns {void}
622622
*/
623623
export function flush_local_render_effects(effect) {
@@ -640,7 +640,7 @@ export function flush_sync(fn, flush_previous = true) {
640640
try {
641641
infinite_loop_guard();
642642

643-
/** @type {import('./types.js').Effect[]} */
643+
/** @type {import('#client').Effect[]} */
644644
const root_effects = [];
645645

646646
current_scheduler_mode = FLUSH_SYNC;
@@ -679,7 +679,7 @@ export async function tick() {
679679

680680
/**
681681
* @template V
682-
* @param {import('./types.js').Value<V>} signal
682+
* @param {import('#client').Value<V>} signal
683683
* @returns {V}
684684
*/
685685
export function get(signal) {
@@ -744,10 +744,10 @@ export function get(signal) {
744744
// we want to avoid tracking indirect dependencies
745745
const previous_inspect_fn = inspect_fn;
746746
set_inspect_fn(null);
747-
update_derived(/** @type {import('./types.js').Derived} **/ (signal), false);
747+
update_derived(/** @type {import('#client').Derived} **/ (signal), false);
748748
set_inspect_fn(previous_inspect_fn);
749749
} else {
750-
update_derived(/** @type {import('./types.js').Derived} **/ (signal), false);
750+
update_derived(/** @type {import('#client').Derived} **/ (signal), false);
751751
}
752752
}
753753

@@ -849,7 +849,7 @@ export function untrack(fn) {
849849
const STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
850850

851851
/**
852-
* @param {import('./types.js').Signal} signal
852+
* @param {import('#client').Signal} signal
853853
* @param {number} status
854854
* @returns {void}
855855
*/
@@ -859,14 +859,14 @@ export function set_signal_status(signal, status) {
859859

860860
/**
861861
* @template V
862-
* @param {V | import('./types.js').Value<V>} val
863-
* @returns {val is import('./types.js').Value<V>}
862+
* @param {V | import('#client').Value<V>} val
863+
* @returns {val is import('#client').Value<V>}
864864
*/
865865
export function is_signal(val) {
866866
return (
867867
typeof val === 'object' &&
868868
val !== null &&
869-
typeof (/** @type {import('./types.js').Value<V>} */ (val).f) === 'number'
869+
typeof (/** @type {import('#client').Value<V>} */ (val).f) === 'number'
870870
);
871871
}
872872

@@ -964,7 +964,7 @@ function get_or_init_context_map() {
964964
}
965965

966966
/**
967-
* @param {import('./types.js').ComponentContext} component_context
967+
* @param {import('#client').ComponentContext} component_context
968968
* @returns {Map<unknown, unknown> | null}
969969
*/
970970
function get_parent_context(component_context) {
@@ -980,7 +980,7 @@ function get_parent_context(component_context) {
980980
}
981981

982982
/**
983-
* @param {import('./types.js').Value<number>} signal
983+
* @param {import('#client').Value<number>} signal
984984
* @param {1 | -1} [d]
985985
* @returns {number}
986986
*/
@@ -991,7 +991,7 @@ export function update(signal, d = 1) {
991991
}
992992

993993
/**
994-
* @param {import('./types.js').Value<number>} signal
994+
* @param {import('#client').Value<number>} signal
995995
* @param {1 | -1} [d]
996996
* @returns {number}
997997
*/

0 commit comments

Comments
 (0)