svelte 5.41.0 → 5.41.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/index.js +1 -1
- package/package.json +1 -1
- package/src/compiler/phases/2-analyze/index.js +3 -3
- package/src/compiler/phases/2-analyze/visitors/AwaitExpression.js +13 -6
- package/src/compiler/phases/2-analyze/visitors/CallExpression.js +1 -1
- package/src/compiler/phases/2-analyze/visitors/ConstTag.js +3 -1
- package/src/compiler/phases/2-analyze/visitors/EachBlock.js +2 -1
- package/src/compiler/phases/2-analyze/visitors/VariableDeclarator.js +0 -6
- package/src/compiler/phases/3-transform/client/transform-client.js +4 -1
- package/src/compiler/phases/3-transform/client/visitors/CallExpression.js +21 -3
- package/src/compiler/phases/3-transform/client/visitors/Fragment.js +7 -2
- package/src/compiler/phases/3-transform/client/visitors/LetDirective.js +21 -17
- package/src/compiler/phases/3-transform/client/visitors/RegularElement.js +1 -1
- package/src/compiler/phases/3-transform/client/visitors/SlotElement.js +1 -1
- package/src/compiler/phases/3-transform/client/visitors/SvelteFragment.js +1 -1
- package/src/compiler/phases/3-transform/client/visitors/shared/component.js +2 -2
- package/src/compiler/phases/3-transform/server/visitors/CallExpression.js +10 -4
- package/src/compiler/phases/3-transform/utils.js +14 -25
- package/src/internal/client/dev/inspect.js +14 -4
- package/src/internal/client/dev/tracing.js +10 -1
- package/src/internal/client/dom/blocks/async.js +5 -0
- package/src/internal/client/dom/blocks/await.js +71 -137
- package/src/internal/client/dom/blocks/boundary.js +7 -26
- package/src/internal/client/dom/blocks/branches.js +185 -0
- package/src/internal/client/dom/blocks/if.js +28 -107
- package/src/internal/client/dom/blocks/key.js +12 -58
- package/src/internal/client/dom/blocks/snippet.js +6 -22
- package/src/internal/client/dom/blocks/svelte-component.js +7 -63
- package/src/internal/client/dom/blocks/svelte-element.js +34 -45
- package/src/internal/client/reactivity/async.js +27 -16
- package/src/internal/client/reactivity/batch.js +134 -69
- package/src/internal/client/reactivity/deriveds.js +19 -10
- package/src/internal/client/reactivity/effects.js +20 -2
- package/src/internal/client/reactivity/sources.js +1 -1
- package/src/internal/server/index.js +0 -9
- package/src/version.js +1 -1
- package/types/index.d.ts.map +1 -1
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
RENDER_EFFECT,
|
|
12
12
|
ROOT_EFFECT,
|
|
13
13
|
MAYBE_DIRTY,
|
|
14
|
-
DERIVED
|
|
14
|
+
DERIVED,
|
|
15
|
+
BOUNDARY_EFFECT
|
|
15
16
|
} from '#client/constants';
|
|
16
17
|
import { async_mode_flag } from '../../flags/index.js';
|
|
17
18
|
import { deferred, define_property } from '../../shared/utils.js';
|
|
@@ -31,6 +32,16 @@ import { invoke_error_boundary } from '../error-handling.js';
|
|
|
31
32
|
import { old_values, source, update } from './sources.js';
|
|
32
33
|
import { inspect_effect, unlink_effect } from './effects.js';
|
|
33
34
|
|
|
35
|
+
/**
|
|
36
|
+
* @typedef {{
|
|
37
|
+
* parent: EffectTarget | null;
|
|
38
|
+
* effect: Effect | null;
|
|
39
|
+
* effects: Effect[];
|
|
40
|
+
* render_effects: Effect[];
|
|
41
|
+
* block_effects: Effect[];
|
|
42
|
+
* }} EffectTarget
|
|
43
|
+
*/
|
|
44
|
+
|
|
34
45
|
/** @type {Set<Batch>} */
|
|
35
46
|
const batches = new Set();
|
|
36
47
|
|
|
@@ -65,6 +76,8 @@ let is_flushing = false;
|
|
|
65
76
|
export let is_flushing_sync = false;
|
|
66
77
|
|
|
67
78
|
export class Batch {
|
|
79
|
+
committed = false;
|
|
80
|
+
|
|
68
81
|
/**
|
|
69
82
|
* The current values of any sources that are updated in this batch
|
|
70
83
|
* They keys of this map are identical to `this.#previous`
|
|
@@ -91,6 +104,11 @@ export class Batch {
|
|
|
91
104
|
*/
|
|
92
105
|
#pending = 0;
|
|
93
106
|
|
|
107
|
+
/**
|
|
108
|
+
* The number of async effects that are currently in flight, _not_ inside a pending boundary
|
|
109
|
+
*/
|
|
110
|
+
#blocking_pending = 0;
|
|
111
|
+
|
|
94
112
|
/**
|
|
95
113
|
* A deferred that resolves when the batch is committed, used with `settled()`
|
|
96
114
|
* TODO replace with Promise.withResolvers once supported widely enough
|
|
@@ -98,26 +116,6 @@ export class Batch {
|
|
|
98
116
|
*/
|
|
99
117
|
#deferred = null;
|
|
100
118
|
|
|
101
|
-
/**
|
|
102
|
-
* Template effects and `$effect.pre` effects, which run when
|
|
103
|
-
* a batch is committed
|
|
104
|
-
* @type {Effect[]}
|
|
105
|
-
*/
|
|
106
|
-
#render_effects = [];
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* The same as `#render_effects`, but for `$effect` (which runs after)
|
|
110
|
-
* @type {Effect[]}
|
|
111
|
-
*/
|
|
112
|
-
#effects = [];
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Block effects, which may need to re-run on subsequent flushes
|
|
116
|
-
* in order to update internal sources (e.g. each block items)
|
|
117
|
-
* @type {Effect[]}
|
|
118
|
-
*/
|
|
119
|
-
#block_effects = [];
|
|
120
|
-
|
|
121
119
|
/**
|
|
122
120
|
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
123
121
|
* @type {Effect[]}
|
|
@@ -148,41 +146,37 @@ export class Batch {
|
|
|
148
146
|
|
|
149
147
|
this.apply();
|
|
150
148
|
|
|
149
|
+
/** @type {EffectTarget} */
|
|
150
|
+
var target = {
|
|
151
|
+
parent: null,
|
|
152
|
+
effect: null,
|
|
153
|
+
effects: [],
|
|
154
|
+
render_effects: [],
|
|
155
|
+
block_effects: []
|
|
156
|
+
};
|
|
157
|
+
|
|
151
158
|
for (const root of root_effects) {
|
|
152
|
-
this.#traverse_effect_tree(root);
|
|
159
|
+
this.#traverse_effect_tree(root, target);
|
|
153
160
|
}
|
|
154
161
|
|
|
155
|
-
|
|
156
|
-
if (this.#pending === 0) {
|
|
157
|
-
// TODO we need this because we commit _then_ flush effects...
|
|
158
|
-
// maybe there's a way we can reverse the order?
|
|
159
|
-
var previous_batch_sources = batch_values;
|
|
160
|
-
|
|
161
|
-
this.#commit();
|
|
162
|
-
|
|
163
|
-
var render_effects = this.#render_effects;
|
|
164
|
-
var effects = this.#effects;
|
|
162
|
+
this.#resolve();
|
|
165
163
|
|
|
166
|
-
|
|
167
|
-
this.#effects
|
|
168
|
-
this.#
|
|
164
|
+
if (this.#blocking_pending > 0) {
|
|
165
|
+
this.#defer_effects(target.effects);
|
|
166
|
+
this.#defer_effects(target.render_effects);
|
|
167
|
+
this.#defer_effects(target.block_effects);
|
|
168
|
+
} else {
|
|
169
|
+
// TODO append/detach blocks here, not in #commit
|
|
169
170
|
|
|
170
171
|
// If sources are written to, then work needs to happen in a separate batch, else prior sources would be mixed with
|
|
171
172
|
// newly updated sources, which could lead to infinite loops when effects run over and over again.
|
|
172
173
|
previous_batch = this;
|
|
173
174
|
current_batch = null;
|
|
174
175
|
|
|
175
|
-
|
|
176
|
-
flush_queued_effects(
|
|
177
|
-
flush_queued_effects(effects);
|
|
176
|
+
flush_queued_effects(target.render_effects);
|
|
177
|
+
flush_queued_effects(target.effects);
|
|
178
178
|
|
|
179
179
|
previous_batch = null;
|
|
180
|
-
|
|
181
|
-
this.#deferred?.resolve();
|
|
182
|
-
} else {
|
|
183
|
-
this.#defer_effects(this.#render_effects);
|
|
184
|
-
this.#defer_effects(this.#effects);
|
|
185
|
-
this.#defer_effects(this.#block_effects);
|
|
186
180
|
}
|
|
187
181
|
|
|
188
182
|
batch_values = null;
|
|
@@ -192,8 +186,9 @@ export class Batch {
|
|
|
192
186
|
* Traverse the effect tree, executing effects or stashing
|
|
193
187
|
* them for later execution as appropriate
|
|
194
188
|
* @param {Effect} root
|
|
189
|
+
* @param {EffectTarget} target
|
|
195
190
|
*/
|
|
196
|
-
#traverse_effect_tree(root) {
|
|
191
|
+
#traverse_effect_tree(root, target) {
|
|
197
192
|
root.f ^= CLEAN;
|
|
198
193
|
|
|
199
194
|
var effect = root.first;
|
|
@@ -205,15 +200,25 @@ export class Batch {
|
|
|
205
200
|
|
|
206
201
|
var skip = is_skippable_branch || (flags & INERT) !== 0 || this.skipped_effects.has(effect);
|
|
207
202
|
|
|
203
|
+
if ((effect.f & BOUNDARY_EFFECT) !== 0 && effect.b?.is_pending()) {
|
|
204
|
+
target = {
|
|
205
|
+
parent: target,
|
|
206
|
+
effect,
|
|
207
|
+
effects: [],
|
|
208
|
+
render_effects: [],
|
|
209
|
+
block_effects: []
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
208
213
|
if (!skip && effect.fn !== null) {
|
|
209
214
|
if (is_branch) {
|
|
210
215
|
effect.f ^= CLEAN;
|
|
211
216
|
} else if ((flags & EFFECT) !== 0) {
|
|
212
|
-
|
|
217
|
+
target.effects.push(effect);
|
|
213
218
|
} else if (async_mode_flag && (flags & RENDER_EFFECT) !== 0) {
|
|
214
|
-
|
|
219
|
+
target.render_effects.push(effect);
|
|
215
220
|
} else if (is_dirty(effect)) {
|
|
216
|
-
if ((effect.f & BLOCK_EFFECT) !== 0)
|
|
221
|
+
if ((effect.f & BLOCK_EFFECT) !== 0) target.block_effects.push(effect);
|
|
217
222
|
update_effect(effect);
|
|
218
223
|
}
|
|
219
224
|
|
|
@@ -229,6 +234,17 @@ export class Batch {
|
|
|
229
234
|
effect = effect.next;
|
|
230
235
|
|
|
231
236
|
while (effect === null && parent !== null) {
|
|
237
|
+
if (parent === target.effect) {
|
|
238
|
+
// TODO rather than traversing into pending boundaries and deferring the effects,
|
|
239
|
+
// could we just attach the effects _to_ the pending boundary and schedule them
|
|
240
|
+
// once the boundary is ready?
|
|
241
|
+
this.#defer_effects(target.effects);
|
|
242
|
+
this.#defer_effects(target.render_effects);
|
|
243
|
+
this.#defer_effects(target.block_effects);
|
|
244
|
+
|
|
245
|
+
target = /** @type {EffectTarget} */ (target.parent);
|
|
246
|
+
}
|
|
247
|
+
|
|
232
248
|
effect = parent.next;
|
|
233
249
|
parent = parent.parent;
|
|
234
250
|
}
|
|
@@ -246,8 +262,6 @@ export class Batch {
|
|
|
246
262
|
// mark as clean so they get scheduled if they depend on pending async state
|
|
247
263
|
set_signal_status(e, CLEAN);
|
|
248
264
|
}
|
|
249
|
-
|
|
250
|
-
effects.length = 0;
|
|
251
265
|
}
|
|
252
266
|
|
|
253
267
|
/**
|
|
@@ -283,8 +297,8 @@ export class Batch {
|
|
|
283
297
|
// this can happen if a new batch was created during `flush_effects()`
|
|
284
298
|
return;
|
|
285
299
|
}
|
|
286
|
-
} else
|
|
287
|
-
this.#
|
|
300
|
+
} else {
|
|
301
|
+
this.#resolve();
|
|
288
302
|
}
|
|
289
303
|
|
|
290
304
|
this.deactivate();
|
|
@@ -300,16 +314,19 @@ export class Batch {
|
|
|
300
314
|
}
|
|
301
315
|
}
|
|
302
316
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
fn();
|
|
317
|
+
#resolve() {
|
|
318
|
+
if (this.#blocking_pending === 0) {
|
|
319
|
+
// append/remove branches
|
|
320
|
+
for (const fn of this.#callbacks) fn();
|
|
321
|
+
this.#callbacks.clear();
|
|
309
322
|
}
|
|
310
323
|
|
|
311
|
-
this.#
|
|
324
|
+
if (this.#pending === 0) {
|
|
325
|
+
this.#commit();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
312
328
|
|
|
329
|
+
#commit() {
|
|
313
330
|
// If there are other pending batches, they now need to be 'rebased' —
|
|
314
331
|
// in other words, we re-run block/async effects with the newly
|
|
315
332
|
// committed state, unless the batch in question has a more
|
|
@@ -317,7 +334,17 @@ export class Batch {
|
|
|
317
334
|
if (batches.size > 1) {
|
|
318
335
|
this.#previous.clear();
|
|
319
336
|
|
|
320
|
-
|
|
337
|
+
var previous_batch_values = batch_values;
|
|
338
|
+
var is_earlier = true;
|
|
339
|
+
|
|
340
|
+
/** @type {EffectTarget} */
|
|
341
|
+
var dummy_target = {
|
|
342
|
+
parent: null,
|
|
343
|
+
effect: null,
|
|
344
|
+
effects: [],
|
|
345
|
+
render_effects: [],
|
|
346
|
+
block_effects: []
|
|
347
|
+
};
|
|
321
348
|
|
|
322
349
|
for (const batch of batches) {
|
|
323
350
|
if (batch === this) {
|
|
@@ -359,9 +386,11 @@ export class Batch {
|
|
|
359
386
|
batch.apply();
|
|
360
387
|
|
|
361
388
|
for (const root of queued_root_effects) {
|
|
362
|
-
batch.#traverse_effect_tree(root);
|
|
389
|
+
batch.#traverse_effect_tree(root, dummy_target);
|
|
363
390
|
}
|
|
364
391
|
|
|
392
|
+
// TODO do we need to do anything with `target`? defer block effects?
|
|
393
|
+
|
|
365
394
|
queued_root_effects = [];
|
|
366
395
|
batch.deactivate();
|
|
367
396
|
}
|
|
@@ -369,17 +398,31 @@ export class Batch {
|
|
|
369
398
|
}
|
|
370
399
|
|
|
371
400
|
current_batch = null;
|
|
401
|
+
batch_values = previous_batch_values;
|
|
372
402
|
}
|
|
373
403
|
|
|
404
|
+
this.committed = true;
|
|
374
405
|
batches.delete(this);
|
|
406
|
+
|
|
407
|
+
this.#deferred?.resolve();
|
|
375
408
|
}
|
|
376
409
|
|
|
377
|
-
|
|
410
|
+
/**
|
|
411
|
+
*
|
|
412
|
+
* @param {boolean} blocking
|
|
413
|
+
*/
|
|
414
|
+
increment(blocking) {
|
|
378
415
|
this.#pending += 1;
|
|
416
|
+
if (blocking) this.#blocking_pending += 1;
|
|
379
417
|
}
|
|
380
418
|
|
|
381
|
-
|
|
419
|
+
/**
|
|
420
|
+
*
|
|
421
|
+
* @param {boolean} blocking
|
|
422
|
+
*/
|
|
423
|
+
decrement(blocking) {
|
|
382
424
|
this.#pending -= 1;
|
|
425
|
+
if (blocking) this.#blocking_pending -= 1;
|
|
383
426
|
|
|
384
427
|
for (const e of this.#dirty_effects) {
|
|
385
428
|
set_signal_status(e, DIRTY);
|
|
@@ -391,6 +434,9 @@ export class Batch {
|
|
|
391
434
|
schedule_effect(e);
|
|
392
435
|
}
|
|
393
436
|
|
|
437
|
+
this.#dirty_effects = [];
|
|
438
|
+
this.#maybe_dirty_effects = [];
|
|
439
|
+
|
|
394
440
|
this.flush();
|
|
395
441
|
}
|
|
396
442
|
|
|
@@ -561,7 +607,7 @@ function infinite_loop_guard() {
|
|
|
561
607
|
}
|
|
562
608
|
}
|
|
563
609
|
|
|
564
|
-
/** @type {Effect
|
|
610
|
+
/** @type {Set<Effect> | null} */
|
|
565
611
|
export let eager_block_effects = null;
|
|
566
612
|
|
|
567
613
|
/**
|
|
@@ -578,7 +624,7 @@ function flush_queued_effects(effects) {
|
|
|
578
624
|
var effect = effects[i++];
|
|
579
625
|
|
|
580
626
|
if ((effect.f & (DESTROYED | INERT)) === 0 && is_dirty(effect)) {
|
|
581
|
-
eager_block_effects =
|
|
627
|
+
eager_block_effects = new Set();
|
|
582
628
|
|
|
583
629
|
update_effect(effect);
|
|
584
630
|
|
|
@@ -601,15 +647,34 @@ function flush_queued_effects(effects) {
|
|
|
601
647
|
|
|
602
648
|
// If update_effect() has a flushSync() in it, we may have flushed another flush_queued_effects(),
|
|
603
649
|
// which already handled this logic and did set eager_block_effects to null.
|
|
604
|
-
if (eager_block_effects?.
|
|
605
|
-
// TODO this feels incorrect! it gets the tests passing
|
|
650
|
+
if (eager_block_effects?.size > 0) {
|
|
606
651
|
old_values.clear();
|
|
607
652
|
|
|
608
653
|
for (const e of eager_block_effects) {
|
|
609
|
-
|
|
654
|
+
// Skip eager effects that have already been unmounted
|
|
655
|
+
if ((e.f & (DESTROYED | INERT)) !== 0) continue;
|
|
656
|
+
|
|
657
|
+
// Run effects in order from ancestor to descendant, else we could run into nullpointers
|
|
658
|
+
/** @type {Effect[]} */
|
|
659
|
+
const ordered_effects = [e];
|
|
660
|
+
let ancestor = e.parent;
|
|
661
|
+
while (ancestor !== null) {
|
|
662
|
+
if (eager_block_effects.has(ancestor)) {
|
|
663
|
+
eager_block_effects.delete(ancestor);
|
|
664
|
+
ordered_effects.push(ancestor);
|
|
665
|
+
}
|
|
666
|
+
ancestor = ancestor.parent;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
for (let j = ordered_effects.length - 1; j >= 0; j--) {
|
|
670
|
+
const e = ordered_effects[j];
|
|
671
|
+
// Skip eager effects that have already been unmounted
|
|
672
|
+
if ((e.f & (DESTROYED | INERT)) !== 0) continue;
|
|
673
|
+
update_effect(e);
|
|
674
|
+
}
|
|
610
675
|
}
|
|
611
676
|
|
|
612
|
-
eager_block_effects
|
|
677
|
+
eager_block_effects.clear();
|
|
613
678
|
}
|
|
614
679
|
}
|
|
615
680
|
}
|
|
@@ -127,7 +127,17 @@ export function async_derived(fn, location) {
|
|
|
127
127
|
// If this code is changed at some point, make sure to still access the then property
|
|
128
128
|
// of fn() to read any signals it might access, so that we track them as dependencies.
|
|
129
129
|
// We call `unset_context` to undo any `save` calls that happen inside `fn()`
|
|
130
|
-
Promise.resolve(fn())
|
|
130
|
+
Promise.resolve(fn())
|
|
131
|
+
.then(d.resolve, d.reject)
|
|
132
|
+
.then(() => {
|
|
133
|
+
if (batch === current_batch && batch.committed) {
|
|
134
|
+
// if the batch was rejected as stale, we need to cleanup
|
|
135
|
+
// after any `$.save(...)` calls inside `fn()`
|
|
136
|
+
batch.deactivate();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
unset_context();
|
|
140
|
+
});
|
|
131
141
|
} catch (error) {
|
|
132
142
|
d.reject(error);
|
|
133
143
|
unset_context();
|
|
@@ -136,17 +146,16 @@ export function async_derived(fn, location) {
|
|
|
136
146
|
if (DEV) current_async_effect = null;
|
|
137
147
|
|
|
138
148
|
var batch = /** @type {Batch} */ (current_batch);
|
|
139
|
-
var pending = boundary.is_pending();
|
|
140
149
|
|
|
141
150
|
if (should_suspend) {
|
|
151
|
+
var blocking = !boundary.is_pending();
|
|
152
|
+
|
|
142
153
|
boundary.update_pending_count(1);
|
|
143
|
-
|
|
144
|
-
batch.increment();
|
|
154
|
+
batch.increment(blocking);
|
|
145
155
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
156
|
+
deferreds.get(batch)?.reject(STALE_REACTION);
|
|
157
|
+
deferreds.delete(batch); // delete to ensure correct order in Map iteration below
|
|
158
|
+
deferreds.set(batch, d);
|
|
150
159
|
}
|
|
151
160
|
|
|
152
161
|
/**
|
|
@@ -156,7 +165,7 @@ export function async_derived(fn, location) {
|
|
|
156
165
|
const handler = (value, error = undefined) => {
|
|
157
166
|
current_async_effect = null;
|
|
158
167
|
|
|
159
|
-
|
|
168
|
+
batch.activate();
|
|
160
169
|
|
|
161
170
|
if (error) {
|
|
162
171
|
if (error !== STALE_REACTION) {
|
|
@@ -193,7 +202,7 @@ export function async_derived(fn, location) {
|
|
|
193
202
|
|
|
194
203
|
if (should_suspend) {
|
|
195
204
|
boundary.update_pending_count(-1);
|
|
196
|
-
|
|
205
|
+
batch.decrement(blocking);
|
|
197
206
|
}
|
|
198
207
|
};
|
|
199
208
|
|
|
@@ -553,15 +553,16 @@ export function unlink_effect(effect) {
|
|
|
553
553
|
* A paused effect does not update, and the DOM subtree becomes inert.
|
|
554
554
|
* @param {Effect} effect
|
|
555
555
|
* @param {() => void} [callback]
|
|
556
|
+
* @param {boolean} [destroy]
|
|
556
557
|
*/
|
|
557
|
-
export function pause_effect(effect, callback) {
|
|
558
|
+
export function pause_effect(effect, callback, destroy = true) {
|
|
558
559
|
/** @type {TransitionManager[]} */
|
|
559
560
|
var transitions = [];
|
|
560
561
|
|
|
561
562
|
pause_children(effect, transitions, true);
|
|
562
563
|
|
|
563
564
|
run_out_transitions(transitions, () => {
|
|
564
|
-
destroy_effect(effect);
|
|
565
|
+
if (destroy) destroy_effect(effect);
|
|
565
566
|
if (callback) callback();
|
|
566
567
|
});
|
|
567
568
|
}
|
|
@@ -662,3 +663,20 @@ function resume_children(effect, local) {
|
|
|
662
663
|
export function aborted(effect = /** @type {Effect} */ (active_effect)) {
|
|
663
664
|
return (effect.f & DESTROYED) !== 0;
|
|
664
665
|
}
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* @param {Effect} effect
|
|
669
|
+
* @param {DocumentFragment} fragment
|
|
670
|
+
*/
|
|
671
|
+
export function move_effect(effect, fragment) {
|
|
672
|
+
var node = effect.nodes_start;
|
|
673
|
+
var end = effect.nodes_end;
|
|
674
|
+
|
|
675
|
+
while (node !== null) {
|
|
676
|
+
/** @type {TemplateNode | null} */
|
|
677
|
+
var next = node === end ? null : /** @type {TemplateNode} */ (get_next_sibling(node));
|
|
678
|
+
|
|
679
|
+
fragment.append(node);
|
|
680
|
+
node = next;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
@@ -336,7 +336,7 @@ function mark_reactions(signal, status) {
|
|
|
336
336
|
} else if (not_dirty) {
|
|
337
337
|
if ((flags & BLOCK_EFFECT) !== 0) {
|
|
338
338
|
if (eager_block_effects !== null) {
|
|
339
|
-
eager_block_effects.
|
|
339
|
+
eager_block_effects.add(/** @type {Effect} */ (reaction));
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
|
|
@@ -418,15 +418,6 @@ export function ensure_array_like(array_like_or_iterator) {
|
|
|
418
418
|
return [];
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
/**
|
|
422
|
-
* @param {any[]} args
|
|
423
|
-
* @param {Function} [inspect]
|
|
424
|
-
*/
|
|
425
|
-
// eslint-disable-next-line no-console
|
|
426
|
-
export function inspect(args, inspect = console.log) {
|
|
427
|
-
inspect('init', ...args);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
421
|
/**
|
|
431
422
|
* @template V
|
|
432
423
|
* @param {() => V} get_value
|
package/src/version.js
CHANGED
package/types/index.d.ts.map
CHANGED
|
@@ -261,6 +261,6 @@
|
|
|
261
261
|
null,
|
|
262
262
|
null
|
|
263
263
|
],
|
|
264
|
-
"mappings": ";;;;;;;kBAUiBA,2BAA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkC/BC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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