svelte 5.45.3 → 5.45.4
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 +2 -2
- package/src/compiler/phases/2-analyze/index.js +5 -0
- package/src/internal/client/dev/debug.js +4 -4
- package/src/internal/client/dom/blocks/each.js +24 -44
- package/src/internal/client/dom/blocks/html.js +3 -3
- package/src/internal/client/dom/blocks/svelte-element.js +8 -11
- package/src/internal/client/dom/elements/transitions.js +15 -7
- package/src/internal/client/dom/template.js +12 -10
- package/src/internal/client/reactivity/async.js +1 -6
- package/src/internal/client/reactivity/batch.js +1 -1
- package/src/internal/client/reactivity/effects.js +20 -16
- package/src/internal/client/render.js +2 -2
- package/src/internal/client/runtime.js +1 -1
- package/src/version.js +1 -1
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -1
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.45.
|
|
5
|
+
"version": "5.45.4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./types/index.d.ts",
|
|
8
8
|
"engines": {
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"clsx": "^2.1.1",
|
|
166
166
|
"devalue": "^5.5.0",
|
|
167
167
|
"esm-env": "^1.2.1",
|
|
168
|
-
"esrap": "^2.2.
|
|
168
|
+
"esrap": "^2.2.1",
|
|
169
169
|
"is-reference": "^3.0.3",
|
|
170
170
|
"locate-character": "^3.0.0",
|
|
171
171
|
"magic-string": "^0.30.11",
|
|
@@ -1105,6 +1105,11 @@ function calculate_blockers(instance, scopes, analysis) {
|
|
|
1105
1105
|
functions.push(node);
|
|
1106
1106
|
} else if (node.type === 'VariableDeclaration') {
|
|
1107
1107
|
for (const declarator of node.declarations) {
|
|
1108
|
+
if (get_rune(declarator.init, instance.scope) === '$props.id') {
|
|
1109
|
+
// special case
|
|
1110
|
+
continue;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1108
1113
|
if (
|
|
1109
1114
|
declarator.init?.type === 'ArrowFunctionExpression' ||
|
|
1110
1115
|
declarator.init?.type === 'FunctionExpression'
|
|
@@ -110,13 +110,13 @@ export function log_effect_tree(effect, depth = 0) {
|
|
|
110
110
|
console.groupEnd();
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
if (effect.
|
|
113
|
+
if (effect.nodes) {
|
|
114
114
|
// eslint-disable-next-line no-console
|
|
115
|
-
console.log(effect.
|
|
115
|
+
console.log(effect.nodes.start);
|
|
116
116
|
|
|
117
|
-
if (effect.
|
|
117
|
+
if (effect.nodes.start !== effect.nodes.end) {
|
|
118
118
|
// eslint-disable-next-line no-console
|
|
119
|
-
console.log(effect.
|
|
119
|
+
console.log(effect.nodes.end);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @import { EachItem, EachState, Effect, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */
|
|
1
|
+
/** @import { EachItem, EachState, Effect, EffectNodes, MaybeSource, Source, TemplateNode, TransitionManager, Value } from '#client' */
|
|
2
2
|
/** @import { Batch } from '../../reactivity/batch.js'; */
|
|
3
3
|
import {
|
|
4
4
|
EACH_INDEX_REACTIVE,
|
|
@@ -43,18 +43,6 @@ import { DEV } from 'esm-env';
|
|
|
43
43
|
import { derived_safe_equal } from '../../reactivity/deriveds.js';
|
|
44
44
|
import { current_batch } from '../../reactivity/batch.js';
|
|
45
45
|
|
|
46
|
-
/**
|
|
47
|
-
* The row of a keyed each block that is currently updating. We track this
|
|
48
|
-
* so that `animate:` directives have something to attach themselves to
|
|
49
|
-
* @type {EachItem | null}
|
|
50
|
-
*/
|
|
51
|
-
export let current_each_item = null;
|
|
52
|
-
|
|
53
|
-
/** @param {EachItem | null} item */
|
|
54
|
-
export function set_current_each_item(item) {
|
|
55
|
-
current_each_item = item;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
46
|
/**
|
|
59
47
|
* @param {any} _
|
|
60
48
|
* @param {number} i
|
|
@@ -243,8 +231,6 @@ export function each(node, flags, get_collection, get_key, render_fn, fallback_f
|
|
|
243
231
|
|
|
244
232
|
if (is_reactive_index) {
|
|
245
233
|
internal_set(/** @type {Value<number>} */ (item.i), i);
|
|
246
|
-
} else {
|
|
247
|
-
item.i = i;
|
|
248
234
|
}
|
|
249
235
|
|
|
250
236
|
if (defer) {
|
|
@@ -397,7 +383,7 @@ function reconcile(state, array, anchor, flags, get_key) {
|
|
|
397
383
|
// offscreen == coming in now, no animation in that case,
|
|
398
384
|
// else this would happen https://github.com/sveltejs/svelte/issues/17181
|
|
399
385
|
if (item.o) {
|
|
400
|
-
item.a?.measure();
|
|
386
|
+
item.e.nodes?.a?.measure();
|
|
401
387
|
(to_animate ??= new Set()).add(item);
|
|
402
388
|
}
|
|
403
389
|
}
|
|
@@ -432,7 +418,7 @@ function reconcile(state, array, anchor, flags, get_key) {
|
|
|
432
418
|
if ((item.e.f & INERT) !== 0) {
|
|
433
419
|
resume_effect(item.e);
|
|
434
420
|
if (is_animated) {
|
|
435
|
-
item.a?.unfix();
|
|
421
|
+
item.e.nodes?.a?.unfix();
|
|
436
422
|
(to_animate ??= new Set()).delete(item);
|
|
437
423
|
}
|
|
438
424
|
}
|
|
@@ -485,7 +471,7 @@ function reconcile(state, array, anchor, flags, get_key) {
|
|
|
485
471
|
matched = [];
|
|
486
472
|
stashed = [];
|
|
487
473
|
|
|
488
|
-
while (current !== null && current
|
|
474
|
+
while (current !== null && current !== item) {
|
|
489
475
|
// If the each block isn't inert and an item has an effect that is already inert,
|
|
490
476
|
// skip over adding it to our seen Set as the item is already being handled
|
|
491
477
|
if ((current.e.f & INERT) === 0) {
|
|
@@ -529,11 +515,11 @@ function reconcile(state, array, anchor, flags, get_key) {
|
|
|
529
515
|
|
|
530
516
|
if (is_animated) {
|
|
531
517
|
for (i = 0; i < destroy_length; i += 1) {
|
|
532
|
-
to_destroy[i].a?.measure();
|
|
518
|
+
to_destroy[i].e.nodes?.a?.measure();
|
|
533
519
|
}
|
|
534
520
|
|
|
535
521
|
for (i = 0; i < destroy_length; i += 1) {
|
|
536
|
-
to_destroy[i].a?.fix();
|
|
522
|
+
to_destroy[i].e.nodes?.a?.fix();
|
|
537
523
|
}
|
|
538
524
|
}
|
|
539
525
|
|
|
@@ -557,7 +543,7 @@ function reconcile(state, array, anchor, flags, get_key) {
|
|
|
557
543
|
queue_micro_task(() => {
|
|
558
544
|
if (to_animate === undefined) return;
|
|
559
545
|
for (item of to_animate) {
|
|
560
|
-
item.a?.apply();
|
|
546
|
+
item.e.nodes?.a?.apply();
|
|
561
547
|
}
|
|
562
548
|
});
|
|
563
549
|
}
|
|
@@ -576,7 +562,6 @@ function reconcile(state, array, anchor, flags, get_key) {
|
|
|
576
562
|
* @returns {EachItem}
|
|
577
563
|
*/
|
|
578
564
|
function create_item(anchor, prev, value, key, index, render_fn, flags, get_collection) {
|
|
579
|
-
var previous_each_item = current_each_item;
|
|
580
565
|
var reactive = (flags & EACH_ITEM_REACTIVE) !== 0;
|
|
581
566
|
var mutable = (flags & EACH_ITEM_IMMUTABLE) === 0;
|
|
582
567
|
|
|
@@ -598,7 +583,6 @@ function create_item(anchor, prev, value, key, index, render_fn, flags, get_coll
|
|
|
598
583
|
i,
|
|
599
584
|
v,
|
|
600
585
|
k: key,
|
|
601
|
-
a: null,
|
|
602
586
|
// @ts-expect-error
|
|
603
587
|
e: null,
|
|
604
588
|
o: false,
|
|
@@ -606,27 +590,21 @@ function create_item(anchor, prev, value, key, index, render_fn, flags, get_coll
|
|
|
606
590
|
next: null
|
|
607
591
|
};
|
|
608
592
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
var fragment = document.createDocumentFragment();
|
|
614
|
-
fragment.append((anchor = create_text()));
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
item.e = branch(() => render_fn(/** @type {Node} */ (anchor), v, i, get_collection));
|
|
593
|
+
if (anchor === null) {
|
|
594
|
+
var fragment = document.createDocumentFragment();
|
|
595
|
+
fragment.append((anchor = create_text()));
|
|
596
|
+
}
|
|
618
597
|
|
|
619
|
-
|
|
620
|
-
// we only need to set `prev.next = item`, because
|
|
621
|
-
// `item.prev = prev` was set on initialization.
|
|
622
|
-
// the effects themselves are already linked
|
|
623
|
-
prev.next = item;
|
|
624
|
-
}
|
|
598
|
+
item.e = branch(() => render_fn(/** @type {Node} */ (anchor), v, i, get_collection));
|
|
625
599
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
600
|
+
if (prev !== null) {
|
|
601
|
+
// we only need to set `prev.next = item`, because
|
|
602
|
+
// `item.prev = prev` was set on initialization.
|
|
603
|
+
// the effects themselves are already linked
|
|
604
|
+
prev.next = item;
|
|
629
605
|
}
|
|
606
|
+
|
|
607
|
+
return item;
|
|
630
608
|
}
|
|
631
609
|
|
|
632
610
|
/**
|
|
@@ -635,10 +613,12 @@ function create_item(anchor, prev, value, key, index, render_fn, flags, get_coll
|
|
|
635
613
|
* @param {Text | Element | Comment} anchor
|
|
636
614
|
*/
|
|
637
615
|
function move(item, next, anchor) {
|
|
638
|
-
|
|
616
|
+
if (!item.e.nodes) return;
|
|
617
|
+
|
|
618
|
+
var end = item.next ? /** @type {EffectNodes} */ (item.next.e.nodes).start : anchor;
|
|
639
619
|
|
|
640
|
-
var dest = next ? /** @type {
|
|
641
|
-
var node = /** @type {TemplateNode} */ (item.e.
|
|
620
|
+
var dest = next ? /** @type {EffectNodes} */ (next.e.nodes).start : anchor;
|
|
621
|
+
var node = /** @type {TemplateNode} */ (item.e.nodes.start);
|
|
642
622
|
|
|
643
623
|
while (node !== null && node !== end) {
|
|
644
624
|
var next_node = /** @type {TemplateNode} */ (get_next_sibling(node));
|
|
@@ -54,9 +54,9 @@ export function html(node, get_value, svg = false, mathml = false, skip_warning
|
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
if (effect.
|
|
58
|
-
remove_effect_dom(effect.
|
|
59
|
-
effect.
|
|
57
|
+
if (effect.nodes !== null) {
|
|
58
|
+
remove_effect_dom(effect.nodes.start, /** @type {TemplateNode} */ (effect.nodes.end));
|
|
59
|
+
effect.nodes = null;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
if (value === '') return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @import { Effect, TemplateNode } from '#client' */
|
|
1
|
+
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
|
|
2
2
|
import { FILENAME, NAMESPACE_SVG } from '../../../../constants.js';
|
|
3
3
|
import {
|
|
4
4
|
hydrate_next,
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
import { create_text, get_first_child } from '../operations.js';
|
|
11
11
|
import { block, teardown } from '../../reactivity/effects.js';
|
|
12
12
|
import { set_should_intro } from '../../render.js';
|
|
13
|
-
import { current_each_item, set_current_each_item } from './each.js';
|
|
14
13
|
import { active_effect } from '../../runtime.js';
|
|
15
14
|
import { component_context, dev_stack } from '../../context.js';
|
|
16
15
|
import { DEV } from 'esm-env';
|
|
@@ -18,6 +17,7 @@ import { EFFECT_TRANSPARENT, ELEMENT_NODE } from '#client/constants';
|
|
|
18
17
|
import { assign_nodes } from '../template.js';
|
|
19
18
|
import { is_raw_text_element } from '../../../../utils.js';
|
|
20
19
|
import { BranchManager } from './branches.js';
|
|
20
|
+
import { set_animation_effect_override } from '../elements/transitions.js';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @param {Comment | Element} node
|
|
@@ -48,11 +48,10 @@ export function element(node, get_tag, is_svg, render_fn, get_namespace, locatio
|
|
|
48
48
|
var anchor = /** @type {TemplateNode} */ (hydrating ? hydrate_node : node);
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* The keyed `{#each ...}` item block, if any, that this element is inside.
|
|
52
51
|
* We track this so we can set it when changing the element, allowing any
|
|
53
52
|
* `animate:` directive to bind itself to the correct block
|
|
54
53
|
*/
|
|
55
|
-
var
|
|
54
|
+
var parent_effect = /** @type {Effect} */ (active_effect);
|
|
56
55
|
|
|
57
56
|
var branches = new BranchManager(anchor, false);
|
|
58
57
|
|
|
@@ -67,10 +66,6 @@ export function element(node, get_tag, is_svg, render_fn, get_namespace, locatio
|
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
branches.ensure(next_tag, (anchor) => {
|
|
70
|
-
// See explanation of `each_item_block` above
|
|
71
|
-
var previous_each_item = current_each_item;
|
|
72
|
-
set_current_each_item(each_item_block);
|
|
73
|
-
|
|
74
69
|
if (next_tag) {
|
|
75
70
|
element = hydrating
|
|
76
71
|
? /** @type {Element} */ (element)
|
|
@@ -112,21 +107,23 @@ export function element(node, get_tag, is_svg, render_fn, get_namespace, locatio
|
|
|
112
107
|
}
|
|
113
108
|
}
|
|
114
109
|
|
|
110
|
+
set_animation_effect_override(parent_effect);
|
|
111
|
+
|
|
115
112
|
// `child_anchor` is undefined if this is a void element, but we still
|
|
116
113
|
// need to call `render_fn` in order to run actions etc. If the element
|
|
117
114
|
// contains children, it's a user error (which is warned on elsewhere)
|
|
118
115
|
// and the DOM will be silently discarded
|
|
119
116
|
render_fn(element, child_anchor);
|
|
117
|
+
|
|
118
|
+
set_animation_effect_override(null);
|
|
120
119
|
}
|
|
121
120
|
|
|
122
121
|
// we do this after calling `render_fn` so that child effects don't override `nodes.end`
|
|
123
|
-
/** @type {Effect} */ (active_effect).
|
|
122
|
+
/** @type {Effect & { nodes: EffectNodes }} */ (active_effect).nodes.end = element;
|
|
124
123
|
|
|
125
124
|
anchor.before(element);
|
|
126
125
|
}
|
|
127
126
|
|
|
128
|
-
set_current_each_item(previous_each_item);
|
|
129
|
-
|
|
130
127
|
if (hydrating) {
|
|
131
128
|
set_hydrate_node(anchor);
|
|
132
129
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/** @import { AnimateFn, Animation, AnimationConfig, EachItem, Effect, TransitionFn, TransitionManager } from '#client' */
|
|
1
|
+
/** @import { AnimateFn, Animation, AnimationConfig, EachItem, Effect, EffectNodes, TransitionFn, TransitionManager } from '#client' */
|
|
2
2
|
import { noop, is_function } from '../../../shared/utils.js';
|
|
3
3
|
import { effect } from '../../reactivity/effects.js';
|
|
4
4
|
import { active_effect, untrack } from '../../runtime.js';
|
|
5
5
|
import { loop } from '../../loop.js';
|
|
6
6
|
import { should_intro } from '../../render.js';
|
|
7
|
-
import { current_each_item } from '../blocks/each.js';
|
|
8
7
|
import { TRANSITION_GLOBAL, TRANSITION_IN, TRANSITION_OUT } from '../../../../constants.js';
|
|
9
8
|
import { BLOCK_EFFECT, EFFECT_RAN, EFFECT_TRANSPARENT } from '#client/constants';
|
|
10
9
|
import { queue_micro_task } from '../task.js';
|
|
@@ -66,6 +65,14 @@ function css_to_keyframe(css) {
|
|
|
66
65
|
/** @param {number} t */
|
|
67
66
|
const linear = (t) => t;
|
|
68
67
|
|
|
68
|
+
/** @type {Effect | null} */
|
|
69
|
+
let animation_effect_override = null;
|
|
70
|
+
|
|
71
|
+
/** @param {Effect | null} v */
|
|
72
|
+
export function set_animation_effect_override(v) {
|
|
73
|
+
animation_effect_override = v;
|
|
74
|
+
}
|
|
75
|
+
|
|
69
76
|
/**
|
|
70
77
|
* Called inside keyed `{#each ...}` blocks (as `$.animation(...)`). This creates an animation manager
|
|
71
78
|
* and attaches it to the block, so that moves can be animated following reconciliation.
|
|
@@ -75,7 +82,8 @@ const linear = (t) => t;
|
|
|
75
82
|
* @param {(() => P) | null} get_params
|
|
76
83
|
*/
|
|
77
84
|
export function animation(element, get_fn, get_params) {
|
|
78
|
-
var
|
|
85
|
+
var effect = animation_effect_override ?? /** @type {Effect} */ (active_effect);
|
|
86
|
+
var nodes = /** @type {EffectNodes} */ (effect.nodes);
|
|
79
87
|
|
|
80
88
|
/** @type {DOMRect} */
|
|
81
89
|
var from;
|
|
@@ -89,7 +97,7 @@ export function animation(element, get_fn, get_params) {
|
|
|
89
97
|
/** @type {null | { position: string, width: string, height: string, transform: string }} */
|
|
90
98
|
var original_styles = null;
|
|
91
99
|
|
|
92
|
-
|
|
100
|
+
nodes.a ??= {
|
|
93
101
|
element,
|
|
94
102
|
measure() {
|
|
95
103
|
from = this.element.getBoundingClientRect();
|
|
@@ -161,7 +169,7 @@ export function animation(element, get_fn, get_params) {
|
|
|
161
169
|
// when an animation manager already exists, if the tag changes. in that case, we need to
|
|
162
170
|
// swap out the element rather than creating a new manager, in case it happened at the same
|
|
163
171
|
// moment as a reconciliation
|
|
164
|
-
|
|
172
|
+
nodes.a.element = element;
|
|
165
173
|
}
|
|
166
174
|
|
|
167
175
|
/**
|
|
@@ -265,9 +273,9 @@ export function transition(flags, element, get_fn, get_params) {
|
|
|
265
273
|
}
|
|
266
274
|
};
|
|
267
275
|
|
|
268
|
-
var e = /** @type {Effect} */ (active_effect);
|
|
276
|
+
var e = /** @type {Effect & { nodes: EffectNodes }} */ (active_effect);
|
|
269
277
|
|
|
270
|
-
(e.
|
|
278
|
+
(e.nodes.t ??= []).push(transition);
|
|
271
279
|
|
|
272
280
|
// if this is a local transition, we only want to run it if the parent (branch) effect's
|
|
273
281
|
// parent (block) effect is where the state change happened. we can determine that by
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @import { Effect, TemplateNode } from '#client' */
|
|
1
|
+
/** @import { Effect, EffectNodes, TemplateNode } from '#client' */
|
|
2
2
|
/** @import { TemplateStructure } from './types' */
|
|
3
3
|
import { hydrate_next, hydrate_node, hydrating, set_hydrate_node } from './hydration.js';
|
|
4
4
|
import {
|
|
@@ -28,9 +28,8 @@ import { COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, EFFECT_RAN, TEXT_NODE } from '#cl
|
|
|
28
28
|
*/
|
|
29
29
|
export function assign_nodes(start, end) {
|
|
30
30
|
var effect = /** @type {Effect} */ (active_effect);
|
|
31
|
-
if (effect.
|
|
32
|
-
effect.
|
|
33
|
-
effect.nodes_end = end;
|
|
31
|
+
if (effect.nodes === null) {
|
|
32
|
+
effect.nodes = { start, end, a: null, t: null };
|
|
34
33
|
}
|
|
35
34
|
}
|
|
36
35
|
|
|
@@ -270,7 +269,8 @@ function run_scripts(node) {
|
|
|
270
269
|
/** @type {HTMLElement} */ (node).tagName === 'SCRIPT'
|
|
271
270
|
? [/** @type {HTMLScriptElement} */ (node)]
|
|
272
271
|
: node.querySelectorAll('script');
|
|
273
|
-
|
|
272
|
+
|
|
273
|
+
const effect = /** @type {Effect & { nodes: EffectNodes }} */ (active_effect);
|
|
274
274
|
|
|
275
275
|
for (const script of scripts) {
|
|
276
276
|
const clone = document.createElement('script');
|
|
@@ -282,10 +282,10 @@ function run_scripts(node) {
|
|
|
282
282
|
|
|
283
283
|
// The script has changed - if it's at the edges, the effect now points at dead nodes
|
|
284
284
|
if (is_fragment ? node.firstChild === script : node === script) {
|
|
285
|
-
effect.
|
|
285
|
+
effect.nodes.start = clone;
|
|
286
286
|
}
|
|
287
287
|
if (is_fragment ? node.lastChild === script : node === script) {
|
|
288
|
-
effect.
|
|
288
|
+
effect.nodes.end = clone;
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
script.replaceWith(clone);
|
|
@@ -344,13 +344,15 @@ export function comment() {
|
|
|
344
344
|
*/
|
|
345
345
|
export function append(anchor, dom) {
|
|
346
346
|
if (hydrating) {
|
|
347
|
-
var effect = /** @type {Effect} */ (active_effect);
|
|
347
|
+
var effect = /** @type {Effect & { nodes: EffectNodes }} */ (active_effect);
|
|
348
|
+
|
|
348
349
|
// When hydrating and outer component and an inner component is async, i.e. blocked on a promise,
|
|
349
350
|
// then by the time the inner resolves we have already advanced to the end of the hydrated nodes
|
|
350
351
|
// of the parent component. Check for defined for that reason to avoid rewinding the parent's end marker.
|
|
351
|
-
if ((effect.f & EFFECT_RAN) === 0 || effect.
|
|
352
|
-
effect.
|
|
352
|
+
if ((effect.f & EFFECT_RAN) === 0 || effect.nodes.end === null) {
|
|
353
|
+
effect.nodes.end = hydrate_node;
|
|
353
354
|
}
|
|
355
|
+
|
|
354
356
|
hydrate_next();
|
|
355
357
|
return;
|
|
356
358
|
}
|
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
} from './deriveds.js';
|
|
27
27
|
import { aborted } from './effects.js';
|
|
28
28
|
import { hydrate_next, hydrating, set_hydrate_node, skip_nodes } from '../dom/hydration.js';
|
|
29
|
-
import { current_each_item, set_current_each_item } from '../dom/blocks/each.js';
|
|
30
29
|
|
|
31
30
|
/**
|
|
32
31
|
* @param {Array<Promise<void>>} blockers
|
|
@@ -90,11 +89,7 @@ export function flatten(blockers, sync, async, fn) {
|
|
|
90
89
|
* @param {(values: Value[]) => any} fn
|
|
91
90
|
*/
|
|
92
91
|
export function run_after_blockers(blockers, fn) {
|
|
93
|
-
|
|
94
|
-
flatten(blockers, [], [], (v) => {
|
|
95
|
-
set_current_each_item(each_item);
|
|
96
|
-
fn(v);
|
|
97
|
-
});
|
|
92
|
+
flatten(blockers, [], [], fn);
|
|
98
93
|
}
|
|
99
94
|
|
|
100
95
|
/**
|
|
@@ -708,7 +708,7 @@ function flush_queued_effects(effects) {
|
|
|
708
708
|
// don't know if we need to keep them until they are executed. Doing the check
|
|
709
709
|
// here (rather than in `update_effect`) allows us to skip the work for
|
|
710
710
|
// immediate effects.
|
|
711
|
-
if (effect.deps === null && effect.first === null && effect.
|
|
711
|
+
if (effect.deps === null && effect.first === null && effect.nodes === null) {
|
|
712
712
|
// if there's no teardown or abort controller we completely unlink
|
|
713
713
|
// the effect from the graph
|
|
714
714
|
if (effect.teardown === null && effect.ac === null) {
|
|
@@ -101,8 +101,7 @@ function create_effect(type, fn, sync) {
|
|
|
101
101
|
var effect = {
|
|
102
102
|
ctx: component_context,
|
|
103
103
|
deps: null,
|
|
104
|
-
|
|
105
|
-
nodes_end: null,
|
|
104
|
+
nodes: null,
|
|
106
105
|
f: type | DIRTY | CONNECTED,
|
|
107
106
|
first: null,
|
|
108
107
|
fn,
|
|
@@ -112,7 +111,6 @@ function create_effect(type, fn, sync) {
|
|
|
112
111
|
b: parent && parent.b,
|
|
113
112
|
prev: null,
|
|
114
113
|
teardown: null,
|
|
115
|
-
transitions: null,
|
|
116
114
|
wv: 0,
|
|
117
115
|
ac: null
|
|
118
116
|
};
|
|
@@ -143,7 +141,7 @@ function create_effect(type, fn, sync) {
|
|
|
143
141
|
sync &&
|
|
144
142
|
e.deps === null &&
|
|
145
143
|
e.teardown === null &&
|
|
146
|
-
e.
|
|
144
|
+
e.nodes === null &&
|
|
147
145
|
e.first === e.last && // either `null`, or a singular child
|
|
148
146
|
(e.f & EFFECT_PRESERVED) === 0
|
|
149
147
|
) {
|
|
@@ -497,10 +495,10 @@ export function destroy_effect(effect, remove_dom = true) {
|
|
|
497
495
|
|
|
498
496
|
if (
|
|
499
497
|
(remove_dom || (effect.f & HEAD_EFFECT) !== 0) &&
|
|
500
|
-
effect.
|
|
501
|
-
effect.
|
|
498
|
+
effect.nodes !== null &&
|
|
499
|
+
effect.nodes.end !== null
|
|
502
500
|
) {
|
|
503
|
-
remove_effect_dom(effect.
|
|
501
|
+
remove_effect_dom(effect.nodes.start, /** @type {TemplateNode} */ (effect.nodes.end));
|
|
504
502
|
removed = true;
|
|
505
503
|
}
|
|
506
504
|
|
|
@@ -508,7 +506,7 @@ export function destroy_effect(effect, remove_dom = true) {
|
|
|
508
506
|
remove_reactions(effect, 0);
|
|
509
507
|
set_signal_status(effect, DESTROYED);
|
|
510
508
|
|
|
511
|
-
var transitions = effect.
|
|
509
|
+
var transitions = effect.nodes && effect.nodes.t;
|
|
512
510
|
|
|
513
511
|
if (transitions !== null) {
|
|
514
512
|
for (const transition of transitions) {
|
|
@@ -537,8 +535,7 @@ export function destroy_effect(effect, remove_dom = true) {
|
|
|
537
535
|
effect.ctx =
|
|
538
536
|
effect.deps =
|
|
539
537
|
effect.fn =
|
|
540
|
-
effect.
|
|
541
|
-
effect.nodes_end =
|
|
538
|
+
effect.nodes =
|
|
542
539
|
effect.ac =
|
|
543
540
|
null;
|
|
544
541
|
}
|
|
@@ -624,8 +621,10 @@ export function pause_children(effect, transitions, local) {
|
|
|
624
621
|
if ((effect.f & INERT) !== 0) return;
|
|
625
622
|
effect.f ^= INERT;
|
|
626
623
|
|
|
627
|
-
|
|
628
|
-
|
|
624
|
+
var t = effect.nodes && effect.nodes.t;
|
|
625
|
+
|
|
626
|
+
if (t !== null) {
|
|
627
|
+
for (const transition of t) {
|
|
629
628
|
if (transition.is_global || local) {
|
|
630
629
|
transitions.push(transition);
|
|
631
630
|
}
|
|
@@ -688,8 +687,10 @@ function resume_children(effect, local) {
|
|
|
688
687
|
child = sibling;
|
|
689
688
|
}
|
|
690
689
|
|
|
691
|
-
|
|
692
|
-
|
|
690
|
+
var t = effect.nodes && effect.nodes.t;
|
|
691
|
+
|
|
692
|
+
if (t !== null) {
|
|
693
|
+
for (const transition of t) {
|
|
693
694
|
if (transition.is_global || local) {
|
|
694
695
|
transition.in();
|
|
695
696
|
}
|
|
@@ -706,8 +707,11 @@ export function aborted(effect = /** @type {Effect} */ (active_effect)) {
|
|
|
706
707
|
* @param {DocumentFragment} fragment
|
|
707
708
|
*/
|
|
708
709
|
export function move_effect(effect, fragment) {
|
|
709
|
-
|
|
710
|
-
|
|
710
|
+
if (!effect.nodes) return;
|
|
711
|
+
|
|
712
|
+
/** @type {TemplateNode | null} */
|
|
713
|
+
var node = effect.nodes.start;
|
|
714
|
+
var end = effect.nodes.end;
|
|
711
715
|
|
|
712
716
|
while (node !== null) {
|
|
713
717
|
/** @type {TemplateNode | null} */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @import { ComponentContext, Effect, TemplateNode } from '#client' */
|
|
1
|
+
/** @import { ComponentContext, Effect, EffectNodes, TemplateNode } from '#client' */
|
|
2
2
|
/** @import { Component, ComponentType, SvelteComponent, MountOptions } from '../../index.js' */
|
|
3
3
|
import { DEV } from 'esm-env';
|
|
4
4
|
import {
|
|
@@ -228,7 +228,7 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
|
|
|
228
228
|
should_intro = true;
|
|
229
229
|
|
|
230
230
|
if (hydrating) {
|
|
231
|
-
/** @type {Effect} */ (active_effect).
|
|
231
|
+
/** @type {Effect & { nodes: EffectNodes }} */ (active_effect).nodes.end = hydrate_node;
|
|
232
232
|
|
|
233
233
|
if (
|
|
234
234
|
hydrate_node === null ||
|
|
@@ -278,7 +278,7 @@ export function update_reaction(reaction) {
|
|
|
278
278
|
reaction.deps = deps = new_deps;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
if (
|
|
281
|
+
if (effect_tracking() && (reaction.f & CONNECTED) !== 0) {
|
|
282
282
|
for (i = skipped_deps; i < deps.length; i++) {
|
|
283
283
|
(deps[i].reactions ??= []).push(reaction);
|
|
284
284
|
}
|
package/src/version.js
CHANGED
package/types/index.d.ts
CHANGED
package/types/index.d.ts.map
CHANGED
|
@@ -272,6 +272,6 @@
|
|
|
272
272
|
null,
|
|
273
273
|
null
|
|
274
274
|
],
|
|
275
|
-
"mappings": "
|
|
275
|
+
"mappings": ";;;;;;;;;kBAUiBA,2BAA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkC/BC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAwEhBC,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;;kBAwBbC,SAASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoCbC,oBAAoBA;;;;;;;;;;;;;;;;;;;;;;;;aAwBrBC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiCfC,cAAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA6BdC,aAAaA;;;;;;;;;;;;;;;;;;;;;;;kBAuBRC,OAAOA;;;;;;;;;;;;;;;;kBA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