@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CONFIG_VERDICT, REACTIVE_PROBED, CONFIG_INPUTS_PUBLISHED, CONFIG_HELD, REACTIVE_JOINED, REACTIVE_STAGED_READ, REACTIVE_LANE_READ, CONFIG_CHILDREN_FORBIDDEN, CONFIG_OVERRIDE, STATUS_PENDING, CONFIG_GUESS, NOT_PENDING, STATUS_UNINITIALIZED, EFFECT_RENDER, STATUS_ERROR, REACTIVE_PROBE_UNANSWERED } from "./constants.js";
|
|
2
2
|
|
|
3
|
-
import { context, setVerdict,
|
|
3
|
+
import { context, tracking, setVerdict, bornInto, verdict, pullComputed, joinPass, markLateLinker, spectating, unflushedValue } from "./core.js";
|
|
4
4
|
|
|
5
5
|
import "./dev.js";
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ import { link } from "./graph.js";
|
|
|
10
10
|
|
|
11
11
|
import { verdictLane, laneValueOf, display } from "./lanes.js";
|
|
12
12
|
|
|
13
|
-
import { GlobalQueue, globalQueue, joinFuture, queuePendingNode, staleReader, passLane, setPassLane, flushTransaction,
|
|
13
|
+
import { GlobalQueue, txOf, globalQueue, joinFuture, queuePendingNode, staleReader, passLane, setPassLane, flushTransaction, stagedReaders } from "./scheduler.js";
|
|
14
14
|
|
|
15
15
|
// Verdicts (plan sec. 28 replay, 2026-10-02; maintainer, 2026-10-01: verdicts are
|
|
16
16
|
// optimistic state the system supplies). `isPending(fn)` asks whether what
|
|
@@ -61,11 +61,13 @@ function watchVerdict(e, t = false) {
|
|
|
61
61
|
* every flush (fuzzer F12). True when the reader is served the committed
|
|
62
62
|
* value — not over a flight committed beneath inputs already on screen (A15
|
|
63
63
|
* reveal corollary, #3305): that value would tear against them, and the
|
|
64
|
-
* reveal observes the flight.
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
* reveal observes the flight. Nor for a reader born into the flight's
|
|
65
|
+
* transaction (`bornInto`, #4010): it has no screen — it waits on the flight
|
|
66
|
+
* with the rest of its frame. */ function observeFlight(e, t) {
|
|
67
|
+
if (t.i & CONFIG_INPUTS_PUBLISHED || t.i & CONFIG_HELD && bornInto(e, txOf(t))) return false;
|
|
68
|
+
if (globalQueue.X) {
|
|
67
69
|
joinFuture(null);
|
|
68
|
-
if (!(t.
|
|
70
|
+
if (!(t.i & CONFIG_HELD)) queuePendingNode(t);
|
|
69
71
|
verdictRead(e, flushTransaction, true);
|
|
70
72
|
}
|
|
71
73
|
return true;
|
|
@@ -88,9 +90,9 @@ let probeFound = false;
|
|
|
88
90
|
* value notifying anyone (a held write's commit; a held landing's): its
|
|
89
91
|
* reader re-derives there. `latest` shows the proposal that lands — a
|
|
90
92
|
* rewrite or a landing reaches its reader through the link it holds — so a
|
|
91
|
-
* re-run would only repeat the frame. */ function verdictRead(e, t, n
|
|
93
|
+
* re-run would only repeat the frame. */ function verdictRead(e, t, n) {
|
|
92
94
|
route(e, t);
|
|
93
|
-
if (n) staleReader(e, t);
|
|
95
|
+
if (n) staleReader(e, t); else if (probing && t.an[t.an.length - 1] !== e) t.an.push(e);
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
/** A verdict read of a node staged or in flight but not held yet: whether it
|
|
@@ -154,29 +156,32 @@ let probeFound = false;
|
|
|
154
156
|
* frame with neither is final. A24: pending iff a value change is in
|
|
155
157
|
* flight — a staging equal to what is displayed changes nothing when it
|
|
156
158
|
* lands: final now (maintainer, 2026-10-02). */ function heldNotFinal(e) {
|
|
157
|
-
if ((e.
|
|
158
|
-
return e.
|
|
159
|
+
if ((e.S & STATUS_PENDING) !== 0 && !quietPending(e)) return true;
|
|
160
|
+
return e.Oe !== NOT_PENDING && !latestActive && !e.m.It && !(e.S & STATUS_UNINITIALIZED) && (!e.en || !e.en(e.Ae, e.Oe));
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
/** `isPending`'s answer for an unheld node whose flight is up (cause ii). */ function pendingVerdict(e, t) {
|
|
162
|
-
if (t.
|
|
164
|
+
if (t.S & STATUS_UNINITIALIZED) return;
|
|
163
165
|
if (probing && !quietPending(t)) probeFound = true;
|
|
164
166
|
if (e !== null && tracking) {
|
|
165
|
-
if (t.
|
|
167
|
+
if (t.i & CONFIG_HELD) verdictRead(e, txOf(t)); else if (globalQueue.X) provisionalVerdict(e, false);
|
|
166
168
|
// decided above
|
|
167
169
|
}
|
|
168
170
|
}
|
|
169
171
|
|
|
170
172
|
/** The pass entering a verdict window is a verdict reader (CONFIG_VERDICT):
|
|
171
|
-
* a dependency going pending re-derives it, the verdict having changed.
|
|
173
|
+
* a dependency going pending re-derives it, the verdict having changed. Not
|
|
174
|
+
* an untracked window: that is a snapshot, like any untracked read (#3946 —
|
|
175
|
+
* a router's link claim probing inside the computation that creates the
|
|
176
|
+
* anchor). A throw still reaches the pass through `untrack`. */ function markVerdictReader(e) {
|
|
172
177
|
let t = context;
|
|
173
178
|
if (t?.Ht) t = t.gt;
|
|
174
|
-
if (t !== null) {
|
|
175
|
-
t.
|
|
179
|
+
if (t !== null && tracking) {
|
|
180
|
+
t.i |= CONFIG_VERDICT;
|
|
176
181
|
t.R |= REACTIVE_PROBED;
|
|
177
182
|
// Observe tier: which windows this pass entered (1 `isPending`, 2
|
|
178
183
|
// `latest`) — the hold census names the affordance (attribution.ts).
|
|
179
|
-
t.
|
|
184
|
+
t.Ze = (t.Ze ?? 0) | e;
|
|
180
185
|
}
|
|
181
186
|
}
|
|
182
187
|
|
|
@@ -226,7 +231,7 @@ function isPending(e) {
|
|
|
226
231
|
* a tracked reader of a rewrite not yet flushed, the late-linker re-run in
|
|
227
232
|
* the flush that carries it. */ function heldLatest(e, t) {
|
|
228
233
|
const n = unflushedValue(e);
|
|
229
|
-
if (n === NOT_PENDING) return e.
|
|
234
|
+
if (n === NOT_PENDING) return e.Oe;
|
|
230
235
|
if (t !== null) markLateLinker(t);
|
|
231
236
|
return n;
|
|
232
237
|
}
|
|
@@ -253,10 +258,11 @@ function isPending(e) {
|
|
|
253
258
|
* uninitialized one throws NotReady: loading, not pending (A19 exc. 1);
|
|
254
259
|
* - an errored derivation throws for every reader (#2897). */ function verdictValue(e, t) {
|
|
255
260
|
const n = e;
|
|
256
|
-
const r = t !== null &&
|
|
261
|
+
const r = t !== null && !(t.i & CONFIG_CHILDREN_FORBIDDEN);
|
|
262
|
+
const i = r && tracking;
|
|
257
263
|
if (t !== null && tracking) {
|
|
258
264
|
link(e, t);
|
|
259
|
-
if (n.
|
|
265
|
+
if (n.ee !== undefined) {
|
|
260
266
|
// A31: the pulled memo's pass is its own, not the probe's — it reads
|
|
261
267
|
// outside the window, and the probe's read below answers for what
|
|
262
268
|
// the pass produced.
|
|
@@ -269,77 +275,83 @@ function isPending(e) {
|
|
|
269
275
|
// final by declaration — the value itself is read as below. The verdict is
|
|
270
276
|
// display-ahead like any: in a transaction's flush (the declaring action's
|
|
271
277
|
// body) the reader is its verdict lane's, not a staging the frame parks.
|
|
272
|
-
if (probing && GlobalQueue.
|
|
278
|
+
if (probing && GlobalQueue.N !== undefined && GlobalQueue.N(n)) {
|
|
273
279
|
probeFound = true;
|
|
274
|
-
if (
|
|
280
|
+
if (i && flushTransaction !== null) verdictRead(t, flushTransaction);
|
|
275
281
|
}
|
|
276
|
-
if (e.
|
|
277
|
-
const
|
|
278
|
-
if (
|
|
279
|
-
const u = (n.
|
|
280
|
-
if (e.
|
|
281
|
-
if (probing && (u || e.
|
|
282
|
-
return e.m.
|
|
282
|
+
if (e.i & CONFIG_OVERRIDE) {
|
|
283
|
+
const r = txOf(e);
|
|
284
|
+
if (i) verdictRead(t, r._parent ?? r);
|
|
285
|
+
const u = (n.S & STATUS_PENDING) !== 0 && !quietPending(n);
|
|
286
|
+
if (e.i & CONFIG_GUESS) {
|
|
287
|
+
if (probing && (u || e.Oe !== NOT_PENDING && (!e.en || !e.en(e.m.B, e.Oe)))) probeFound = true;
|
|
288
|
+
return e.m.B;
|
|
283
289
|
}
|
|
284
290
|
if (probing && u) probeFound = true;
|
|
285
291
|
return latestActive && !u ? laneValueOf(e) : display(e);
|
|
286
292
|
}
|
|
287
|
-
const
|
|
288
|
-
if (e.
|
|
289
|
-
if (!
|
|
290
|
-
const
|
|
293
|
+
const u = (n.S & STATUS_UNINITIALIZED) !== 0;
|
|
294
|
+
if (e.i & CONFIG_HELD) {
|
|
295
|
+
if (!u) {
|
|
296
|
+
const r = txOf(e);
|
|
291
297
|
// A render effect re-run (or mounted) outside the verdict lane's flush
|
|
292
298
|
// while the lane is blocked — its display held on its own derivation
|
|
293
299
|
// in flight — is a stale reader of the lane (#3460, as `laneRead`): the
|
|
294
300
|
// committed value now, re-derived at the reveal. Not inside a probe:
|
|
295
301
|
// `isPending` is answered below either way.
|
|
296
|
-
if (
|
|
297
|
-
staleReader(t,
|
|
298
|
-
return e.
|
|
302
|
+
if (i && !probing && t.u === EFFECT_RENDER && passLane === null && r.rt !== null && r.rt.fn && flushTransaction !== r) {
|
|
303
|
+
staleReader(t, r.rt);
|
|
304
|
+
return e.Ae;
|
|
299
305
|
}
|
|
300
|
-
if (
|
|
306
|
+
if (i) verdictRead(t, r);
|
|
301
307
|
if (probing && heldNotFinal(n)) probeFound = true;
|
|
302
|
-
if (latestActive && e.
|
|
308
|
+
if (latestActive && e.Oe !== NOT_PENDING) {
|
|
303
309
|
// An action body reading another transaction's proposal derives
|
|
304
310
|
// from it: the two settle as one (A15; posture C, 2026-09-15). An
|
|
305
311
|
// untracked read elsewhere has no transaction to entangle.
|
|
306
|
-
if (!
|
|
307
|
-
return heldLatest(e,
|
|
312
|
+
if (!i && flushTransaction !== null && !globalQueue.X) joinFuture(txOf(e));
|
|
313
|
+
return heldLatest(e, i ? t : null);
|
|
308
314
|
}
|
|
309
|
-
return e.
|
|
315
|
+
return e.Ae;
|
|
316
|
+
}
|
|
317
|
+
// Born into the future: its staging is its only value. It has no
|
|
318
|
+
// committed value, so no verdict: `isPending` reads it as its read does —
|
|
319
|
+
// the owner joins the hold (held with it, or caught by a boundary that
|
|
320
|
+
// has not shown content) and answers for the commit, where it is final.
|
|
321
|
+
if (e.Oe !== NOT_PENDING && !(n.S & STATUS_PENDING)) {
|
|
322
|
+
if (probing && r) joinPass(t, e);
|
|
323
|
+
return e.Oe;
|
|
310
324
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
} else if (e.Ae !== NOT_PENDING) {
|
|
314
|
-
if (n.G & STATUS_PENDING && !i) pendingVerdict(r ? t : null, n); else if (r && globalQueue.ee) provisionalVerdict(t, !latestActive && !i);
|
|
325
|
+
} else if (e.Oe !== NOT_PENDING) {
|
|
326
|
+
if (n.S & STATUS_PENDING && !u) pendingVerdict(i ? t : null, n); else if (i && globalQueue.X) provisionalVerdict(t, !latestActive && !u);
|
|
315
327
|
// Outside a flush, the staging is an unflushed write (A28): the probe
|
|
316
328
|
// answers for the flushed world, and watches the seam of the flush that
|
|
317
329
|
// carries the write — a memo of `isPending(x)` created after the write
|
|
318
330
|
// flips if that flush parks (#3078). (The write's own fan-out ran before
|
|
319
331
|
// the reader existed; nothing else would re-derive it.)
|
|
320
|
-
else if (
|
|
332
|
+
else if (i && probing) watchVerdict(t);
|
|
321
333
|
if (latestActive) {
|
|
322
334
|
// A28: an unflushed write is not what `latest` serves; a tracked
|
|
323
335
|
// reader derived from the flushed world runs again in the carrying
|
|
324
336
|
// flush.
|
|
325
|
-
if (globalQueue.
|
|
337
|
+
if (globalQueue.X) return e.Oe;
|
|
326
338
|
if (t !== null) markLateLinker(t);
|
|
327
339
|
}
|
|
328
|
-
return e.
|
|
340
|
+
return e.Ae;
|
|
329
341
|
}
|
|
330
|
-
if (n.
|
|
331
|
-
if (!
|
|
332
|
-
pendingVerdict(
|
|
333
|
-
return e.
|
|
342
|
+
if (n.S & STATUS_PENDING) {
|
|
343
|
+
if (!u) {
|
|
344
|
+
pendingVerdict(i ? t : null, n);
|
|
345
|
+
return e.Ae;
|
|
334
346
|
}
|
|
335
347
|
// As `read()`: an untracked read of a pending node still re-runs its
|
|
336
348
|
// reader when the node settles (a projection's pull reads its firewall
|
|
337
349
|
// untracked, store/store.ts).
|
|
338
350
|
if (t !== null && !tracking && !spectating && e !== t) link(e, t);
|
|
339
|
-
throw n.m?.
|
|
351
|
+
throw n.m?.F;
|
|
340
352
|
}
|
|
341
|
-
if (n.
|
|
342
|
-
return e.
|
|
353
|
+
if (n.ee !== undefined && n.S & STATUS_ERROR) throw n.m.F;
|
|
354
|
+
return e.Ae;
|
|
343
355
|
}
|
|
344
356
|
|
|
345
357
|
// Installed at module evaluation — present exactly when something imports
|
package/dist/observe/map.js
CHANGED
|
@@ -23,23 +23,23 @@ function mapArray(t, e, s) {
|
|
|
23
23
|
const r = e.length > 1;
|
|
24
24
|
const n = e;
|
|
25
25
|
const o = {
|
|
26
|
-
|
|
26
|
+
L: createOwner(),
|
|
27
27
|
wt: 0,
|
|
28
28
|
Mt: t,
|
|
29
29
|
$t: [],
|
|
30
30
|
qt: n,
|
|
31
31
|
zt: [],
|
|
32
|
-
|
|
32
|
+
Je: [],
|
|
33
33
|
bt: i,
|
|
34
34
|
Jt: i || s?.keyed === false ? [] : undefined,
|
|
35
35
|
Xt: r && s?.keyed !== false ? [] : undefined,
|
|
36
36
|
Yt: s?.keyed === false,
|
|
37
|
-
|
|
37
|
+
H: s?.fallback
|
|
38
38
|
};
|
|
39
39
|
const h = computed(updateKeyedMap.bind(o), s?.name ? {
|
|
40
40
|
name: s.name
|
|
41
41
|
} : undefined);
|
|
42
|
-
h.
|
|
42
|
+
h.i &= ~CONFIG_AUTO_DISPOSE;
|
|
43
43
|
return accessor(h);
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -157,7 +157,7 @@ function trySmallMove(t, e, s, i) {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
const a = t.zt;
|
|
160
|
-
const u = t.
|
|
160
|
+
const u = t.Je;
|
|
161
161
|
const l = a.slice(0, s);
|
|
162
162
|
const d = u.slice(0, s);
|
|
163
163
|
for (let t = 0; t < n.length; t += 3) {
|
|
@@ -177,7 +177,7 @@ function trySmallMove(t, e, s, i) {
|
|
|
177
177
|
d[t] = u[e];
|
|
178
178
|
}
|
|
179
179
|
t.zt = l;
|
|
180
|
-
t.
|
|
180
|
+
t.Je = d;
|
|
181
181
|
t.wt = s;
|
|
182
182
|
t.$t = e.slice(0);
|
|
183
183
|
// Dispose unmatched sources LAST (general-path ordering).
|
|
@@ -194,11 +194,11 @@ function updateKeyedMap() {
|
|
|
194
194
|
// the flight's reader (pending tracking + post-settle retry) instead of
|
|
195
195
|
// vanishing. Set per pass: the first pass runs inside `computed()`, before
|
|
196
196
|
// the node exists to the caller.
|
|
197
|
-
this.
|
|
197
|
+
this.L.gt = getOwner();
|
|
198
198
|
const t = this.Mt() || [], e = t.length;
|
|
199
199
|
t[$TRACK];
|
|
200
200
|
// top level tracking (a store array's container node)
|
|
201
|
-
runWithOwner(this.
|
|
201
|
+
runWithOwner(this.L, () => {
|
|
202
202
|
let s, i, r, n,
|
|
203
203
|
// Mappers write freshly-created row/index signals into the STAGE
|
|
204
204
|
// arrays (`rows`/`indexes`), never into `this._rows`/`this._indexes`.
|
|
@@ -220,19 +220,19 @@ function updateKeyedMap() {
|
|
|
220
220
|
// fast path for empty arrays
|
|
221
221
|
if (e === 0) {
|
|
222
222
|
if (this.wt !== 0) {
|
|
223
|
-
this.
|
|
224
|
-
this.
|
|
223
|
+
this.L.dispose(false);
|
|
224
|
+
this.Je = [];
|
|
225
225
|
this.$t = [];
|
|
226
226
|
this.zt = [];
|
|
227
227
|
this.wt = 0;
|
|
228
228
|
this.Jt && (this.Jt = []);
|
|
229
229
|
this.Xt && (this.Xt = []);
|
|
230
230
|
}
|
|
231
|
-
if (this.
|
|
231
|
+
if (this.H && !this.zt[0]) {
|
|
232
232
|
// an aborted fallback attempt leaves an owner without a mapping;
|
|
233
233
|
// dispose it before re-creating
|
|
234
|
-
this.
|
|
235
|
-
this.zt[0] = runWithOwner(this.
|
|
234
|
+
this.Je[0]?.dispose();
|
|
235
|
+
this.zt[0] = runWithOwner(this.Je[0] = createOwner(), this.H);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
// fast path for new create
|
|
@@ -248,10 +248,10 @@ function updateKeyedMap() {
|
|
|
248
248
|
throw t;
|
|
249
249
|
}
|
|
250
250
|
// commit
|
|
251
|
-
if (this.
|
|
251
|
+
if (this.Je[0]) this.Je[0].dispose();
|
|
252
252
|
// previous fallback
|
|
253
253
|
this.zt = h;
|
|
254
|
-
this.
|
|
254
|
+
this.Je = f;
|
|
255
255
|
r && (this.Jt = r);
|
|
256
256
|
n && (this.Xt = n);
|
|
257
257
|
this.$t = t.slice(0);
|
|
@@ -343,13 +343,13 @@ function updateKeyedMap() {
|
|
|
343
343
|
i = l.get(u);
|
|
344
344
|
if (i !== undefined && i !== -1) {
|
|
345
345
|
A[i] = this.zt[s];
|
|
346
|
-
M[i] = this.
|
|
346
|
+
M[i] = this.Je[s];
|
|
347
347
|
r && (r[i] = this.Jt[s]);
|
|
348
348
|
n && (n[i] = this.Xt[s]);
|
|
349
349
|
i = d[i];
|
|
350
350
|
l.set(u, i);
|
|
351
351
|
} else {
|
|
352
|
-
(p ??= []).push(this.
|
|
352
|
+
(p ??= []).push(this.Je[s]);
|
|
353
353
|
if (true && attrHooks !== null) (m ??= []).push(a);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
@@ -370,7 +370,7 @@ function updateKeyedMap() {
|
|
|
370
370
|
// change propagation), then dispose exited rows
|
|
371
371
|
for (s = 0; s < h; s++) {
|
|
372
372
|
A[s] = this.zt[s];
|
|
373
|
-
M[s] = this.
|
|
373
|
+
M[s] = this.Je[s];
|
|
374
374
|
r && (r[s] = this.Jt[s]);
|
|
375
375
|
n && (n[s] = this.Xt[s]);
|
|
376
376
|
}
|
|
@@ -380,7 +380,7 @@ function updateKeyedMap() {
|
|
|
380
380
|
}
|
|
381
381
|
for (i = c + 1; i < e; i++) {
|
|
382
382
|
A[i] = this.zt[i - y];
|
|
383
|
-
M[i] = this.
|
|
383
|
+
M[i] = this.Je[i - y];
|
|
384
384
|
if (r) {
|
|
385
385
|
r[i] = this.Jt[i - y];
|
|
386
386
|
_(r[i], t[i]);
|
|
@@ -391,14 +391,14 @@ function updateKeyedMap() {
|
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
this.zt = A;
|
|
394
|
-
this.
|
|
394
|
+
this.Je = M;
|
|
395
395
|
r && (this.Jt = r);
|
|
396
396
|
n && (this.Xt = n);
|
|
397
397
|
this.wt = e;
|
|
398
398
|
// save a copy of the mapped items for the next update
|
|
399
399
|
this.$t = t.slice(0);
|
|
400
400
|
if (p) for (s = 0; s < p.length; s++) p[s].dispose();
|
|
401
|
-
if (true && attrHooks !== null && m !== undefined && O !== undefined) attrHooks.listChurn(this.
|
|
401
|
+
if (true && attrHooks !== null && m !== undefined && O !== undefined) attrHooks.listChurn(this.L.gt, m, O, e, this.bt !== undefined);
|
|
402
402
|
}
|
|
403
403
|
});
|
|
404
404
|
return this.zt;
|
|
@@ -421,18 +421,18 @@ function updateKeyedMap() {
|
|
|
421
421
|
*/ function repeat(t, e, s) {
|
|
422
422
|
const i = e;
|
|
423
423
|
const r = {
|
|
424
|
-
|
|
424
|
+
L: createOwner(),
|
|
425
425
|
wt: 0,
|
|
426
426
|
ts: 0,
|
|
427
427
|
es: t,
|
|
428
428
|
qt: i,
|
|
429
|
-
|
|
429
|
+
Je: [],
|
|
430
430
|
zt: [],
|
|
431
431
|
ss: s?.from,
|
|
432
|
-
|
|
432
|
+
H: s?.fallback
|
|
433
433
|
};
|
|
434
434
|
const n = computed(updateRepeat.bind(r));
|
|
435
|
-
n.
|
|
435
|
+
n.i &= ~CONFIG_AUTO_DISPOSE;
|
|
436
436
|
return accessor(n);
|
|
437
437
|
}
|
|
438
438
|
|
|
@@ -445,24 +445,24 @@ function updateKeyedMap() {
|
|
|
445
445
|
// disjoint-window/front-clear/end-clear/shift special cases.
|
|
446
446
|
function updateRepeat() {
|
|
447
447
|
// As in updateKeyedMap: the node is the row callbacks' reader, per pass.
|
|
448
|
-
this.
|
|
448
|
+
this.L.gt = getOwner();
|
|
449
449
|
const t = this.es();
|
|
450
450
|
const e = this.ss?.() || 0;
|
|
451
|
-
runWithOwner(this.
|
|
451
|
+
runWithOwner(this.L, () => {
|
|
452
452
|
if (t === 0) {
|
|
453
453
|
if (this.wt !== 0) {
|
|
454
|
-
this.
|
|
455
|
-
this.
|
|
454
|
+
this.L.dispose(false);
|
|
455
|
+
this.Je = [];
|
|
456
456
|
this.zt = [];
|
|
457
457
|
this.wt = 0;
|
|
458
458
|
// Reset offset to match the cleared data (#2767, repro 2).
|
|
459
459
|
this.ts = 0;
|
|
460
460
|
}
|
|
461
|
-
if (this.
|
|
461
|
+
if (this.H && !this.zt[0]) {
|
|
462
462
|
// an aborted fallback attempt leaves an owner without a mapping;
|
|
463
463
|
// dispose it before re-creating
|
|
464
|
-
this.
|
|
465
|
-
this.zt[0] = runWithOwner(this.
|
|
464
|
+
this.Je[0]?.dispose();
|
|
465
|
+
this.zt[0] = runWithOwner(this.Je[0] = createOwner(), this.H);
|
|
466
466
|
}
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
@@ -475,7 +475,7 @@ function updateRepeat() {
|
|
|
475
475
|
const o = new Array(t);
|
|
476
476
|
const h = new Array(t);
|
|
477
477
|
for (let t = r; t < n; t++) {
|
|
478
|
-
h[t - e] = this.
|
|
478
|
+
h[t - e] = this.Je[t - this.ts];
|
|
479
479
|
o[t - e] = this.zt[t - this.ts];
|
|
480
480
|
}
|
|
481
481
|
try {
|
|
@@ -488,9 +488,9 @@ function updateRepeat() {
|
|
|
488
488
|
throw t;
|
|
489
489
|
}
|
|
490
490
|
// commit: dispose the previous fallback or the rows leaving the window
|
|
491
|
-
if (this.wt === 0) this.
|
|
491
|
+
if (this.wt === 0) this.Je[0]?.dispose(); else for (let t = this.ts; t < i; t++) if (t < e || t >= s) this.Je[t - this.ts].dispose();
|
|
492
492
|
this.zt = o;
|
|
493
|
-
this.
|
|
493
|
+
this.Je = h;
|
|
494
494
|
this.ts = e;
|
|
495
495
|
this.wt = t;
|
|
496
496
|
});
|
package/dist/observe/reveal.js
CHANGED
|
@@ -41,8 +41,8 @@ const slotMinReady = t => isController(t) ? t.ns() : ready(t);
|
|
|
41
41
|
* (`!gated`), a nested controller leaves its parent's ownership and runs its
|
|
42
42
|
* own order; a boundary leaves when it has shown content (boundaries.ts). */ function setSlotState(t, e, s, r) {
|
|
43
43
|
if (isController(t)) {
|
|
44
|
-
t.
|
|
45
|
-
t.
|
|
44
|
+
t.ne = s;
|
|
45
|
+
t.re = r;
|
|
46
46
|
t.ls();
|
|
47
47
|
// Released and ready — every slot of its own has shown — it graduates,
|
|
48
48
|
// as a boundary does when it shows content. Released at the frontier
|
|
@@ -50,9 +50,9 @@ const slotMinReady = t => isController(t) ? t.ns() : ready(t);
|
|
|
50
50
|
if (!s && t.us && t._parent === e) t._parent = null;
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
if (t.
|
|
54
|
-
t.
|
|
55
|
-
t.
|
|
53
|
+
if (t.ne !== s || t.re !== r) {
|
|
54
|
+
t.ne = s;
|
|
55
|
+
t.re = r;
|
|
56
56
|
redraw(t);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -64,8 +64,8 @@ class RevealController {
|
|
|
64
64
|
/** The controller gating this one, until it releases this one. */
|
|
65
65
|
_parent=null;
|
|
66
66
|
/** The state a parent forces on this whole group. */
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
ne=false;
|
|
68
|
+
re=false;
|
|
69
69
|
us=true;
|
|
70
70
|
ds=true;
|
|
71
71
|
Ss=false;
|
|
@@ -76,7 +76,7 @@ class RevealController {
|
|
|
76
76
|
/** A slot that has left this controller's ownership: a boundary that has
|
|
77
77
|
* shown content, a nested group that is ready. Shown is shown — it counts
|
|
78
78
|
* as ready whatever happens to it later (a re-arm gates nobody else). */ Rs(t) {
|
|
79
|
-
return (isController(t) ? t._parent : t.
|
|
79
|
+
return (isController(t) ? t._parent : t.V) !== this;
|
|
80
80
|
}
|
|
81
81
|
/** The slots this controller still owns, in registration order — the
|
|
82
82
|
* ones the order's state is forced on. */ _s(t) {
|
|
@@ -106,7 +106,7 @@ class RevealController {
|
|
|
106
106
|
}
|
|
107
107
|
return t !== "natural";
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
ue(t) {
|
|
110
110
|
if (this.fs.includes(t)) return;
|
|
111
111
|
this.fs.push(t);
|
|
112
112
|
// Gated from the start (collapsed in a collapsed sequential tail); the
|
|
@@ -114,17 +114,17 @@ class RevealController {
|
|
|
114
114
|
const e = untrack(this.hs) === "sequential" && !!untrack(this.cs);
|
|
115
115
|
if (isController(t)) {
|
|
116
116
|
t._parent = this;
|
|
117
|
-
t.
|
|
118
|
-
t.
|
|
117
|
+
t.ne = true;
|
|
118
|
+
t.re = e;
|
|
119
119
|
t.ls();
|
|
120
120
|
} else {
|
|
121
|
-
t.
|
|
122
|
-
t.
|
|
123
|
-
t.
|
|
121
|
+
t.V = this;
|
|
122
|
+
t.ne = true;
|
|
123
|
+
t.re = e;
|
|
124
124
|
}
|
|
125
125
|
untrack(() => this.ls());
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
oe(t) {
|
|
128
128
|
const e = this.fs.indexOf(t);
|
|
129
129
|
if (e >= 0) this.fs.splice(e, 1);
|
|
130
130
|
untrack(() => this.ls());
|
|
@@ -138,8 +138,8 @@ class RevealController {
|
|
|
138
138
|
try {
|
|
139
139
|
const t = untrack(this.hs);
|
|
140
140
|
const e = t === "sequential" && !!untrack(this.cs);
|
|
141
|
-
if (this.
|
|
142
|
-
this._s(t => setSlotState(t, this, true, this.
|
|
141
|
+
if (this.ne) {
|
|
142
|
+
this._s(t => setSlotState(t, this, true, this.re));
|
|
143
143
|
} else if (t === "natural") {
|
|
144
144
|
this._s(t => {
|
|
145
145
|
if (isController(t)) setSlotState(t, this, false, false); else setSlotState(t, this, !ready(t), false);
|
|
@@ -179,10 +179,10 @@ class RevealController {
|
|
|
179
179
|
* slots behind the frontier render nothing instead of their fallbacks
|
|
180
180
|
*/ function createRevealOrder(t, e) {
|
|
181
181
|
const s = createOwner();
|
|
182
|
-
const r = s.
|
|
182
|
+
const r = s.D[REVEAL];
|
|
183
183
|
const i = new RevealController(e?.order || SEQUENTIAL_ACCESSOR, e?.collapsed || FALSE_ACCESSOR);
|
|
184
|
-
s.
|
|
185
|
-
...s.
|
|
184
|
+
s.D = {
|
|
185
|
+
...s.D,
|
|
186
186
|
[REVEAL]: i
|
|
187
187
|
};
|
|
188
188
|
return runWithOwner(s, () => {
|
|
@@ -194,8 +194,8 @@ class RevealController {
|
|
|
194
194
|
});
|
|
195
195
|
if (true) s._name = "reveal order";
|
|
196
196
|
if (r) {
|
|
197
|
-
r.
|
|
198
|
-
cleanup(() => r.
|
|
197
|
+
r.ue(i);
|
|
198
|
+
cleanup(() => r.oe(i));
|
|
199
199
|
}
|
|
200
200
|
return e;
|
|
201
201
|
});
|
|
@@ -204,9 +204,9 @@ class RevealController {
|
|
|
204
204
|
// Installed at module evaluation — present exactly when something imports
|
|
205
205
|
// `createRevealOrder`; a Loading boundary without one pays a null check.
|
|
206
206
|
setRevealHooks({
|
|
207
|
-
ae: (t, e) => t.ae(e),
|
|
208
207
|
ue: (t, e) => t.ue(e),
|
|
209
|
-
|
|
208
|
+
oe: (t, e) => t.oe(e),
|
|
209
|
+
P: t => t.ls()
|
|
210
210
|
});
|
|
211
211
|
|
|
212
212
|
export { createRevealOrder };
|