@solidjs/signals 2.0.0-beta.25 → 2.0.0-beta.26
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/dist/dev.js +113 -7
- package/dist/node.cjs +140 -41
- package/dist/prod/core/async.js +180 -107
- package/dist/prod/core/core.js +162 -162
- package/dist/prod/core/effect.js +28 -28
- package/dist/prod/core/external.js +4 -4
- package/dist/prod/core/graph.js +28 -28
- package/dist/prod/core/heap.js +30 -30
- package/dist/prod/core/lanes.js +15 -15
- package/dist/prod/core/optimistic.js +38 -38
- package/dist/prod/core/owner.js +44 -44
- package/dist/prod/core/scheduler.js +94 -94
- package/dist/prod/core/verdict.js +55 -55
- package/dist/prod/map.js +60 -60
- package/dist/prod/signals.js +1 -1
- package/dist/prod/store/optimistic.js +6 -6
- package/dist/prod/store/reconcile.js +1 -1
- package/dist/prod/store/store.js +58 -32
- package/dist/types/core/async.d.ts +1 -0
- package/dist/types-cjs/core/async.d.cts +1 -0
- package/package.json +1 -1
package/dist/prod/core/effect.js
CHANGED
|
@@ -14,7 +14,7 @@ import { GlobalQueue, haltReactivity } from "./scheduler.js";
|
|
|
14
14
|
const r = !!R?.user;
|
|
15
15
|
const f = createEffectNode(t, E, e, r ? EFFECT_USER : EFFECT_RENDER, notifyEffectStatus, R);
|
|
16
16
|
recompute(f, true);
|
|
17
|
-
!R?.defer && (f.
|
|
17
|
+
!R?.defer && (f.Pe === EFFECT_USER || R?.schedule ? f.C.enqueue(f.Pe, runEffect.bind(null, f)) : runEffect(f));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
function notifyEffectStatus(t, E) {
|
|
@@ -23,7 +23,7 @@ function notifyEffectStatus(t, E) {
|
|
|
23
23
|
const R = E !== undefined ? E : this._;
|
|
24
24
|
if (e & STATUS_ERROR) {
|
|
25
25
|
this.C.notify(this, STATUS_PENDING, 0);
|
|
26
|
-
if (this.
|
|
26
|
+
if (this.Pe === EFFECT_USER) {
|
|
27
27
|
// The error handler is the error arm of the effect phase (#2840 ruling):
|
|
28
28
|
// queue it like the effect function. It runs in the same imperative,
|
|
29
29
|
// writable scope, throws escalate the same way, and a held transition
|
|
@@ -34,8 +34,8 @@ function notifyEffectStatus(t, E) {
|
|
|
34
34
|
// `status` arg without node-state writes) don't queue: the status
|
|
35
35
|
// re-propagates unblocked at commit.
|
|
36
36
|
if (this.S & STATUS_ERROR) {
|
|
37
|
-
this
|
|
38
|
-
this.C.enqueue(this.
|
|
37
|
+
this.Be = true;
|
|
38
|
+
this.C.enqueue(this.Pe, this.Je ??= runEffect.bind(null, this));
|
|
39
39
|
}
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
@@ -43,13 +43,13 @@ function notifyEffectStatus(t, E) {
|
|
|
43
43
|
haltReactivity(unwrapStatusError(R));
|
|
44
44
|
throw R;
|
|
45
45
|
}
|
|
46
|
-
} else if (this.
|
|
46
|
+
} else if (this.Pe === EFFECT_RENDER) {
|
|
47
47
|
this.C.notify(this, STATUS_PENDING | STATUS_ERROR, e, R);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
function runEffect(t) {
|
|
52
|
-
if (!t
|
|
52
|
+
if (!t.Be || t.se & REACTIVE_DISPOSED) return;
|
|
53
53
|
// Error arm (#2840), user effects only: a compute-phase error that is still
|
|
54
54
|
// the node's settled state at effect time runs the bundle's error handler in
|
|
55
55
|
// this same imperative, writable scope. Unwrap the StatusError used for
|
|
@@ -60,14 +60,14 @@ function runEffect(t) {
|
|
|
60
60
|
// Render effects bypass: their errors route to boundaries synchronously in
|
|
61
61
|
// notifyEffectStatus, and a runner queued by an earlier valueChanged in the
|
|
62
62
|
// same flush must not be hijacked by a later-arriving error status.
|
|
63
|
-
if (t.S & STATUS_ERROR && t.
|
|
63
|
+
if (t.S & STATUS_ERROR && t.Pe === EFFECT_USER) {
|
|
64
64
|
const E = unwrapStatusError(t._);
|
|
65
|
-
t.
|
|
66
|
-
t
|
|
65
|
+
t.ct = t.Ue;
|
|
66
|
+
t.Be = false;
|
|
67
67
|
try {
|
|
68
|
-
t.
|
|
69
|
-
const E = t.
|
|
70
|
-
t.
|
|
68
|
+
t.ft ? t.ft(E, () => {
|
|
69
|
+
const E = t.Et;
|
|
70
|
+
t.Et = undefined;
|
|
71
71
|
E?.();
|
|
72
72
|
}) : console.error(E);
|
|
73
73
|
} catch (E) {
|
|
@@ -78,14 +78,14 @@ function runEffect(t) {
|
|
|
78
78
|
}
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const E = t.
|
|
82
|
-
t.
|
|
81
|
+
const E = t.Et;
|
|
82
|
+
t.Et = undefined;
|
|
83
83
|
try {
|
|
84
84
|
E?.();
|
|
85
|
-
const e = t.
|
|
85
|
+
const e = t._t(t.Ue, t.ct);
|
|
86
86
|
if (false && e !== undefined && typeof e !== "function") ;
|
|
87
87
|
// The final cleanup is invoked by disposeChildren at true disposal.
|
|
88
|
-
t.
|
|
88
|
+
t.Et = e;
|
|
89
89
|
} catch (E) {
|
|
90
90
|
t._ = new StatusError(t, E);
|
|
91
91
|
t.S |= STATUS_ERROR;
|
|
@@ -94,12 +94,12 @@ function runEffect(t) {
|
|
|
94
94
|
throw E;
|
|
95
95
|
}
|
|
96
96
|
} finally {
|
|
97
|
-
t.
|
|
98
|
-
t
|
|
97
|
+
t.ct = t.Ue;
|
|
98
|
+
t.Be = false;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
GlobalQueue.
|
|
102
|
+
GlobalQueue.Xe = runEffect;
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
105
|
* Internal tracked effect - bypasses heap, goes directly to effect queue.
|
|
@@ -107,26 +107,26 @@ GlobalQueue.Je = runEffect;
|
|
|
107
107
|
* Uses stale reads.
|
|
108
108
|
*/ function trackedEffect(t, E) {
|
|
109
109
|
const run = () => {
|
|
110
|
-
if (!e
|
|
110
|
+
if (!e.Be || e.se & REACTIVE_DISPOSED) return;
|
|
111
111
|
try {
|
|
112
|
-
e
|
|
112
|
+
e.Be = false;
|
|
113
113
|
recompute(e);
|
|
114
114
|
} finally {}
|
|
115
115
|
};
|
|
116
116
|
const e = computed(() => {
|
|
117
|
-
const E = e.
|
|
118
|
-
e.
|
|
117
|
+
const E = e.Et;
|
|
118
|
+
e.Et = undefined;
|
|
119
119
|
E?.();
|
|
120
120
|
const R = staleValues(t);
|
|
121
|
-
e.
|
|
121
|
+
e.Et = R;
|
|
122
122
|
}, {
|
|
123
123
|
...E,
|
|
124
124
|
lazy: true
|
|
125
125
|
});
|
|
126
|
-
e.
|
|
126
|
+
e.Et = undefined;
|
|
127
127
|
e.T = e.T & ~CONFIG_AUTO_DISPOSE | CONFIG_CHILDREN_FORBIDDEN;
|
|
128
|
-
e
|
|
129
|
-
e.
|
|
128
|
+
e.Be = true;
|
|
129
|
+
e.Pe = EFFECT_TRACKED;
|
|
130
130
|
e.i = (t, E) => {
|
|
131
131
|
const R = t !== undefined ? t : e.S;
|
|
132
132
|
if (R & STATUS_ERROR) {
|
|
@@ -138,7 +138,7 @@ GlobalQueue.Je = runEffect;
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
|
-
e.
|
|
141
|
+
e.Ft = run;
|
|
142
142
|
e.C.enqueue(EFFECT_USER, run);
|
|
143
143
|
}
|
|
144
144
|
|
|
@@ -46,11 +46,11 @@ function wireExternalSource(e) {
|
|
|
46
46
|
equals: false,
|
|
47
47
|
ownedWrite: true
|
|
48
48
|
});
|
|
49
|
-
const r = externalSourceConfig.factory(e.
|
|
49
|
+
const r = externalSourceConfig.factory(e.ae, () => {
|
|
50
50
|
setSignal(n, undefined);
|
|
51
51
|
});
|
|
52
52
|
cleanup(() => r.dispose());
|
|
53
|
-
e.
|
|
53
|
+
e.ae = e => {
|
|
54
54
|
read(n);
|
|
55
55
|
return r.track(e);
|
|
56
56
|
};
|
|
@@ -64,8 +64,8 @@ function externalUntrack(e) {
|
|
|
64
64
|
// removed on reset) so core's null checks stay equivalent to the old
|
|
65
65
|
// `externalSourceConfig` truthiness checks.
|
|
66
66
|
function syncExternalHooks() {
|
|
67
|
-
GlobalQueue.
|
|
68
|
-
GlobalQueue.
|
|
67
|
+
GlobalQueue.It = externalSourceConfig ? wireExternalSource : null;
|
|
68
|
+
GlobalQueue.dt = externalSourceConfig ? externalUntrack : null;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function enableExternalSource(e) {
|
package/dist/prod/core/graph.js
CHANGED
|
@@ -8,15 +8,15 @@ import "./scheduler.js";
|
|
|
8
8
|
|
|
9
9
|
// https://github.com/stackblitz/alien-signals/blob/v2.0.3/src/system.ts#L100
|
|
10
10
|
function unlinkSubs(l) {
|
|
11
|
-
const n = l.
|
|
12
|
-
const e = l.
|
|
11
|
+
const n = l.nt;
|
|
12
|
+
const e = l.tt;
|
|
13
13
|
const u = l.ue;
|
|
14
14
|
const s = l.ll;
|
|
15
|
-
if (u !== null) u.ll = s; else n.
|
|
15
|
+
if (u !== null) u.ll = s; else n.st = s;
|
|
16
16
|
if (s !== null) s.ue = u; else {
|
|
17
17
|
n.o = u;
|
|
18
18
|
if (u === null) {
|
|
19
|
-
n.
|
|
19
|
+
n.ut?.();
|
|
20
20
|
// No more subscribers; only tear down if CONFIG_AUTO_DISPOSE is set.
|
|
21
21
|
// A pending node is exempt: its in-flight async work (or the
|
|
22
22
|
// transition holding it) is an observer — tearing down would orphan
|
|
@@ -24,31 +24,31 @@ function unlinkSubs(l) {
|
|
|
24
24
|
// this same last-one-out check when that observer releases (the
|
|
25
25
|
// untracked-read dispose in core.ts guards on pending identically).
|
|
26
26
|
const l = n;
|
|
27
|
-
l.
|
|
27
|
+
l.ae && l.T & CONFIG_AUTO_DISPOSE && !(l.se & REACTIVE_ZOMBIE) && !(l.S & STATUS_PENDING) && unobserved(l);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
return e;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
function trimStaleDeps(l) {
|
|
34
|
-
const n = l.
|
|
35
|
-
let e = n !== null ? n.
|
|
34
|
+
const n = l.We;
|
|
35
|
+
let e = n !== null ? n.tt : l.et;
|
|
36
36
|
if (e !== null) {
|
|
37
37
|
do {
|
|
38
38
|
e = unlinkSubs(e);
|
|
39
39
|
} while (e !== null);
|
|
40
|
-
if (n !== null) n.
|
|
40
|
+
if (n !== null) n.tt = null; else l.et = null;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
function unobserved(l) {
|
|
45
45
|
deleteFromHeap(l, queueFor(l));
|
|
46
|
-
let n = l.
|
|
46
|
+
let n = l.et;
|
|
47
47
|
while (n !== null) {
|
|
48
48
|
n = unlinkSubs(n);
|
|
49
49
|
}
|
|
50
|
-
l.
|
|
51
|
-
l.
|
|
50
|
+
l.et = null;
|
|
51
|
+
l.We = null;
|
|
52
52
|
disposeChildren(l, true);
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -59,20 +59,20 @@ function link(l, n, e = false) {
|
|
|
59
59
|
// not relabel the value dependency as probe-only — the value read is what
|
|
60
60
|
// real-error propagation and affects() coverage key off, regardless of
|
|
61
61
|
// read order within the computation.
|
|
62
|
-
const u = n.
|
|
63
|
-
if (u !== null && u.
|
|
64
|
-
u.
|
|
62
|
+
const u = n.We;
|
|
63
|
+
if (u !== null && u.nt === l) {
|
|
64
|
+
u.ge &&= e;
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
let s = null;
|
|
68
68
|
const t = n.se & REACTIVE_RECOMPUTING_DEPS;
|
|
69
69
|
if (t) {
|
|
70
|
-
s = u !== null ? u.
|
|
71
|
-
if (s !== null && s.
|
|
72
|
-
s.nl = n.
|
|
73
|
-
n.
|
|
70
|
+
s = u !== null ? u.tt : n.et;
|
|
71
|
+
if (s !== null && s.nt === l) {
|
|
72
|
+
s.nl = n.Ye;
|
|
73
|
+
n.We = s;
|
|
74
74
|
// First touch of this pass: the previous pass's label is stale.
|
|
75
|
-
s.
|
|
75
|
+
s.ge = e;
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -81,23 +81,23 @@ function link(l, n, e = false) {
|
|
|
81
81
|
// [deps.._depsTail] prefix — the O(1) equivalent of scanning the dep list
|
|
82
82
|
// (the old alien-signals `isValidLink` walk, O(n²) when a computation
|
|
83
83
|
// re-reads earlier deps non-consecutively, e.g. store leaf reads).
|
|
84
|
-
const i = l.
|
|
85
|
-
if (i !== null && i.le === n && (!t || i.nl === n.
|
|
84
|
+
const i = l.st;
|
|
85
|
+
if (i !== null && i.le === n && (!t || i.nl === n.Ye)) {
|
|
86
86
|
// Gen-matched during a recompute = repeat touch this pass (AND); outside
|
|
87
87
|
// a recompute there is no pass boundary, so the latest read labels it.
|
|
88
|
-
if (t) i.
|
|
88
|
+
if (t) i.ge &&= e; else i.ge = e;
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
const o = n.
|
|
92
|
-
|
|
91
|
+
const o = n.We = l.st = {
|
|
92
|
+
nt: l,
|
|
93
93
|
le: n,
|
|
94
|
-
|
|
94
|
+
tt: s,
|
|
95
95
|
ll: i,
|
|
96
96
|
ue: null,
|
|
97
|
-
nl: n.
|
|
98
|
-
|
|
97
|
+
nl: n.Ye,
|
|
98
|
+
ge: e
|
|
99
99
|
};
|
|
100
|
-
if (u !== null) u.
|
|
100
|
+
if (u !== null) u.tt = o; else n.et = o;
|
|
101
101
|
if (i !== null) i.ue = o; else l.o = o;
|
|
102
102
|
}
|
|
103
103
|
|
package/dist/prod/core/heap.js
CHANGED
|
@@ -11,29 +11,29 @@ import { zombieQueue, dirtyQueue } from "./scheduler.js";
|
|
|
11
11
|
* the heap and go directly to their effect queue; everything else is inserted
|
|
12
12
|
* into its own (zombie-flag-routed) heap with the `_min` cursor pulled down.
|
|
13
13
|
*/ function enqueueSub(e) {
|
|
14
|
-
if (e.
|
|
14
|
+
if (e.Pe === EFFECT_TRACKED) {
|
|
15
15
|
const E = e;
|
|
16
|
-
if (!E
|
|
17
|
-
E
|
|
18
|
-
E.C.enqueue(EFFECT_USER, E.
|
|
16
|
+
if (!E.Be) {
|
|
17
|
+
E.Be = true;
|
|
18
|
+
E.C.enqueue(EFFECT_USER, E.Ft);
|
|
19
19
|
}
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const E = queueFor(e);
|
|
23
|
-
if (E.
|
|
23
|
+
if (E.He > e.Ve) E.He = e.Ve;
|
|
24
24
|
insertIntoHeap(e, E);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function actualInsertIntoHeap(e, E) {
|
|
28
|
-
const t = (e.
|
|
29
|
-
if (t >= e.
|
|
30
|
-
const n = e.
|
|
28
|
+
const t = (e.ve?.Nt ? e.ve.Tt?.Ve : e.ve?.Ve) ?? -1;
|
|
29
|
+
if (t >= e.Ve) e.Ve = t + 1;
|
|
30
|
+
const n = e.Ve;
|
|
31
31
|
const I = E.eE[n];
|
|
32
32
|
if (I === undefined) E.eE[n] = e; else {
|
|
33
|
-
const E = I.
|
|
34
|
-
E.
|
|
35
|
-
e.
|
|
36
|
-
I.
|
|
33
|
+
const E = I.ot;
|
|
34
|
+
E.lt = e;
|
|
35
|
+
e.ot = E;
|
|
36
|
+
I.ot = e;
|
|
37
37
|
}
|
|
38
38
|
if (n > E.EE) E.EE = n;
|
|
39
39
|
}
|
|
@@ -66,23 +66,23 @@ function deleteFromHeap(e, E) {
|
|
|
66
66
|
const t = e.se;
|
|
67
67
|
if (!(t & (REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT))) return;
|
|
68
68
|
e.se = t & -25;
|
|
69
|
-
const n = e.
|
|
70
|
-
if (e.
|
|
71
|
-
const t = e.
|
|
69
|
+
const n = e.Ve;
|
|
70
|
+
if (e.ot === e) E.eE[n] = undefined; else {
|
|
71
|
+
const t = e.lt;
|
|
72
72
|
const I = E.eE[n];
|
|
73
73
|
const o = t ?? I;
|
|
74
|
-
if (e === I) E.eE[n] = t; else e.lt
|
|
75
|
-
o.
|
|
74
|
+
if (e === I) E.eE[n] = t; else e.ot.lt = t;
|
|
75
|
+
o.ot = e.ot;
|
|
76
76
|
}
|
|
77
|
-
e.
|
|
78
|
-
e.
|
|
77
|
+
e.ot = e;
|
|
78
|
+
e.lt = undefined;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
function markHeap(e) {
|
|
82
82
|
if (e.tE) return;
|
|
83
83
|
e.tE = true;
|
|
84
84
|
for (let E = 0; E <= e.EE; E++) {
|
|
85
|
-
for (let t = e.eE[E]; t !== undefined; t = t.
|
|
85
|
+
for (let t = e.eE[E]; t !== undefined; t = t.lt) {
|
|
86
86
|
if (t.se & REACTIVE_IN_HEAP) markNode(t);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -106,11 +106,11 @@ function markNode(e, E = REACTIVE_DIRTY) {
|
|
|
106
106
|
|
|
107
107
|
function runHeap(e, E) {
|
|
108
108
|
e.tE = false;
|
|
109
|
-
for (e.
|
|
110
|
-
let t = e.eE[e.
|
|
109
|
+
for (e.He = 0; e.He <= e.EE; e.He++) {
|
|
110
|
+
let t = e.eE[e.He];
|
|
111
111
|
while (t !== undefined) {
|
|
112
112
|
if (t.se & REACTIVE_IN_HEAP) E(t); else adjustHeight(t, e);
|
|
113
|
-
t = e.eE[e.
|
|
113
|
+
t = e.eE[e.He];
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
e.EE = 0;
|
|
@@ -118,14 +118,14 @@ function runHeap(e, E) {
|
|
|
118
118
|
|
|
119
119
|
function adjustHeight(e, E) {
|
|
120
120
|
deleteFromHeap(e, E);
|
|
121
|
-
let t = e.
|
|
122
|
-
for (let E = e.
|
|
123
|
-
const e = E.
|
|
124
|
-
const n = e.
|
|
125
|
-
if (n.
|
|
121
|
+
let t = e.Ve;
|
|
122
|
+
for (let E = e.et; E; E = E.tt) {
|
|
123
|
+
const e = E.nt;
|
|
124
|
+
const n = e.it || e;
|
|
125
|
+
if (n.ae && n.Ve >= t) t = n.Ve + 1;
|
|
126
126
|
}
|
|
127
|
-
if (e.
|
|
128
|
-
e.
|
|
127
|
+
if (e.Ve !== t) {
|
|
128
|
+
e.Ve = t;
|
|
129
129
|
for (let E = e.o; E !== null; E = E.ue) {
|
|
130
130
|
// Route each subscriber by its own zombie flag, mirroring the
|
|
131
131
|
// post-recompute height-adjust path. Inserting into the running `heap`
|
package/dist/prod/core/lanes.js
CHANGED
|
@@ -19,13 +19,13 @@ const activeLanes = new Set;
|
|
|
19
19
|
// Detect parent lane: _parentSource chains from pendingSignal → pendingValueComputed → original.
|
|
20
20
|
// The child lane should not merge with the parent lane.
|
|
21
21
|
const i = n.nn;
|
|
22
|
-
const r = i?.
|
|
22
|
+
const r = i?.Me ? findLane(i.Me) : null;
|
|
23
23
|
e = {
|
|
24
24
|
en: n,
|
|
25
|
-
|
|
25
|
+
Ne: new Set,
|
|
26
26
|
rn: [ [], [] ],
|
|
27
27
|
tn: null,
|
|
28
|
-
|
|
28
|
+
Ie: activeTransition,
|
|
29
29
|
an: r
|
|
30
30
|
};
|
|
31
31
|
signalLanes.set(n, e);
|
|
@@ -36,8 +36,8 @@ const activeLanes = new Set;
|
|
|
36
36
|
// parent-child is a property of the nodes, not of write order — otherwise
|
|
37
37
|
// the owner's write merges the companion's subscribers into this lane and
|
|
38
38
|
// their effects wait on its async instead of flushing immediately.
|
|
39
|
-
adoptCompanionLane(n.
|
|
40
|
-
adoptCompanionLane(n.
|
|
39
|
+
adoptCompanionLane(n.he, e);
|
|
40
|
+
adoptCompanionLane(n.Ge, e);
|
|
41
41
|
return e;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -68,8 +68,8 @@ function adoptCompanionLane(n, e) {
|
|
|
68
68
|
// Move (not copy) the merged lane's work: after the merge all routing goes
|
|
69
69
|
// through findLane() to the root, so anything left behind here is dead —
|
|
70
70
|
// and anything *added* here later is a routing bug (INV-5).
|
|
71
|
-
for (const i of e.
|
|
72
|
-
e.
|
|
71
|
+
for (const i of e.Ne) n.Ne.add(i);
|
|
72
|
+
e.Ne.clear();
|
|
73
73
|
n.rn[0].push(...e.rn[0]);
|
|
74
74
|
n.rn[1].push(...e.rn[1]);
|
|
75
75
|
e.rn[0].length = 0;
|
|
@@ -80,11 +80,11 @@ function adoptCompanionLane(n, e) {
|
|
|
80
80
|
/**
|
|
81
81
|
* Resolve a node's lane: follow union-find chain, verify active, clear if stale.
|
|
82
82
|
*/ function resolveLane(n) {
|
|
83
|
-
const e = n.
|
|
83
|
+
const e = n.Me;
|
|
84
84
|
if (!e) return undefined;
|
|
85
85
|
const i = findLane(e);
|
|
86
86
|
if (activeLanes.has(i)) return i;
|
|
87
|
-
n.
|
|
87
|
+
n.Me = undefined;
|
|
88
88
|
return undefined;
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -99,13 +99,13 @@ function resolveTransition(n) {
|
|
|
99
99
|
if (e.fn !== true) return e;
|
|
100
100
|
n.sn = null;
|
|
101
101
|
}
|
|
102
|
-
return resolveLane(n)?.
|
|
102
|
+
return resolveLane(n)?.Ie ?? n.Ie;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* Check if a node has an active optimistic override.
|
|
107
107
|
*/ function hasActiveOverride(n) {
|
|
108
|
-
return !!(n.
|
|
108
|
+
return !!(n.Ae !== undefined && n.Ae !== NOT_PENDING);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
/**
|
|
@@ -113,13 +113,13 @@ function resolveTransition(n) {
|
|
|
113
113
|
* a different active lane), merge unless the node has an active override.
|
|
114
114
|
*/ function assignOrMergeLane(n, e) {
|
|
115
115
|
const i = findLane(e);
|
|
116
|
-
const r = n.
|
|
116
|
+
const r = n.Me;
|
|
117
117
|
if (r) {
|
|
118
118
|
// If the subscriber's lane was merged into another lane, it's stale —
|
|
119
119
|
// replace it with the new source lane instead of following the merge chain
|
|
120
120
|
// (which would incorrectly merge the new lane into the old group)
|
|
121
121
|
if (r.tn) {
|
|
122
|
-
n.
|
|
122
|
+
n.Me = e;
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
const t = findLane(r);
|
|
@@ -128,13 +128,13 @@ function resolveTransition(n) {
|
|
|
128
128
|
// Parent-child lanes stay independent so isPending resolves without
|
|
129
129
|
// waiting for the parent's async. The child keeps ownership.
|
|
130
130
|
if (i.an && findLane(i.an) === t) {
|
|
131
|
-
n.
|
|
131
|
+
n.Me = e;
|
|
132
132
|
} else if (t.an && findLane(t.an) === i) ; else mergeLanes(i, t);
|
|
133
133
|
}
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
n.
|
|
137
|
+
n.Me = e;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
export { activeLanes, assignOrMergeLane, findLane, getOrCreateLane, hasActiveOverride, mergeLanes, resolveLane, resolveTransition, signalLanes };
|