@solidjs/signals 2.0.0-rc.14 → 2.0.0-rc.15
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-shared.js +248 -189
- package/dist/dev.attribution.js +124 -41
- package/dist/dev.js +553 -322
- package/dist/observe/affects.js +34 -31
- package/dist/observe/boundaries.js +166 -132
- package/dist/observe/core/async.js +90 -83
- package/dist/observe/core/attribution-queries.js +1 -1
- package/dist/observe/core/attribution.js +281 -197
- package/dist/observe/core/constants.js +7 -2
- package/dist/observe/core/context.js +3 -3
- package/dist/observe/core/core.js +277 -245
- package/dist/observe/core/dev.js +3 -3
- package/dist/observe/core/effect.js +21 -21
- package/dist/observe/core/external.js +2 -2
- package/dist/observe/core/graph.js +25 -25
- package/dist/observe/core/heap.js +9 -9
- package/dist/observe/core/lanes.js +206 -160
- package/dist/observe/core/owner.js +27 -27
- package/dist/observe/core/scheduler.js +92 -86
- package/dist/observe/core/verdict.js +66 -54
- package/dist/observe/map.js +35 -35
- package/dist/observe/reveal.js +24 -24
- package/dist/observe/signals.js +38 -28
- package/dist/observe/store/affects.js +75 -68
- package/dist/observe/store/hooks.js +13 -0
- package/dist/observe/store/index.js +0 -2
- package/dist/observe/store/optimistic.js +67 -34
- package/dist/observe/store/projection.js +37 -31
- package/dist/observe/store/reconcile.js +32 -30
- package/dist/observe/store/store.js +128 -85
- package/dist/prod/affects.js +34 -31
- package/dist/prod/boundaries.js +143 -109
- package/dist/prod/core/async.js +64 -67
- package/dist/prod/core/constants.js +7 -2
- package/dist/prod/core/context.js +3 -3
- package/dist/prod/core/core.js +302 -270
- package/dist/prod/core/effect.js +38 -38
- package/dist/prod/core/external.js +4 -4
- package/dist/prod/core/graph.js +27 -27
- package/dist/prod/core/heap.js +30 -30
- package/dist/prod/core/lanes.js +257 -211
- package/dist/prod/core/owner.js +39 -39
- package/dist/prod/core/scheduler.js +125 -119
- package/dist/prod/core/verdict.js +70 -58
- package/dist/prod/map.js +73 -73
- package/dist/prod/reveal.js +38 -38
- package/dist/prod/signals.js +30 -20
- package/dist/prod/store/affects.js +75 -68
- package/dist/prod/store/hooks.js +13 -0
- package/dist/prod/store/index.js +0 -2
- package/dist/prod/store/optimistic.js +114 -81
- package/dist/prod/store/projection.js +30 -24
- package/dist/prod/store/reconcile.js +32 -30
- package/dist/prod/store/store.js +136 -93
- package/dist/types/boundaries.d.ts +4 -0
- package/dist/types/core/attribution.d.ts +6 -2
- package/dist/types/core/constants.d.ts +5 -0
- package/dist/types/core/core.d.ts +33 -3
- package/dist/types/core/lanes.d.ts +10 -0
- package/dist/types/core/scheduler.d.ts +12 -6
- package/dist/types/core/types.d.ts +0 -6
- package/dist/types/store/affects.d.ts +11 -0
- package/dist/types/store/hooks.d.ts +48 -0
- package/dist/types/store/index.d.ts +0 -1
- package/dist/types/store/store.d.ts +3 -38
- package/package.json +1 -1
package/dist/prod/core/effect.js
CHANGED
|
@@ -22,16 +22,16 @@ import { globalQueue, schedule, GlobalQueue, haltReactivity } from "./scheduler.
|
|
|
22
22
|
// staged); the flush's commit replays this effect. Its first run is not this
|
|
23
23
|
// creation's (A29). A lane's node likewise: its run is the lane's, queued
|
|
24
24
|
// by the pass and released at the reveal (lanes.ts).
|
|
25
|
-
!E?.defer && r.
|
|
25
|
+
!E?.defer && r.Oe === NOT_PENDING && !r.m?.He?.B && (r.u === EFFECT_USER || E?.schedule ? globalQueue.enqueue(r.u, runEffect.bind(null, r)) : runEffect(r, r.u));
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function notifyEffectStatus(e, t) {
|
|
29
29
|
// Use passed values if provided, otherwise read from node
|
|
30
|
-
const u = e !== undefined ? e : this.
|
|
31
|
-
const E = t !== undefined ? t : this.m?.
|
|
30
|
+
const u = e !== undefined ? e : this.S;
|
|
31
|
+
const E = t !== undefined ? t : this.m?.F;
|
|
32
32
|
if (u & STATUS_ERROR) {
|
|
33
33
|
globalQueue.notify(this, STATUS_PENDING, 0);
|
|
34
|
-
if (this.
|
|
34
|
+
if (this.u === EFFECT_USER) {
|
|
35
35
|
// The error handler is the error arm of the effect phase (#2840 ruling):
|
|
36
36
|
// queue it like the effect function. It runs in the same imperative,
|
|
37
37
|
// writable scope and throws escalate the same way. No payload is queued — the node already carries `_statusFlags`/`_error`,
|
|
@@ -39,9 +39,9 @@ function notifyEffectStatus(e, t) {
|
|
|
39
39
|
// phase takes the success arm instead. Blocked forwards (explicit
|
|
40
40
|
// `status` arg without node-state writes) don't queue: the status
|
|
41
41
|
// re-propagates unblocked at commit.
|
|
42
|
-
if (this.
|
|
43
|
-
this.
|
|
44
|
-
globalQueue.enqueue(this.
|
|
42
|
+
if (this.S & STATUS_ERROR) {
|
|
43
|
+
this.Ge = true;
|
|
44
|
+
globalQueue.enqueue(this.u, this.Y ??= runEffect.bind(null, this));
|
|
45
45
|
}
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
@@ -49,13 +49,13 @@ function notifyEffectStatus(e, t) {
|
|
|
49
49
|
haltReactivity(unwrapStatusError(E));
|
|
50
50
|
throw E;
|
|
51
51
|
}
|
|
52
|
-
} else if (this.
|
|
52
|
+
} else if (this.u === EFFECT_RENDER) {
|
|
53
53
|
globalQueue.notify(this, STATUS_PENDING | STATUS_ERROR, u, E);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
function runEffect(e, t) {
|
|
58
|
-
if (!e.
|
|
58
|
+
if (!e.Ge || e.R & REACTIVE_DISPOSED) return;
|
|
59
59
|
// A queued run behind a fallback (boundaries.ts) waits for the reveal: a
|
|
60
60
|
// user effect's, which would read a DOM that is not attached, and a render
|
|
61
61
|
// effect's update too (maintainer, 2026-10-02: "we held the queue but let
|
|
@@ -64,7 +64,7 @@ function runEffect(e, t) {
|
|
|
64
64
|
// hidden subtree. The synchronous first render on creation is not a queued
|
|
65
65
|
// run and goes through. `_modified` stays set; the boundary re-queues the
|
|
66
66
|
// run (`release`).
|
|
67
|
-
if (GlobalQueue.
|
|
67
|
+
if (GlobalQueue.Ee && GlobalQueue.Ee(e)) return;
|
|
68
68
|
// Error arm (#2840), user effects only: a compute-phase error that is still
|
|
69
69
|
// the node's settled state at effect time runs the bundle's error handler in
|
|
70
70
|
// this same imperative, writable scope. Unwrap the StatusError used for
|
|
@@ -75,14 +75,14 @@ function runEffect(e, t) {
|
|
|
75
75
|
// Render effects bypass: their errors route to boundaries synchronously in
|
|
76
76
|
// notifyEffectStatus, and a runner queued by an earlier valueChanged in the
|
|
77
77
|
// same flush must not be hijacked by a later-arriving error status.
|
|
78
|
-
if (e.
|
|
79
|
-
const t = unwrapStatusError(e.m?.
|
|
80
|
-
e.
|
|
81
|
-
e.
|
|
78
|
+
if (e.S & STATUS_ERROR && e.u === EFFECT_USER) {
|
|
79
|
+
const t = unwrapStatusError(e.m?.F);
|
|
80
|
+
e.be = e.Ae;
|
|
81
|
+
e.Ge = false;
|
|
82
82
|
try {
|
|
83
|
-
e.
|
|
84
|
-
const t = e.
|
|
85
|
-
e.
|
|
83
|
+
e.ut ? e.ut(t, () => {
|
|
84
|
+
const t = e.st;
|
|
85
|
+
e.st = undefined;
|
|
86
86
|
t?.();
|
|
87
87
|
}) : console.error(t);
|
|
88
88
|
} catch (t) {
|
|
@@ -95,25 +95,25 @@ function runEffect(e, t) {
|
|
|
95
95
|
}
|
|
96
96
|
// Captured before the callback: its own throw errors the node below, but
|
|
97
97
|
// the compute pass that produced `_value` was clean, so its tail still goes.
|
|
98
|
-
const u = e.m?.
|
|
99
|
-
const E = e.
|
|
100
|
-
e.
|
|
98
|
+
const u = e.m?.F == null;
|
|
99
|
+
const E = e.st;
|
|
100
|
+
e.st = undefined;
|
|
101
101
|
try {
|
|
102
102
|
E?.();
|
|
103
|
-
const t = e.
|
|
103
|
+
const t = e.Et(e.Ae, e.be);
|
|
104
104
|
if (false && t !== undefined && typeof t !== "function") ;
|
|
105
105
|
// The final cleanup is invoked by disposeChildren at true disposal.
|
|
106
|
-
e.
|
|
106
|
+
e.st = t;
|
|
107
107
|
} catch (t) {
|
|
108
|
-
ext(e).
|
|
109
|
-
e.
|
|
108
|
+
ext(e).F = new StatusError(e, t);
|
|
109
|
+
e.S |= STATUS_ERROR;
|
|
110
110
|
if (!globalQueue.notify(e, STATUS_ERROR, STATUS_ERROR)) {
|
|
111
111
|
haltReactivity(t);
|
|
112
112
|
throw t;
|
|
113
113
|
}
|
|
114
114
|
} finally {
|
|
115
|
-
e.
|
|
116
|
-
e.
|
|
115
|
+
e.be = e.Ae;
|
|
116
|
+
e.Ge = false;
|
|
117
117
|
// The run applied: this is the frame now, so the dependency tail the
|
|
118
118
|
// compute pass left linked goes (A30, #3438 — `recompute` defers an
|
|
119
119
|
// effect's trim while a run is owed; the twin of `commitPendingNode`'s
|
|
@@ -123,7 +123,7 @@ function runEffect(e, t) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
GlobalQueue.
|
|
126
|
+
GlobalQueue.q = runEffect;
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* Internal tracked effect - bypasses heap, goes directly to effect queue.
|
|
@@ -134,31 +134,31 @@ GlobalQueue.X = runEffect;
|
|
|
134
134
|
// `_modified` is NOT redundant with the heap: the heap dedups within a
|
|
135
135
|
// pass, but several passes in one flush each enqueue `_run` into the same
|
|
136
136
|
// user queue, and this gate is what collapses them into one run.
|
|
137
|
-
if (!u.
|
|
138
|
-
if (GlobalQueue.
|
|
137
|
+
if (!u.Ge || u.R & REACTIVE_DISPOSED) return;
|
|
138
|
+
if (GlobalQueue.Ee && GlobalQueue.Ee(u)) return;
|
|
139
139
|
try {
|
|
140
|
-
u.
|
|
140
|
+
u.Ge = false;
|
|
141
141
|
recompute(u);
|
|
142
142
|
} finally {}
|
|
143
143
|
};
|
|
144
144
|
const u = computed(() => {
|
|
145
|
-
const t = u.
|
|
146
|
-
u.
|
|
145
|
+
const t = u.st;
|
|
146
|
+
u.st = undefined;
|
|
147
147
|
t?.();
|
|
148
148
|
const E = staleValues(e);
|
|
149
|
-
u.
|
|
149
|
+
u.st = E;
|
|
150
150
|
}, {
|
|
151
151
|
...t,
|
|
152
152
|
lazy: true
|
|
153
153
|
});
|
|
154
|
-
u.
|
|
155
|
-
u.
|
|
156
|
-
u.
|
|
157
|
-
u.
|
|
154
|
+
u.st = undefined;
|
|
155
|
+
u.i = u.i & ~CONFIG_AUTO_DISPOSE | CONFIG_CHILDREN_FORBIDDEN;
|
|
156
|
+
u.Ge = true;
|
|
157
|
+
u.u = EFFECT_TRACKED;
|
|
158
158
|
// Status dispatch rides the SHARED notifier (statusNotifierOf keys off
|
|
159
159
|
// _type): its error arm is behavior-identical to the closure that used to
|
|
160
160
|
// live here, without the per-node NodeExtension allocation.
|
|
161
|
-
u.
|
|
161
|
+
u.M = run;
|
|
162
162
|
// The first run rides the heap like every wake (GlobalQueue._update), so a
|
|
163
163
|
// tracked effect created inside a render-effect callback runs after that
|
|
164
164
|
// pass's staged writes commit, not before.
|
|
@@ -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.ee, () => {
|
|
50
50
|
setSignal(n, undefined);
|
|
51
51
|
});
|
|
52
52
|
cleanup(() => r.dispose());
|
|
53
|
-
e.
|
|
53
|
+
e.ee = 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 presence checks stay equivalent to the old
|
|
65
65
|
// `externalSourceConfig` truthiness checks.
|
|
66
66
|
function syncExternalHooks() {
|
|
67
|
-
GlobalQueue.
|
|
68
|
-
GlobalQueue.
|
|
67
|
+
GlobalQueue.it = externalSourceConfig ? wireExternalSource : undefined;
|
|
68
|
+
GlobalQueue._t = externalSourceConfig ? externalUntrack : undefined;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
function enableExternalSource(e) {
|
package/dist/prod/core/graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CONFIG_AUTO_DISPOSE, STATUS_PENDING, REACTIVE_DISPOSED, REACTIVE_ZOMBIE,
|
|
1
|
+
import { CONFIG_AUTO_DISPOSE, STATUS_PENDING, REACTIVE_DISPOSED, REACTIVE_ZOMBIE, REACTIVE_RECOMPUTING_DEPS, CONFIG_SLOT_NODE } from "./constants.js";
|
|
2
2
|
|
|
3
3
|
import { deleteFromHeap } from "./heap.js";
|
|
4
4
|
|
|
@@ -18,16 +18,16 @@ function setSlotUnobserved(e) {
|
|
|
18
18
|
// https://github.com/stackblitz/alien-signals/blob/v2.0.3/src/system.ts#L100
|
|
19
19
|
function unlinkSubs(e) {
|
|
20
20
|
const n = e.I;
|
|
21
|
-
const o = e.
|
|
22
|
-
const l = e.
|
|
21
|
+
const o = e._;
|
|
22
|
+
const l = e.o;
|
|
23
23
|
const t = e.en;
|
|
24
|
-
if (l !== null) l.en = t; else n.
|
|
25
|
-
if (t !== null) t.
|
|
24
|
+
if (l !== null) l.en = t; else n.Ye = t;
|
|
25
|
+
if (t !== null) t.o = l; else {
|
|
26
26
|
n.t = l;
|
|
27
27
|
if (l === null) {
|
|
28
28
|
// Store slot nodes dispatch to the ONE shared hook — no per-node
|
|
29
29
|
// unobserved closure, no NodeExtension to hold it.
|
|
30
|
-
if (n.
|
|
30
|
+
if (n.i & CONFIG_SLOT_NODE) slotUnobservedHook(n); else n.m?.Je?.();
|
|
31
31
|
// No more subscribers; only tear down if CONFIG_AUTO_DISPOSE is set.
|
|
32
32
|
// A pending node is exempt: its in-flight async work is an observer —
|
|
33
33
|
// tearing down would orphan the work and re-execute it on the next
|
|
@@ -35,20 +35,20 @@ function unlinkSubs(e) {
|
|
|
35
35
|
// observer releases (the untracked-read dormancy sweep guards on
|
|
36
36
|
// pending identically).
|
|
37
37
|
const e = n;
|
|
38
|
-
e.
|
|
38
|
+
e.ee && e.i & CONFIG_AUTO_DISPOSE && !(e.R & REACTIVE_ZOMBIE) && !(e.S & STATUS_PENDING) && unobserved(e);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
return o;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
function trimStaleDeps(e) {
|
|
45
|
-
const n = e.
|
|
46
|
-
let o = n !== null ? n.
|
|
45
|
+
const n = e.G;
|
|
46
|
+
let o = n !== null ? n._ : e.p;
|
|
47
47
|
if (o !== null) {
|
|
48
48
|
do {
|
|
49
49
|
o = unlinkSubs(o);
|
|
50
50
|
} while (o !== null);
|
|
51
|
-
if (n !== null) n.
|
|
51
|
+
if (n !== null) n._ = null; else e.p = null;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -57,13 +57,13 @@ function trimStaleDeps(e) {
|
|
|
57
57
|
// and skipping early also avoids adding one (hidden-class churn) via the
|
|
58
58
|
// null-out below.
|
|
59
59
|
function clearDeps(e) {
|
|
60
|
-
let n = e.
|
|
60
|
+
let n = e.p;
|
|
61
61
|
if (!n) return;
|
|
62
62
|
do {
|
|
63
63
|
n = unlinkSubs(n);
|
|
64
64
|
} while (n !== null);
|
|
65
|
-
e.
|
|
66
|
-
e.
|
|
65
|
+
e.p = null;
|
|
66
|
+
e.G = null;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
function unobserved(e) {
|
|
@@ -101,7 +101,7 @@ function sweepDormant() {
|
|
|
101
101
|
// is an observer; the settle path re-runs last-one-out), lost its
|
|
102
102
|
// AUTO_DISPOSE bit (owner teardown strips it, #3024), or already been
|
|
103
103
|
// torn down.
|
|
104
|
-
if (!e.t && e.
|
|
104
|
+
if (!e.t && e.i & CONFIG_AUTO_DISPOSE && !(e.S & STATUS_PENDING) && !(e.R & (REACTIVE_DISPOSED | REACTIVE_ZOMBIE))) {
|
|
105
105
|
unobserved(e);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -110,15 +110,15 @@ function sweepDormant() {
|
|
|
110
110
|
|
|
111
111
|
// https://github.com/stackblitz/alien-signals/blob/v2.0.3/src/system.ts#L52
|
|
112
112
|
function link(e, n) {
|
|
113
|
-
const o = n.
|
|
113
|
+
const o = n.G;
|
|
114
114
|
if (o !== null && o.I === e) return;
|
|
115
115
|
let l = null;
|
|
116
116
|
const t = n.R & REACTIVE_RECOMPUTING_DEPS;
|
|
117
117
|
if (t) {
|
|
118
|
-
l = o !== null ? o.
|
|
118
|
+
l = o !== null ? o._ : n.p;
|
|
119
119
|
if (l !== null && l.I === e) {
|
|
120
|
-
l.
|
|
121
|
-
n.
|
|
120
|
+
l.Pe = n.pe;
|
|
121
|
+
n.G = l;
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -127,18 +127,18 @@ function link(e, n) {
|
|
|
127
127
|
// [deps.._depsTail] prefix — the O(1) equivalent of scanning the dep list
|
|
128
128
|
// (the old alien-signals `isValidLink` walk, O(n²) when a computation
|
|
129
129
|
// re-reads earlier deps non-consecutively, e.g. store leaf reads).
|
|
130
|
-
const s = e.
|
|
131
|
-
if (s !== null && s.
|
|
132
|
-
const u = n.
|
|
130
|
+
const s = e.Ye;
|
|
131
|
+
if (s !== null && s.l === n && (!t || s.Pe === n.pe)) return;
|
|
132
|
+
const u = n.G = e.Ye = {
|
|
133
133
|
I: e,
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
l: n,
|
|
135
|
+
_: l,
|
|
136
136
|
en: s,
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
o: null,
|
|
138
|
+
Pe: n.pe
|
|
139
139
|
};
|
|
140
|
-
if (o !== null) o.
|
|
141
|
-
if (s !== null) s.
|
|
140
|
+
if (o !== null) o._ = u; else n.p = u;
|
|
141
|
+
if (s !== null) s.o = u; else e.t = u;
|
|
142
142
|
// New subscriber edge: staged-rewrite skips (§12d) must not miss it.
|
|
143
143
|
bumpNotifyEpoch();
|
|
144
144
|
}
|
package/dist/prod/core/heap.js
CHANGED
|
@@ -11,22 +11,22 @@ import { dirtyQueue } from "./scheduler.js";
|
|
|
11
11
|
* callback to the user queue once the pass has committed (see
|
|
12
12
|
* GlobalQueue._update, #3291).
|
|
13
13
|
*/ function enqueueSub(e) {
|
|
14
|
-
if (dirtyQueue.
|
|
14
|
+
if (dirtyQueue.Ue > e.me) dirtyQueue.Ue = e.me;
|
|
15
15
|
insertIntoHeap(e, dirtyQueue);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function actualInsertIntoHeap(e, t) {
|
|
19
|
-
const E = (e._parent
|
|
20
|
-
if (E >= e.
|
|
21
|
-
const n = e.
|
|
19
|
+
const E = (e._parent?.$e ? e._parent.et?.me : e._parent?.me) ?? -1;
|
|
20
|
+
if (E >= e.me) e.me = E + 1;
|
|
21
|
+
const n = e.me;
|
|
22
22
|
const I = t.Ht[n];
|
|
23
23
|
if (I === undefined) t.Ht[n] = e; else {
|
|
24
|
-
const t = I.
|
|
24
|
+
const t = I.we;
|
|
25
25
|
t.je = e;
|
|
26
|
-
e.
|
|
27
|
-
I.
|
|
26
|
+
e.we = t;
|
|
27
|
+
I.we = e;
|
|
28
28
|
}
|
|
29
|
-
if (n > t.
|
|
29
|
+
if (n > t.ft) t.ft = n;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function insertIntoHeap(e, t) {
|
|
@@ -49,7 +49,7 @@ function insertIntoHeap(e, t) {
|
|
|
49
49
|
// parked in the heap for a synchronous mount (each row writing a ref
|
|
50
50
|
// signal its effect subscribes to), mounting N rows was O(N²) (#3350).
|
|
51
51
|
// markNode's own guard skips an already-DIRTY node.
|
|
52
|
-
if (t.
|
|
52
|
+
if (t.N) markNode(e);
|
|
53
53
|
}
|
|
54
54
|
if (!(E & REACTIVE_IN_HEAP_HEIGHT)) actualInsertIntoHeap(e, t);
|
|
55
55
|
}
|
|
@@ -65,22 +65,22 @@ function deleteFromHeap(e, t) {
|
|
|
65
65
|
const E = e.R;
|
|
66
66
|
if (!(E & (REACTIVE_IN_HEAP | REACTIVE_IN_HEAP_HEIGHT))) return;
|
|
67
67
|
e.R = E & -25;
|
|
68
|
-
const n = e.
|
|
69
|
-
if (e.
|
|
68
|
+
const n = e.me;
|
|
69
|
+
if (e.we === e) t.Ht[n] = undefined; else {
|
|
70
70
|
const E = e.je;
|
|
71
71
|
const I = t.Ht[n];
|
|
72
72
|
const i = E ?? I;
|
|
73
|
-
if (e === I) t.Ht[n] = E; else e.
|
|
74
|
-
i.
|
|
73
|
+
if (e === I) t.Ht[n] = E; else e.we.je = E;
|
|
74
|
+
i.we = e.we;
|
|
75
75
|
}
|
|
76
|
-
e.
|
|
76
|
+
e.we = e;
|
|
77
77
|
e.je = undefined;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function markHeap(e) {
|
|
81
|
-
if (e.
|
|
82
|
-
e.
|
|
83
|
-
for (let t = 0; t <= e.
|
|
81
|
+
if (e.N) return;
|
|
82
|
+
e.N = true;
|
|
83
|
+
for (let t = 0; t <= e.ft; t++) {
|
|
84
84
|
for (let E = e.Ht[t]; E !== undefined; E = E.je) {
|
|
85
85
|
if (E.R & REACTIVE_IN_HEAP) markNode(E);
|
|
86
86
|
}
|
|
@@ -91,33 +91,33 @@ function markNode(e, t = REACTIVE_DIRTY) {
|
|
|
91
91
|
const E = e.R;
|
|
92
92
|
if ((E & (REACTIVE_CHECK | REACTIVE_DIRTY)) >= t) return;
|
|
93
93
|
e.R = E & -4 | t;
|
|
94
|
-
for (let t = e.t; t !== null; t = t.
|
|
95
|
-
markNode(t.
|
|
94
|
+
for (let t = e.t; t !== null; t = t.o) {
|
|
95
|
+
markNode(t.l, REACTIVE_CHECK);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
function runHeap(e, t) {
|
|
100
|
-
e.
|
|
101
|
-
for (e.
|
|
102
|
-
let E = e.Ht[e.
|
|
100
|
+
e.N = false;
|
|
101
|
+
for (e.Ue = 0; e.Ue <= e.ft; e.Ue++) {
|
|
102
|
+
let E = e.Ht[e.Ue];
|
|
103
103
|
while (E !== undefined) {
|
|
104
104
|
if (E.R & REACTIVE_IN_HEAP) t(E); else adjustHeight(E, e);
|
|
105
|
-
E = e.Ht[e.
|
|
105
|
+
E = e.Ht[e.Ue];
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
e.
|
|
108
|
+
e.ft = 0;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
function adjustHeight(e, t) {
|
|
112
112
|
deleteFromHeap(e, t);
|
|
113
|
-
let E = e.
|
|
114
|
-
for (let t = e.
|
|
113
|
+
let E = e.me;
|
|
114
|
+
for (let t = e.p; t; t = t._) {
|
|
115
115
|
const e = t.I;
|
|
116
|
-
if (e.
|
|
116
|
+
if (e.ee && e.me >= E) E = e.me + 1;
|
|
117
117
|
}
|
|
118
|
-
if (e.
|
|
119
|
-
e.
|
|
120
|
-
for (let E = e.t; E !== null; E = E.
|
|
118
|
+
if (e.me !== E) {
|
|
119
|
+
e.me = E;
|
|
120
|
+
for (let E = e.t; E !== null; E = E.o) insertIntoHeapHeight(E.l, t);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|