@solidjs/signals 2.0.0-rc.4 → 2.0.0-rc.6
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 +1618 -232
- package/dist/node.cjs +2262 -1199
- package/dist/prod/boundaries.js +4 -1
- package/dist/prod/core/async.js +152 -101
- package/dist/prod/core/constants.js +55 -1
- package/dist/prod/core/core.js +305 -234
- package/dist/prod/core/effect.js +28 -28
- package/dist/prod/core/error.js +13 -1
- package/dist/prod/core/external.js +2 -2
- package/dist/prod/core/graph.js +27 -27
- package/dist/prod/core/heap.js +30 -30
- package/dist/prod/core/lanes.js +32 -32
- package/dist/prod/core/optimistic.js +57 -57
- package/dist/prod/core/owner.js +34 -34
- package/dist/prod/core/scheduler.js +346 -152
- package/dist/prod/core/verdict.js +122 -65
- package/dist/prod/index.js +3 -3
- package/dist/prod/map.js +106 -106
- package/dist/prod/signals.js +321 -26
- package/dist/prod/store/next/optimistic.js +363 -151
- package/dist/prod/store/next/patch.js +6 -6
- package/dist/prod/store/next/projection.js +25 -21
- package/dist/prod/store/next/store.js +223 -113
- package/dist/prod/store/store.js +2 -2
- package/dist/types/core/async.d.ts +2 -0
- package/dist/types/core/attribution-hooks.d.ts +11 -0
- package/dist/types/core/attribution.d.ts +57 -4
- package/dist/types/core/constants.d.ts +54 -0
- package/dist/types/core/core.d.ts +19 -20
- package/dist/types/core/dev.d.ts +8 -2
- package/dist/types/core/error.d.ts +9 -0
- package/dist/types/core/index.d.ts +2 -2
- package/dist/types/core/scheduler.d.ts +39 -0
- package/dist/types/core/types.d.ts +12 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/signals.d.ts +108 -11
- package/dist/types/store/next/optimistic.d.ts +13 -10
- package/dist/types/store/next/projection.d.ts +1 -1
- package/dist/types/store/next/store.d.ts +22 -0
- package/dist/types/store/next/target.d.ts +25 -0
- package/dist/types-cjs/core/async.d.cts +2 -0
- package/dist/types-cjs/core/attribution-hooks.d.cts +11 -0
- package/dist/types-cjs/core/attribution.d.cts +57 -4
- package/dist/types-cjs/core/constants.d.cts +54 -0
- package/dist/types-cjs/core/core.d.cts +19 -20
- package/dist/types-cjs/core/dev.d.cts +8 -2
- package/dist/types-cjs/core/error.d.cts +9 -0
- package/dist/types-cjs/core/index.d.cts +2 -2
- package/dist/types-cjs/core/scheduler.d.cts +39 -0
- package/dist/types-cjs/core/types.d.cts +12 -0
- package/dist/types-cjs/index.d.cts +3 -3
- package/dist/types-cjs/signals.d.cts +108 -11
- package/dist/types-cjs/store/next/optimistic.d.cts +13 -10
- package/dist/types-cjs/store/next/projection.d.cts +1 -1
- package/dist/types-cjs/store/next/store.d.cts +22 -0
- package/dist/types-cjs/store/next/target.d.cts +25 -0
- package/package.json +1 -1
|
@@ -24,8 +24,8 @@ import { GlobalQueue, activeTransition, globalQueue, clock, insertSubs, schedule
|
|
|
24
24
|
* once the gate holds — the same late-binding contract as verdict.ts.
|
|
25
25
|
*/
|
|
26
26
|
/** The optimistic half of setSignal, fired when `_overrideValue !== undefined`. */ function optimisticWrite(e, n) {
|
|
27
|
-
const t = e.o?.
|
|
28
|
-
const i = t ? unwrapOverride(e.o?.
|
|
27
|
+
const t = e.o?.Pe !== NOT_PENDING;
|
|
28
|
+
const i = t ? unwrapOverride(e.o?.Pe) : e.be;
|
|
29
29
|
if (typeof n === "function") n = n(i);
|
|
30
30
|
const u = !!(e.S & STATUS_UNINITIALIZED) ||
|
|
31
31
|
// A dirty node's _value is stale (its queued recompute hasn't run — e.g.
|
|
@@ -34,7 +34,7 @@ import { GlobalQueue, activeTransition, globalQueue, clock, insertSubs, schedule
|
|
|
34
34
|
// push returning the shadow to that stale value was dropped, the snap
|
|
35
35
|
// recompute then committed the parent's old value, and the banner showed
|
|
36
36
|
// the previous transition's target (#3041 follow-up).
|
|
37
|
-
!!((e.ie ?? 0) & (REACTIVE_DIRTY | REACTIVE_CHECK)) || !e.
|
|
37
|
+
!!((e.ie ?? 0) & (REACTIVE_DIRTY | REACTIVE_CHECK)) || !e.pe || !e.pe(i, n);
|
|
38
38
|
if (!u) {
|
|
39
39
|
// Same-value write with an active override still entangles the current
|
|
40
40
|
// action's transition — the hold must outlast all overlapping actions.
|
|
@@ -48,21 +48,21 @@ import { GlobalQueue, activeTransition, globalQueue, clock, insertSubs, schedule
|
|
|
48
48
|
// No revert target is stashed: while the override is active every reader
|
|
49
49
|
// sees it (A17), so authoritative arrivals commit silently into _value and
|
|
50
50
|
// reverting is just dropping the override — _value is already correct.
|
|
51
|
-
else globalQueue.m.
|
|
51
|
+
else globalQueue.m.ze.push(e);
|
|
52
52
|
// Stamp ownership on the node (post-merge, so entangled writers share the
|
|
53
53
|
// joint root). resolveTransition prefers this over the lane's _transition,
|
|
54
54
|
// which a shared subscriber can merge across transactions (#2912).
|
|
55
55
|
ext(e).Nt = activeTransition;
|
|
56
56
|
const l = getOrCreateLane(e);
|
|
57
|
-
ext(e).
|
|
57
|
+
ext(e).Je = l;
|
|
58
58
|
e.T |= CONFIG_HAS_LANE;
|
|
59
59
|
// Literal undefined must not land raw: the slot doubles as the optimistic
|
|
60
60
|
// brand, and erasing it makes the write invisible and routes follow-up
|
|
61
61
|
// writes off the optimistic path into permanent commits (#2898).
|
|
62
|
-
ext(e).
|
|
62
|
+
ext(e).Pe = n === undefined ? OVERRIDE_UNDEFINED : n;
|
|
63
63
|
// syncCompanions only pokes _pendingSignal/_latestValueComputed — with
|
|
64
64
|
// neither companion present the call is a guaranteed no-op.
|
|
65
|
-
(e.o?.
|
|
65
|
+
(e.o?.ye !== undefined || e.o?.Ce !== undefined) && GlobalQueue.Ue !== null && GlobalQueue.Ue(e, n);
|
|
66
66
|
if (e.oe !== undefined) e.Te = clock;
|
|
67
67
|
// §12e: computed-only slot
|
|
68
68
|
insertSubs(e, true);
|
|
@@ -75,8 +75,8 @@ import { GlobalQueue, activeTransition, globalQueue, clock, insertSubs, schedule
|
|
|
75
75
|
* while one of its optimistic nodes holds an active override that is still
|
|
76
76
|
* pending on real (non-affects-sentinel) async.
|
|
77
77
|
*/ function transitionBlocked(e) {
|
|
78
|
-
for (let n = 0; n < e.
|
|
79
|
-
const t = e.
|
|
78
|
+
for (let n = 0; n < e.ze.length; n++) {
|
|
79
|
+
const t = e.ze[n];
|
|
80
80
|
if (hasActiveOverride(t) && "S" in t && t.S & STATUS_PENDING && t.o?._ instanceof NotReadyError) {
|
|
81
81
|
return true;
|
|
82
82
|
}
|
|
@@ -91,15 +91,15 @@ function resolveOptimisticNodes(e) {
|
|
|
91
91
|
const n = e.length;
|
|
92
92
|
for (let t = 0; t < n; t++) {
|
|
93
93
|
const n = e[t];
|
|
94
|
-
if (n.o !== null) n.o.
|
|
94
|
+
if (n.o !== null) n.o.Je = undefined;
|
|
95
95
|
// Revert is a pure drop: there is no revert target to commit —
|
|
96
96
|
// override-covered authoritative values hold in _pendingValue and
|
|
97
97
|
// elevate on their OWN transition's schedule (A18 as re-ruled 2026-07-07).
|
|
98
98
|
if (!(n.S & STATUS_PENDING)) n.S &= ~STATUS_UNINITIALIZED;
|
|
99
|
-
const i = n.o?.
|
|
100
|
-
ext(n).
|
|
99
|
+
const i = n.o?.Pe;
|
|
100
|
+
ext(n).Pe = NOT_PENDING;
|
|
101
101
|
if (i !== NOT_PENDING && n.be !== unwrapOverride(i)) insertSubs(n, true);
|
|
102
|
-
n.
|
|
102
|
+
n.Ae = null;
|
|
103
103
|
if (n.o !== null) n.o.Nt = null;
|
|
104
104
|
}
|
|
105
105
|
// Settlement checkpoint (#2838): companions caught in this batch (or owned
|
|
@@ -107,9 +107,9 @@ function resolveOptimisticNodes(e) {
|
|
|
107
107
|
// transition that produced them (A19 — pending is a property of the data).
|
|
108
108
|
for (let t = 0; t < n; t++) {
|
|
109
109
|
const n = e[t];
|
|
110
|
-
if (n.o?.
|
|
111
|
-
const i = n.o?.
|
|
112
|
-
if (i && (i.o?.
|
|
110
|
+
if (n.o?.ye || n.o?.Ce) GlobalQueue.un(n);
|
|
111
|
+
const i = n.o?.Tt;
|
|
112
|
+
if (i && (i.o?.ye === n || i.o?.Ce === n)) GlobalQueue.un(i);
|
|
113
113
|
}
|
|
114
114
|
e.splice(0, n);
|
|
115
115
|
}
|
|
@@ -122,10 +122,10 @@ function runQueue(e, n) {
|
|
|
122
122
|
* Run effects from all lanes that are ready (no pending async).
|
|
123
123
|
*/ function runLaneEffects(e) {
|
|
124
124
|
for (const n of activeLanes) {
|
|
125
|
-
if (n.
|
|
126
|
-
const t = n.
|
|
125
|
+
if (n.rn || n.Oe.size > 0) continue;
|
|
126
|
+
const t = n.tn[e - 1];
|
|
127
127
|
if (t.length) {
|
|
128
|
-
n.
|
|
128
|
+
n.tn[e - 1] = [];
|
|
129
129
|
runQueue(t, e);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -136,18 +136,18 @@ function runQueue(e, n) {
|
|
|
136
136
|
|
|
137
137
|
function cleanupCompletedLanes(e) {
|
|
138
138
|
for (const n of activeLanes) {
|
|
139
|
-
const t = e ? n.
|
|
139
|
+
const t = e ? n.Ae === e : !n.Ae;
|
|
140
140
|
if (!t) continue;
|
|
141
|
-
if (!n.
|
|
142
|
-
if (n.
|
|
143
|
-
if (n.
|
|
141
|
+
if (!n.rn) {
|
|
142
|
+
if (n.tn[0].length) runQueue(n.tn[0], EFFECT_RENDER);
|
|
143
|
+
if (n.tn[1].length) runQueue(n.tn[1], EFFECT_USER);
|
|
144
144
|
}
|
|
145
|
-
if (n.
|
|
146
|
-
n.
|
|
147
|
-
n.
|
|
148
|
-
n.
|
|
145
|
+
if (n.nn.o?.Je === n) if (n.nn.o !== null) n.nn.o.Je = undefined;
|
|
146
|
+
n.Oe.clear();
|
|
147
|
+
n.tn[0].length = 0;
|
|
148
|
+
n.tn[1].length = 0;
|
|
149
149
|
activeLanes.delete(n);
|
|
150
|
-
signalLanes.delete(n.
|
|
150
|
+
signalLanes.delete(n.nn);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -155,7 +155,7 @@ function cleanupCompletedLanes(e) {
|
|
|
155
155
|
// Per-lane suspension: only throw if in same lane as pending async
|
|
156
156
|
// AND the node doesn't have an active override (overrides are the visible value,
|
|
157
157
|
// downstream in the lane should read the override, not throw)
|
|
158
|
-
const n = e.o?.
|
|
158
|
+
const n = e.o?.Je;
|
|
159
159
|
if (!n) return false;
|
|
160
160
|
return findLane(n) === findLane(currentOptimisticLane) && !hasActiveOverride(e);
|
|
161
161
|
}
|
|
@@ -165,7 +165,7 @@ function cleanupCompletedLanes(e) {
|
|
|
165
165
|
* that reads a pending mid-transition write sees the committed value; the sub
|
|
166
166
|
* is recorded for replay at commit.
|
|
167
167
|
*/ function gatedRead(e, n, t) {
|
|
168
|
-
if (latestReadActive || e.
|
|
168
|
+
if (latestReadActive || e.Re === NOT_PENDING || e.oe || n !== e && !(n.ie & REACTIVE_MANUAL_WRITE)) {
|
|
169
169
|
return false;
|
|
170
170
|
}
|
|
171
171
|
activeTransition.cn.add(t);
|
|
@@ -176,7 +176,7 @@ function cleanupCompletedLanes(e) {
|
|
|
176
176
|
* read()'s value selection under a lane: return the committed `_value` for
|
|
177
177
|
* optimistic/lane-assigned signals, stale-mode reads, and pending owners.
|
|
178
178
|
*/ function laneReadsCommitted(e, n, t) {
|
|
179
|
-
if (e.o?.
|
|
179
|
+
if (e.o?.Pe !== undefined || !!e.o?.Je || !!(n.S & STATUS_PENDING)) {
|
|
180
180
|
// The committed view hides a staged in-flight value that will promote
|
|
181
181
|
// silently (commitPendingNode never re-notifies). gatedRead records plain
|
|
182
182
|
// signals for replay at commit; async memos are excluded from it by the
|
|
@@ -185,10 +185,10 @@ function cleanupCompletedLanes(e) {
|
|
|
185
185
|
// committed value to a reader that never re-ran after the landing, so a
|
|
186
186
|
// pending-gated branch stayed one value behind permanently (#3041
|
|
187
187
|
// follow-up). Record the reader under the same replay contract.
|
|
188
|
-
if (e.
|
|
188
|
+
if (e.Re !== NOT_PENDING) (activeTransition ?? globalQueue.m).cn.add(t);
|
|
189
189
|
return true;
|
|
190
190
|
}
|
|
191
|
-
if (n === e && stale && t.o?.
|
|
191
|
+
if (n === e && stale && t.o?.Tt !== e) {
|
|
192
192
|
// The committed view can hide a staged write (a lane member — even just
|
|
193
193
|
// an isPending companion flip — puts the reader "under a lane"). The
|
|
194
194
|
// staged value commits with no re-delivery (commitPendingNode never
|
|
@@ -200,7 +200,7 @@ function cleanupCompletedLanes(e) {
|
|
|
200
200
|
// into the transaction (#3041 follow-up: a pending-gated branch that
|
|
201
201
|
// first read its async source during the landing flush stayed one value
|
|
202
202
|
// behind permanently); with none, into the ambient batch.
|
|
203
|
-
if (e.
|
|
203
|
+
if (e.Re !== NOT_PENDING) (activeTransition ?? globalQueue.m).cn.add(t);
|
|
204
204
|
return true;
|
|
205
205
|
}
|
|
206
206
|
return false;
|
|
@@ -223,14 +223,14 @@ function cleanupCompletedLanes(e) {
|
|
|
223
223
|
// recompute() runs plain: the value stages and commits with the flush.
|
|
224
224
|
// (el's own override slot excludes companions themselves; a lane merged
|
|
225
225
|
// into a real optimistic lane resolves to a non-companion source.)
|
|
226
|
-
if (!globalQueue.
|
|
227
|
-
if (e.o !== null) e.o.
|
|
226
|
+
if (!globalQueue.fn && !activeTransition && !n.Ae && n.nn.o?.Tt !== undefined && e.o?.Pe === undefined) {
|
|
227
|
+
if (e.o !== null) e.o.Je = undefined;
|
|
228
228
|
return false;
|
|
229
229
|
}
|
|
230
230
|
return n;
|
|
231
231
|
}
|
|
232
|
-
for (let n = e.
|
|
233
|
-
const t = n.
|
|
232
|
+
for (let n = e.ut; n; n = n.lt) {
|
|
233
|
+
const t = n.ot;
|
|
234
234
|
if (t.ie & REACTIVE_OPTIMISTIC_DIRTY) {
|
|
235
235
|
const n = resolveLane(t);
|
|
236
236
|
if (n) {
|
|
@@ -245,25 +245,25 @@ function cleanupCompletedLanes(e) {
|
|
|
245
245
|
|
|
246
246
|
/** recompute()'s catch path: track pending async in the current lane. */ function laneAsyncPending(e) {
|
|
247
247
|
const n = findLane(currentOptimisticLane);
|
|
248
|
-
if (n.
|
|
249
|
-
n.
|
|
250
|
-
ext(e).
|
|
248
|
+
if (n.nn !== e) {
|
|
249
|
+
n.Oe.add(e);
|
|
250
|
+
ext(e).Je = n;
|
|
251
251
|
e.T |= CONFIG_HAS_LANE;
|
|
252
|
-
GlobalQueue.de !== null && GlobalQueue.de(n.
|
|
252
|
+
GlobalQueue.de !== null && GlobalQueue.de(n.nn);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
/** recompute()'s success path: the node's async settled, clear it from its lane. */ function laneAsyncSettled(e) {
|
|
257
257
|
const n = resolveLane(e);
|
|
258
258
|
if (n) {
|
|
259
|
-
n.
|
|
260
|
-
GlobalQueue.de !== null && GlobalQueue.de(n.
|
|
259
|
+
n.Oe.delete(e);
|
|
260
|
+
GlobalQueue.de !== null && GlobalQueue.de(n.nn);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
function trackOptimisticStore(e) {
|
|
265
265
|
// After initTransition, globalQueue._batch IS activeTransition (same reference)
|
|
266
|
-
globalQueue.m.
|
|
266
|
+
globalQueue.m.En.add(e);
|
|
267
267
|
schedule();
|
|
268
268
|
}
|
|
269
269
|
|
|
@@ -272,19 +272,19 @@ function trackOptimisticStore(e) {
|
|
|
272
272
|
* create optimistic state (verdict.ts at module top level, createOptimistic
|
|
273
273
|
* and createOptimisticStore at first call) BEFORE any optimistic node exists.
|
|
274
274
|
*/ function installOptimisticEngine() {
|
|
275
|
-
if (GlobalQueue.
|
|
276
|
-
GlobalQueue.
|
|
277
|
-
GlobalQueue.
|
|
278
|
-
GlobalQueue.
|
|
279
|
-
GlobalQueue.
|
|
280
|
-
GlobalQueue.
|
|
281
|
-
GlobalQueue.
|
|
282
|
-
GlobalQueue.
|
|
283
|
-
GlobalQueue.
|
|
284
|
-
GlobalQueue.
|
|
275
|
+
if (GlobalQueue.xt !== null) return;
|
|
276
|
+
GlobalQueue.xt = optimisticWrite;
|
|
277
|
+
GlobalQueue.Tn = resolveOptimisticNodes;
|
|
278
|
+
GlobalQueue.dn = transitionBlocked;
|
|
279
|
+
GlobalQueue.In = cleanupCompletedLanes;
|
|
280
|
+
GlobalQueue.Nn = runLaneEffects;
|
|
281
|
+
GlobalQueue.vt = gatedRead;
|
|
282
|
+
GlobalQueue.Vt = laneSuspends;
|
|
283
|
+
GlobalQueue.bt = laneReadsCommitted;
|
|
284
|
+
GlobalQueue.Be = recomputeLane;
|
|
285
285
|
GlobalQueue.$e = laneAsyncPending;
|
|
286
|
-
GlobalQueue.
|
|
287
|
-
GlobalQueue.
|
|
286
|
+
GlobalQueue.Xe = laneAsyncSettled;
|
|
287
|
+
GlobalQueue._n = trackOptimisticStore;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
290
|
export { installOptimisticEngine };
|
package/dist/prod/core/owner.js
CHANGED
|
@@ -12,7 +12,7 @@ const PENDING_OWNER = {};
|
|
|
12
12
|
|
|
13
13
|
// Dummy owner to trigger store's read() path
|
|
14
14
|
function markDisposal(e) {
|
|
15
|
-
let t = e.
|
|
15
|
+
let t = e.xe;
|
|
16
16
|
while (t) {
|
|
17
17
|
const e = t.ie;
|
|
18
18
|
t.ie = e | REACTIVE_ZOMBIE;
|
|
@@ -26,7 +26,7 @@ function markDisposal(e) {
|
|
|
26
26
|
if (e & REACTIVE_IN_HEAP) insertIntoHeap(t, zombieQueue); else insertIntoHeapHeight(t, zombieQueue);
|
|
27
27
|
}
|
|
28
28
|
markDisposal(t);
|
|
29
|
-
t = t.
|
|
29
|
+
t = t.Le;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -52,12 +52,12 @@ function disposeChildren(e, t = false, n) {
|
|
|
52
52
|
// edge). Snap runs after the DISPOSED flag is set so the oracle reads
|
|
53
53
|
// false, and notifies subscribers still watching the companion.
|
|
54
54
|
const t = e;
|
|
55
|
-
if (t.o?.
|
|
55
|
+
if (t.o?.ye || t.o?.Ce) GlobalQueue.un(t);
|
|
56
56
|
}
|
|
57
|
-
if (t && e.oe && e.o !== null) e.o.
|
|
58
|
-
let o = n ? e.o?.
|
|
57
|
+
if (t && e.oe && e.o !== null) e.o.Ie = null;
|
|
58
|
+
let o = n ? e.o?.Ye ?? null : e.xe;
|
|
59
59
|
while (o) {
|
|
60
|
-
const e = o.
|
|
60
|
+
const e = o.Le;
|
|
61
61
|
const t = o;
|
|
62
62
|
// Owner teardown is death regardless of the child's own lifecycle
|
|
63
63
|
// (#3024): strip AUTO_DISPOSE so a post-disposal read freezes at the
|
|
@@ -80,34 +80,34 @@ function disposeChildren(e, t = false, n) {
|
|
|
80
80
|
o = e;
|
|
81
81
|
}
|
|
82
82
|
if (n) {
|
|
83
|
-
if (e.o !== null) e.o.
|
|
83
|
+
if (e.o !== null) e.o.Ye = null;
|
|
84
84
|
} else {
|
|
85
|
-
e.
|
|
86
|
-
e.
|
|
85
|
+
e.xe = null;
|
|
86
|
+
e.Ze = 0;
|
|
87
87
|
}
|
|
88
88
|
// O(1) splice out of parent's chain on individual dispose. Skipped during
|
|
89
89
|
// batch dispose (parent already disposed) and zombie disposal (node sits on
|
|
90
90
|
// parent's _pendingFirstChild). We leave node._nextSibling intact so outer
|
|
91
91
|
// walks that already advanced past us still reach later siblings.
|
|
92
92
|
if (t && !n && !(i & REACTIVE_ZOMBIE) && e.ke !== null && !(e.ke.ie & REACTIVE_DISPOSED)) {
|
|
93
|
-
const t = e.
|
|
94
|
-
const n = e.
|
|
95
|
-
if (t !== null) t.
|
|
96
|
-
if (n !== null) n.
|
|
97
|
-
e.
|
|
93
|
+
const t = e.ft;
|
|
94
|
+
const n = e.Le;
|
|
95
|
+
if (t !== null) t.Le = n; else e.ke.xe = n;
|
|
96
|
+
if (n !== null) n.ft = t;
|
|
97
|
+
e.ft = null;
|
|
98
98
|
}
|
|
99
99
|
runDisposal(e, n);
|
|
100
100
|
// Final effect-returned cleanup fires at true disposal, after `_disposal`
|
|
101
101
|
// to mirror rerun ordering (compute-phase teardown first, cleanup last).
|
|
102
|
-
if (t && e.
|
|
103
|
-
const t = e.
|
|
104
|
-
e.
|
|
102
|
+
if (t && e.Rt) {
|
|
103
|
+
const t = e.Rt;
|
|
104
|
+
e.Rt = undefined;
|
|
105
105
|
t();
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
function runDisposal(e, t) {
|
|
110
|
-
let n = t ? e.o?.
|
|
110
|
+
let n = t ? e.o?.qe : e.Ge;
|
|
111
111
|
if (!n) return;
|
|
112
112
|
if (Array.isArray(n)) {
|
|
113
113
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -118,14 +118,14 @@ function runDisposal(e, t) {
|
|
|
118
118
|
n.call(n);
|
|
119
119
|
}
|
|
120
120
|
if (t) {
|
|
121
|
-
if (e.o !== null) e.o.
|
|
122
|
-
} else e.
|
|
121
|
+
if (e.o !== null) e.o.qe = null;
|
|
122
|
+
} else e.Ge = null;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
function childId(e, t) {
|
|
126
126
|
let n = e;
|
|
127
127
|
while (n.T & CONFIG_TRANSPARENT && n.ke) n = n.ke;
|
|
128
|
-
if (n.id != null) return formatId(n.id, t ? n.
|
|
128
|
+
if (n.id != null) return formatId(n.id, t ? n.Ze++ : n.Ze);
|
|
129
129
|
throw new Error("");
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -206,7 +206,7 @@ function formatId(e, t) {
|
|
|
206
206
|
* checks. `cleanup()` is the unchecked primitive used by internals.
|
|
207
207
|
*/ function cleanup(e) {
|
|
208
208
|
if (!context) return e;
|
|
209
|
-
if (!context.
|
|
209
|
+
if (!context.Ge) context.Ge = e; else if (Array.isArray(context.Ge)) context.Ge.push(e); else context.Ge = [ context.Ge, e ];
|
|
210
210
|
return e;
|
|
211
211
|
}
|
|
212
212
|
|
|
@@ -246,27 +246,27 @@ function disposeRootSelf(e = true) {
|
|
|
246
246
|
const i = {
|
|
247
247
|
id: inheritId(e, n, t),
|
|
248
248
|
T: n ? CONFIG_TRANSPARENT : 0,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
249
|
+
Gt: true,
|
|
250
|
+
Dt: t?.Gt ? t.Dt : t,
|
|
251
|
+
xe: null,
|
|
252
|
+
Le: null,
|
|
253
|
+
ft: null,
|
|
254
|
+
Ge: null,
|
|
255
255
|
C: t?.C ?? globalQueue,
|
|
256
256
|
we: t?.we || defaultContext,
|
|
257
|
-
|
|
257
|
+
Ze: 0,
|
|
258
258
|
o: null,
|
|
259
259
|
ke: t,
|
|
260
260
|
dispose: disposeRootSelf
|
|
261
261
|
};
|
|
262
262
|
if (t) {
|
|
263
|
-
const e = t.
|
|
263
|
+
const e = t.xe;
|
|
264
264
|
if (e === null) {
|
|
265
|
-
t.
|
|
265
|
+
t.xe = i;
|
|
266
266
|
} else {
|
|
267
|
-
i.
|
|
268
|
-
e.
|
|
269
|
-
t.
|
|
267
|
+
i.Le = e;
|
|
268
|
+
e.ft = i;
|
|
269
|
+
t.xe = i;
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
return i;
|