svelte 5.48.4 → 5.48.5

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "svelte",
3
3
  "description": "Cybernetically enhanced web apps",
4
4
  "license": "MIT",
5
- "version": "5.48.4",
5
+ "version": "5.48.5",
6
6
  "type": "module",
7
7
  "types": "./types/index.d.ts",
8
8
  "engines": {
@@ -1,5 +1,6 @@
1
1
  /** @import { Effect, Source, TemplateNode, } from '#client' */
2
2
  import {
3
+ BLOCK_EFFECT,
3
4
  BOUNDARY_EFFECT,
4
5
  COMMENT_NODE,
5
6
  DIRTY,
@@ -449,21 +450,16 @@ export class Boundary {
449
450
  }
450
451
  };
451
452
 
452
- var previous_reaction = active_reaction;
453
-
454
- try {
455
- set_active_reaction(null);
456
- calling_on_error = true;
457
- onerror?.(error, reset);
458
- calling_on_error = false;
459
- } catch (error) {
460
- invoke_error_boundary(error, this.#effect && this.#effect.parent);
461
- } finally {
462
- set_active_reaction(previous_reaction);
463
- }
453
+ queue_micro_task(() => {
454
+ try {
455
+ calling_on_error = true;
456
+ onerror?.(error, reset);
457
+ calling_on_error = false;
458
+ } catch (error) {
459
+ invoke_error_boundary(error, this.#effect && this.#effect.parent);
460
+ }
464
461
 
465
- if (failed) {
466
- queue_micro_task(() => {
462
+ if (failed) {
467
463
  this.#failed_effect = this.#run(() => {
468
464
  Batch.ensure();
469
465
  this.#is_creating_fallback = true;
@@ -483,8 +479,8 @@ export class Boundary {
483
479
  this.#is_creating_fallback = false;
484
480
  }
485
481
  });
486
- });
487
- }
482
+ }
483
+ });
488
484
  }
489
485
  }
490
486
 
@@ -34,7 +34,7 @@ import {
34
34
  } from '../../reactivity/effects.js';
35
35
  import { source, mutable_source, internal_set } from '../../reactivity/sources.js';
36
36
  import { array_from, is_array } from '../../../shared/utils.js';
37
- import { COMMENT_NODE, EFFECT_OFFSCREEN, INERT } from '#client/constants';
37
+ import { BRANCH_EFFECT, COMMENT_NODE, EFFECT_OFFSCREEN, INERT } from '#client/constants';
38
38
  import { queue_micro_task } from '../task.js';
39
39
  import { get } from '../../runtime.js';
40
40
  import { DEV } from 'esm-env';
@@ -336,6 +336,18 @@ export function each(node, flags, get_collection, get_key, render_fn, fallback_f
336
336
  }
337
337
  }
338
338
 
339
+ /**
340
+ * Skip past any non-branch effects (which could be created with `createSubscriber`, for example) to find the next branch effect
341
+ * @param {Effect | null} effect
342
+ * @returns {Effect | null}
343
+ */
344
+ function skip_to_branch(effect) {
345
+ while (effect !== null && (effect.f & BRANCH_EFFECT) === 0) {
346
+ effect = effect.next;
347
+ }
348
+ return effect;
349
+ }
350
+
339
351
  /**
340
352
  * Add, remove, or reorder items output by an each block as its input changes
341
353
  * @template V
@@ -351,7 +363,7 @@ function reconcile(state, array, anchor, flags, get_key) {
351
363
 
352
364
  var length = array.length;
353
365
  var items = state.items;
354
- var current = state.effect.first;
366
+ var current = skip_to_branch(state.effect.first);
355
367
 
356
368
  /** @type {undefined | Set<Effect>} */
357
369
  var seen;
@@ -431,7 +443,7 @@ function reconcile(state, array, anchor, flags, get_key) {
431
443
  matched = [];
432
444
  stashed = [];
433
445
 
434
- current = prev.next;
446
+ current = skip_to_branch(prev.next);
435
447
  continue;
436
448
  }
437
449
  }
@@ -495,7 +507,7 @@ function reconcile(state, array, anchor, flags, get_key) {
495
507
  while (current !== null && current !== effect) {
496
508
  (seen ??= new Set()).add(current);
497
509
  stashed.push(current);
498
- current = current.next;
510
+ current = skip_to_branch(current.next);
499
511
  }
500
512
 
501
513
  if (current === null) {
@@ -508,7 +520,7 @@ function reconcile(state, array, anchor, flags, get_key) {
508
520
  }
509
521
 
510
522
  prev = effect;
511
- current = effect.next;
523
+ current = skip_to_branch(effect.next);
512
524
  }
513
525
 
514
526
  if (state.outrogroups !== null) {
@@ -542,7 +554,7 @@ function reconcile(state, array, anchor, flags, get_key) {
542
554
  to_destroy.push(current);
543
555
  }
544
556
 
545
- current = current.next;
557
+ current = skip_to_branch(current.next);
546
558
  }
547
559
 
548
560
  var destroy_length = to_destroy.length;
package/src/version.js CHANGED
@@ -4,5 +4,5 @@
4
4
  * The current version, as set in package.json.
5
5
  * @type {string}
6
6
  */
7
- export const VERSION = '5.48.4';
7
+ export const VERSION = '5.48.5';
8
8
  export const PUBLIC_VERSION = '5';
package/types/index.d.ts CHANGED
@@ -3345,6 +3345,9 @@ declare namespace $state {
3345
3345
  export const prototype: never;
3346
3346
  /** @deprecated */
3347
3347
  export const toString: never;
3348
+
3349
+ // needed to keep private stuff private
3350
+ export {};
3348
3351
  }
3349
3352
 
3350
3353
  /**
@@ -3402,6 +3405,9 @@ declare namespace $derived {
3402
3405
  export const prototype: never;
3403
3406
  /** @deprecated */
3404
3407
  export const toString: never;
3408
+
3409
+ // needed to keep private stuff private
3410
+ export {};
3405
3411
  }
3406
3412
 
3407
3413
  /**
@@ -3518,6 +3524,9 @@ declare namespace $effect {
3518
3524
  export const prototype: never;
3519
3525
  /** @deprecated */
3520
3526
  export const toString: never;
3527
+
3528
+ // needed to keep private stuff private
3529
+ export {};
3521
3530
  }
3522
3531
 
3523
3532
  /**
@@ -3561,6 +3570,9 @@ declare namespace $props {
3561
3570
  export const prototype: never;
3562
3571
  /** @deprecated */
3563
3572
  export const toString: never;
3573
+
3574
+ // needed to keep private stuff private
3575
+ export {};
3564
3576
  }
3565
3577
 
3566
3578
  /**
@@ -3595,6 +3607,9 @@ declare namespace $bindable {
3595
3607
  export const prototype: never;
3596
3608
  /** @deprecated */
3597
3609
  export const toString: never;
3610
+
3611
+ // needed to keep private stuff private
3612
+ export {};
3598
3613
  }
3599
3614
 
3600
3615
  /**
@@ -3657,6 +3672,9 @@ declare namespace $inspect {
3657
3672
  export const prototype: never;
3658
3673
  /** @deprecated */
3659
3674
  export const toString: never;
3675
+
3676
+ // needed to keep private stuff private
3677
+ export {};
3660
3678
  }
3661
3679
 
3662
3680
  /**
@@ -3701,6 +3719,9 @@ declare namespace $host {
3701
3719
  export const prototype: never;
3702
3720
  /** @deprecated */
3703
3721
  export const toString: never;
3722
+
3723
+ // needed to keep private stuff private
3724
+ export {};
3704
3725
  }
3705
3726
 
3706
3727
  //# sourceMappingURL=index.d.ts.map