@solidjs/signals 2.0.0-rc.16 → 2.0.0-rc.18
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 +1972 -1751
- package/dist/dev.attribution.js +16 -16
- package/dist/dev.js +672 -319
- package/dist/observe/boundaries.js +2 -2
- package/dist/observe/core/async.js +151 -116
- package/dist/observe/core/constants.js +3 -1
- package/dist/observe/core/context.js +2 -0
- package/dist/observe/core/core.js +51 -35
- package/dist/observe/core/effect.js +29 -30
- package/dist/observe/core/graph.js +13 -11
- package/dist/observe/core/lanes.js +25 -14
- package/dist/observe/core/owner.js +77 -51
- package/dist/observe/core/scheduler.js +202 -175
- package/dist/observe/core/verdict.js +5 -2
- package/dist/observe/deferred.js +16 -13
- package/dist/observe/from.js +248 -0
- package/dist/observe/index.js +2 -0
- package/dist/observe/map.js +2 -2
- package/dist/observe/signals.js +6 -1
- package/dist/observe/store/affects.js +13 -13
- package/dist/observe/store/optimistic.js +112 -71
- package/dist/observe/store/reconcile.js +137 -121
- package/dist/observe/store/store.js +612 -626
- package/dist/observe/store/target.js +1 -5
- package/dist/prod/boundaries.js +2 -2
- package/dist/prod/core/async.js +211 -176
- package/dist/prod/core/constants.js +3 -1
- package/dist/prod/core/context.js +2 -0
- package/dist/prod/core/core.js +63 -47
- package/dist/prod/core/effect.js +24 -25
- package/dist/prod/core/graph.js +12 -10
- package/dist/prod/core/heap.js +1 -1
- package/dist/prod/core/lanes.js +39 -28
- package/dist/prod/core/owner.js +70 -44
- package/dist/prod/core/scheduler.js +78 -51
- package/dist/prod/core/truth.js +4 -4
- package/dist/prod/core/verdict.js +11 -8
- package/dist/prod/deferred.js +17 -14
- package/dist/prod/from.js +248 -0
- package/dist/prod/index.js +2 -0
- package/dist/prod/map.js +2 -2
- package/dist/prod/signals.js +18 -13
- package/dist/prod/store/optimistic.js +112 -71
- package/dist/prod/store/reconcile.js +137 -121
- package/dist/prod/store/store.js +109 -121
- package/dist/prod/store/target.js +13 -17
- package/dist/types/core/async.d.ts +12 -2
- package/dist/types/core/constants.d.ts +5 -0
- package/dist/types/core/core.d.ts +29 -6
- package/dist/types/core/dev.d.ts +9 -1
- package/dist/types/core/error.d.ts +9 -1
- package/dist/types/core/owner.d.ts +4 -0
- package/dist/types/core/scheduler.d.ts +38 -7
- package/dist/types/from.d.ts +47 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/prod/core/lanes.js
CHANGED
|
@@ -119,7 +119,7 @@ function applyGuesses(e) {
|
|
|
119
119
|
// value re-asked renews the question; nothing to notify.
|
|
120
120
|
u = !t.xe || !t.xe(laneValueOf(t), l);
|
|
121
121
|
if (!(t.l & CONFIG_GUESS)) {
|
|
122
|
-
t.
|
|
122
|
+
t.ue = NOT_PENDING;
|
|
123
123
|
t.l |= CONFIG_GUESS;
|
|
124
124
|
}
|
|
125
125
|
t.T.v = l;
|
|
@@ -264,7 +264,7 @@ function unlink(e) {
|
|
|
264
264
|
}
|
|
265
265
|
if (!e.i) {
|
|
266
266
|
if (!(e.l & CONFIG_OVERRIDE)) {
|
|
267
|
-
e.
|
|
267
|
+
e.ue = NOT_PENDING;
|
|
268
268
|
e.l = e.l & -1048833 | CONFIG_OVERRIDE;
|
|
269
269
|
ext(e);
|
|
270
270
|
}
|
|
@@ -321,7 +321,7 @@ function supersede(e, n, s) {
|
|
|
321
321
|
// A confirmation is silent (A17); only truth readers are told.
|
|
322
322
|
GlobalQueue.sn?.(t);
|
|
323
323
|
}
|
|
324
|
-
e.
|
|
324
|
+
e.ue = n;
|
|
325
325
|
joinFuture(l);
|
|
326
326
|
}
|
|
327
327
|
|
|
@@ -365,7 +365,7 @@ function supersede(e, n, s) {
|
|
|
365
365
|
// of its flight observes it (#3648, #3651; #3305's commit beneath a
|
|
366
366
|
// flight).
|
|
367
367
|
u.Re = null;
|
|
368
|
-
if (!i && !r) l.
|
|
368
|
+
if (!i && !r) l.ue = f;
|
|
369
369
|
commitPendingNode(l);
|
|
370
370
|
if (!i) {
|
|
371
371
|
if (l.R & (REACTIVE_IN_HEAP | REACTIVE_DIRTY | REACTIVE_CHECK) || l.m & STATUS_PENDING) l.l |= CONFIG_INPUTS_PUBLISHED;
|
|
@@ -376,7 +376,7 @@ function supersede(e, n, s) {
|
|
|
376
376
|
// else the value it covered — is the parent's to land, and its readers
|
|
377
377
|
// re-derive from it there. What the screen showed stays the screen
|
|
378
378
|
// until then (A18 (c)).
|
|
379
|
-
if (l.
|
|
379
|
+
if (l.ue === NOT_PENDING) l.ue = covered(l);
|
|
380
380
|
if (e.ke) l.Ie = o;
|
|
381
381
|
holdNode(l, n);
|
|
382
382
|
insertSubs(l);
|
|
@@ -390,7 +390,7 @@ function supersede(e, n, s) {
|
|
|
390
390
|
// it: an input's truth equal to its committed value is silent).
|
|
391
391
|
u.Re = null;
|
|
392
392
|
if (!i) {
|
|
393
|
-
if (E !== NOT_PENDING && e.ke) l.
|
|
393
|
+
if (E !== NOT_PENDING && e.ke) l.ue = E;
|
|
394
394
|
if (l.m & STATUS_PENDING) {
|
|
395
395
|
u.Se = null;
|
|
396
396
|
enqueueSub(l);
|
|
@@ -435,12 +435,21 @@ function supersede(e, n, s) {
|
|
|
435
435
|
* lane's latest. NOT_PENDING falls through: lane work's read of a pending
|
|
436
436
|
* member throws like any. */ function laneRead(e, n) {
|
|
437
437
|
const s = n.l & CONFIG_GUESS;
|
|
438
|
+
const t = txOf(n);
|
|
439
|
+
// A lane a correction folded under (D-34): store/optimistic.ts reads it.
|
|
440
|
+
// Before the authoritative arm: an `until` outside the lane reads the
|
|
441
|
+
// same truth there, and joins the hold it folded into — its posture over
|
|
442
|
+
// a foreign hold (D-31), which the truth read alone would not take.
|
|
443
|
+
const l = e !== null && t.folded;
|
|
444
|
+
if (l) {
|
|
445
|
+
const s = l(e, n);
|
|
446
|
+
if (s !== NOT_PENDING) return s;
|
|
447
|
+
}
|
|
438
448
|
if (e !== null && e.l & CONFIG_AUTHORITATIVE) return GlobalQueue.rn(n);
|
|
439
|
-
const
|
|
449
|
+
const u = n.m;
|
|
440
450
|
// An errored member's lane value predates its error; the error is the answer (#4106).
|
|
441
|
-
if (!s &&
|
|
451
|
+
if (!s && u & STATUS_ERROR) return NOT_PENDING;
|
|
442
452
|
if (e === null) return laneValueOf(n);
|
|
443
|
-
const l = txOf(n);
|
|
444
453
|
if (!tracking || e.l & CONFIG_CHILDREN_FORBIDDEN) {
|
|
445
454
|
// An untracked read inside lane work derives from the lane like a
|
|
446
455
|
// tracked one, minus the subscription — `untrack` is about
|
|
@@ -449,33 +458,33 @@ function supersede(e, n, s) {
|
|
|
449
458
|
// lanes read by one pass link, as for tracked reads). Outside lane
|
|
450
459
|
// work, the screen.
|
|
451
460
|
if (passLane === null || e.l & CONFIG_CHILDREN_FORBIDDEN) return display(n);
|
|
452
|
-
enterLane(
|
|
453
|
-
if (!s &&
|
|
461
|
+
enterLane(t, e);
|
|
462
|
+
if (!s && u & STATUS_PENDING) return NOT_PENDING;
|
|
454
463
|
return laneValueOf(n);
|
|
455
464
|
}
|
|
456
|
-
if (e.i === EFFECT_RENDER && (passLane === null || !sameLane(passLane,
|
|
465
|
+
if (e.i === EFFECT_RENDER && (passLane === null || !sameLane(passLane, t))) {
|
|
457
466
|
if (!s) {
|
|
458
467
|
// A flight whose value has never shown: nothing to show — the leaf
|
|
459
468
|
// waits on it, and its own frame holds (A15, #3334), not the lane's
|
|
460
469
|
// parent. The landing lands the frame: its own pass (the flush
|
|
461
470
|
// joined its transaction) reads the answer it waited on — the lane's
|
|
462
471
|
// staging, revealed at this seam.
|
|
463
|
-
if (
|
|
464
|
-
if (n.
|
|
472
|
+
if (u & STATUS_PENDING && n.T.v === NOT_PENDING) return NOT_PENDING;
|
|
473
|
+
if (n.ue !== NOT_PENDING && e.l & CONFIG_HELD && flushTransaction !== null && resolveTx(flushTransaction) === txOf(e)) return n.ue;
|
|
465
474
|
}
|
|
466
|
-
if (
|
|
467
|
-
if (!s && !
|
|
475
|
+
if (t.ln || !s && u & STATUS_PENDING) {
|
|
476
|
+
if (!s && !t.ke && u & STATUS_UNINITIALIZED) throw new NotReadyError(null);
|
|
468
477
|
// Re-derived at the reveal; once per pass (the pass may also be a stale
|
|
469
478
|
// reader of a transaction, REACTIVE_FRAME_READ — both reruns apply).
|
|
470
479
|
if (!(e.R & REACTIVE_SCREEN_READ)) {
|
|
471
480
|
e.R |= REACTIVE_FRAME_READ | REACTIVE_SCREEN_READ;
|
|
472
|
-
|
|
481
|
+
t.En.push(e);
|
|
473
482
|
}
|
|
474
483
|
return display(n);
|
|
475
484
|
}
|
|
476
485
|
}
|
|
477
|
-
enterLane(
|
|
478
|
-
if (!s &&
|
|
486
|
+
enterLane(t, e);
|
|
487
|
+
if (!s && u & STATUS_PENDING) return NOT_PENDING;
|
|
479
488
|
return laneValueOf(n);
|
|
480
489
|
}
|
|
481
490
|
|
|
@@ -520,7 +529,7 @@ function supersede(e, n, s) {
|
|
|
520
529
|
for (let e = 0; e < t.tn.length && lanes.indexOf(t) !== -1; e++) {
|
|
521
530
|
const n = t.tn[e];
|
|
522
531
|
if (n.l & CONFIG_GUESS && n.T.Re === t) {
|
|
523
|
-
const e = n.
|
|
532
|
+
const e = n.ue !== NOT_PENDING ? n.ue : covered(n);
|
|
524
533
|
supersede(n, e, !n.xe || !n.xe(n.T.v, e));
|
|
525
534
|
}
|
|
526
535
|
}
|
|
@@ -546,9 +555,9 @@ function laneSeam(e, n) {
|
|
|
546
555
|
}
|
|
547
556
|
const t = s.T;
|
|
548
557
|
if (t.Re !== e) continue;
|
|
549
|
-
if (!(s.l & CONFIG_GUESS) && !s.i && s.
|
|
550
|
-
t.v = s.
|
|
551
|
-
s.
|
|
558
|
+
if (!(s.l & CONFIG_GUESS) && !s.i && s.ue !== NOT_PENDING) {
|
|
559
|
+
t.v = s.ue;
|
|
560
|
+
s.ue = NOT_PENDING;
|
|
552
561
|
}
|
|
553
562
|
// The frame this pass built is the screen's now; the one it replaced
|
|
554
563
|
// goes (as `commitPendingNode` retires a committed pass's).
|
|
@@ -598,10 +607,12 @@ function laneSeam(e, n) {
|
|
|
598
607
|
// question is the one being asked (`question`: a slice's, a derive's
|
|
599
608
|
// continuation's — the flight's); unstamped writes and mainline are
|
|
600
609
|
// current.
|
|
601
|
-
|
|
602
|
-
|
|
610
|
+
// A store re-bases a keyed arrangement guess over an older truth, and
|
|
611
|
+
// folds a current one beneath it (D-34): true.
|
|
612
|
+
const s = stale(e, question);
|
|
613
|
+
if (GlobalQueue.an?.(e, n, s) || s) {
|
|
614
|
+
e.ue = n;
|
|
603
615
|
e.l |= CONFIG_HELD;
|
|
604
|
-
GlobalQueue.an?.(e, n);
|
|
605
616
|
schedule();
|
|
606
617
|
return n;
|
|
607
618
|
}
|
|
@@ -609,7 +620,7 @@ function laneSeam(e, n) {
|
|
|
609
620
|
} else {
|
|
610
621
|
const s = txOf(e);
|
|
611
622
|
if (e.xe && e.xe(laneValueOf(e), n)) return n;
|
|
612
|
-
if (s.ke) e.
|
|
623
|
+
if (s.ke) e.ue = n; else e.T.v = n;
|
|
613
624
|
if (e.X !== undefined) e.ie = clock;
|
|
614
625
|
insertSubs(e);
|
|
615
626
|
laneDirty(e, s);
|
|
@@ -632,7 +643,7 @@ function laneSeam(e, n) {
|
|
|
632
643
|
* A24). The guess's own question answering supersedes as usual. */ function laneOutcome(e, n, s) {
|
|
633
644
|
if (s) return true;
|
|
634
645
|
if (stale(e, answered(e))) {
|
|
635
|
-
e.
|
|
646
|
+
e.ue = n;
|
|
636
647
|
e.l |= CONFIG_HELD;
|
|
637
648
|
return true;
|
|
638
649
|
}
|
package/dist/prod/core/owner.js
CHANGED
|
@@ -6,7 +6,7 @@ import { unobserved, clearDeps } from "./graph.js";
|
|
|
6
6
|
|
|
7
7
|
import { deleteFromHeap } from "./heap.js";
|
|
8
8
|
|
|
9
|
-
import { schedule, dirtyQueue } from "./scheduler.js";
|
|
9
|
+
import { globalQueue, schedule, dirtyQueue } from "./scheduler.js";
|
|
10
10
|
|
|
11
11
|
// L2 (step 2): the parked frame. A pass parks the previous frame's children
|
|
12
12
|
// and `_disposal` list on `_x._pendingFirstChild` / `_x._pendingDisposal`
|
|
@@ -35,17 +35,41 @@ function dispose(e) {
|
|
|
35
35
|
unobserved(e);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
// The first error a cleanup threw, boxed so a thrown `undefined` still
|
|
39
|
+
// counts. A throwing cleanup stops neither its siblings nor the rest of the
|
|
40
|
+
// tree: every cleanup runs. The error is rethrown once the teardown is over:
|
|
41
|
+
// by a root's dispose call outside a flush (`disposeRootSelf`), otherwise when
|
|
42
|
+
// the flush ends (`flush`; `runCleanup` schedules one), so a flush is never
|
|
43
|
+
// left half-applied. A halt drops it: the error that halted is the one
|
|
44
|
+
// reported, and a stale one must not surface from a later, unrelated dispose.
|
|
45
|
+
let cleanupError;
|
|
46
|
+
|
|
47
|
+
/** Runs a cleanup or `unobserved` hook; a throw is collected, not raised. @internal */ function runCleanup(e) {
|
|
48
|
+
try {
|
|
49
|
+
e();
|
|
50
|
+
} catch (e) {
|
|
51
|
+
cleanupError ||= [ e ];
|
|
52
|
+
schedule();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Rethrows the error `runCleanup` collected, once; `drop` discards it. @internal */ function rethrowCleanupError(e) {
|
|
57
|
+
const n = cleanupError;
|
|
58
|
+
cleanupError = undefined;
|
|
59
|
+
if (n && !e) throw n[0];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function disposeChildren(e, n = false, r) {
|
|
63
|
+
const t = e.R;
|
|
64
|
+
if (t & REACTIVE_DISPOSED) return;
|
|
41
65
|
// A parked frame dies with its owner (#3024): the commit that would retire
|
|
42
66
|
// it never comes once the node is DISPOSED, so it drains here or its
|
|
43
67
|
// cleanups never run and it stays subscribed, rerunning in a torn-down
|
|
44
68
|
// tree (#3561). Death only (`self`): a re-pass leaves the frame reacting
|
|
45
69
|
// until the commit.
|
|
46
|
-
if (n && !
|
|
70
|
+
if (n && !r && e.T !== null && (e.T.Ue !== null || e.T.me !== null)) disposeChildren(e, false, true);
|
|
47
71
|
if (n) {
|
|
48
|
-
e.R =
|
|
72
|
+
e.R = t | REACTIVE_DISPOSED;
|
|
49
73
|
}
|
|
50
74
|
if (n && e.X) {
|
|
51
75
|
if (e.T !== null) e.T.Se = null;
|
|
@@ -53,10 +77,10 @@ function disposeChildren(e, n = false, t) {
|
|
|
53
77
|
// flight's — a transaction's or a lane's (its `_x._transaction`) — or a
|
|
54
78
|
// stale reader's (REACTIVE_FRAME_READ — a frame that derived from one).
|
|
55
79
|
// Nothing else re-examines a dead node, so make sure a seam comes.
|
|
56
|
-
if (e.m & STATUS_PENDING && e.T?.Re != null ||
|
|
80
|
+
if (e.m & STATUS_PENDING && e.T?.Re != null || t & REACTIVE_FRAME_READ) schedule();
|
|
57
81
|
}
|
|
58
|
-
let l =
|
|
59
|
-
if (
|
|
82
|
+
let l = r ? e.T.Ue : e.De;
|
|
83
|
+
if (r) e.T.Ue = null; else e.De = null;
|
|
60
84
|
while (l) {
|
|
61
85
|
const e = l;
|
|
62
86
|
// Owner teardown is death regardless of the child's own lifecycle
|
|
@@ -88,34 +112,34 @@ function disposeChildren(e, n = false, t) {
|
|
|
88
112
|
// would still be holding.
|
|
89
113
|
l = l.pe;
|
|
90
114
|
}
|
|
91
|
-
if (!
|
|
115
|
+
if (!r) e.ye = 0;
|
|
92
116
|
// O(1) splice out of parent's chain on individual dispose. Skipped during
|
|
93
117
|
// batch dispose (parent already disposed) and for a zombie (it sits on the
|
|
94
118
|
// parent's parked frame, drained whole by the commit). We leave
|
|
95
119
|
// node._nextSibling intact so outer walks that already advanced past us
|
|
96
120
|
// still reach later siblings.
|
|
97
|
-
if (n && !
|
|
121
|
+
if (n && !r && !(t & REACTIVE_ZOMBIE) && e._parent !== null && !(e._parent.R & REACTIVE_DISPOSED)) {
|
|
98
122
|
const n = e.Ze;
|
|
99
|
-
const
|
|
100
|
-
if (n !== null) n.pe =
|
|
101
|
-
if (
|
|
123
|
+
const r = e.pe;
|
|
124
|
+
if (n !== null) n.pe = r; else e._parent.De = r;
|
|
125
|
+
if (r !== null) r.Ze = n;
|
|
102
126
|
e.Ze = null;
|
|
103
127
|
}
|
|
104
|
-
runDisposal(e,
|
|
128
|
+
runDisposal(e, r);
|
|
105
129
|
// Final effect-returned cleanup fires at true disposal, after `_disposal`
|
|
106
130
|
// to mirror rerun ordering (compute-phase teardown first, cleanup last).
|
|
107
131
|
if (n && e.Je) {
|
|
108
132
|
const n = e.Je;
|
|
109
133
|
e.Je = undefined;
|
|
110
|
-
n
|
|
134
|
+
runCleanup(n);
|
|
111
135
|
}
|
|
112
136
|
}
|
|
113
137
|
|
|
114
138
|
function linkChild(e, n) {
|
|
115
|
-
const
|
|
139
|
+
const r = e.De;
|
|
116
140
|
n.Ze = null;
|
|
117
|
-
n.pe =
|
|
118
|
-
if (
|
|
141
|
+
n.pe = r;
|
|
142
|
+
if (r !== null) r.Ze = n;
|
|
119
143
|
e.De = n;
|
|
120
144
|
}
|
|
121
145
|
|
|
@@ -126,27 +150,26 @@ function runDisposal(e, n) {
|
|
|
126
150
|
// walk ran every entry a second time. Detached, the re-entrant drain finds
|
|
127
151
|
// nothing. The same shape latched a throwing cleanup: the list survived the
|
|
128
152
|
// throw and every later drain re-ran and re-threw it.
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
153
|
+
const r = n ? e.T.me : e.He;
|
|
154
|
+
if (!r) return;
|
|
131
155
|
if (n) e.T.me = null; else e.He = null;
|
|
132
|
-
if (Array.isArray(
|
|
156
|
+
if (Array.isArray(r)) {
|
|
133
157
|
// Unwind order (#3572, restores 1.x #1562): later registrations run
|
|
134
158
|
// before earlier ones. Children have already been disposed by the caller,
|
|
135
159
|
// so with LIFO a body that registers cleanup before creating its children
|
|
136
160
|
// tears down after them — the same order a per-component owner gives.
|
|
137
|
-
for (let e =
|
|
138
|
-
|
|
139
|
-
n.call(n);
|
|
161
|
+
for (let e = r.length - 1; e >= 0; e--) {
|
|
162
|
+
runCleanup(r[e]);
|
|
140
163
|
}
|
|
141
164
|
} else {
|
|
142
|
-
|
|
165
|
+
runCleanup(r);
|
|
143
166
|
}
|
|
144
167
|
}
|
|
145
168
|
|
|
146
169
|
function childId(e, n) {
|
|
147
|
-
let
|
|
148
|
-
while (
|
|
149
|
-
if (
|
|
170
|
+
let r = e;
|
|
171
|
+
while (r.l & CONFIG_TRANSPARENT && r._parent) r = r._parent;
|
|
172
|
+
if (r.id != null) return formatId(r.id, n ? r.ye++ : r.ye);
|
|
150
173
|
throw new Error("");
|
|
151
174
|
}
|
|
152
175
|
|
|
@@ -163,8 +186,8 @@ function childId(e, n) {
|
|
|
163
186
|
* The id a freshly-created node inherits: an explicit `options.id` wins;
|
|
164
187
|
* transparent nodes share their parent's id; otherwise the parent's next
|
|
165
188
|
* child id is consumed (or `undefined` outside an id-carrying tree).
|
|
166
|
-
*/ function inheritId(e, n,
|
|
167
|
-
return e?.id ?? (n ?
|
|
189
|
+
*/ function inheritId(e, n, r) {
|
|
190
|
+
return e?.id ?? (n ? r?.id : r?.id != null ? getNextChildId(r) : undefined);
|
|
168
191
|
}
|
|
169
192
|
|
|
170
193
|
/**
|
|
@@ -177,8 +200,8 @@ function childId(e, n) {
|
|
|
177
200
|
}
|
|
178
201
|
|
|
179
202
|
function formatId(e, n) {
|
|
180
|
-
const
|
|
181
|
-
return e + (
|
|
203
|
+
const r = n.toString(36), t = r.length - 1;
|
|
204
|
+
return e + (t ? String.fromCharCode(64 + t) : "") + r;
|
|
182
205
|
}
|
|
183
206
|
|
|
184
207
|
/**
|
|
@@ -253,6 +276,9 @@ function formatId(e, n) {
|
|
|
253
276
|
|
|
254
277
|
function disposeRootSelf(e = true) {
|
|
255
278
|
disposeChildren(this, e);
|
|
279
|
+
// Outside a flush the dispose call rethrows; inside one, the flush does.
|
|
280
|
+
// Kept out of `disposeChildren`, whose hot path it slows.
|
|
281
|
+
if (cleanupError && !globalQueue.q) rethrowCleanupError();
|
|
256
282
|
}
|
|
257
283
|
|
|
258
284
|
/**
|
|
@@ -264,22 +290,22 @@ function disposeRootSelf(e = true) {
|
|
|
264
290
|
* @internal
|
|
265
291
|
*/ function createOwner(e) {
|
|
266
292
|
const n = context;
|
|
267
|
-
const
|
|
293
|
+
const r = e?.transparent ?? false;
|
|
268
294
|
// Prod and observe boilerplates (see core.ts computed()). The observe
|
|
269
295
|
// literal carries the `_name` and `_loc` slots the rendering layer fills
|
|
270
296
|
// with the component label and JSX site (`owner._name = "<App>"`,
|
|
271
297
|
// `owner._loc = "src/App.tsx:3:5"`) — slots, so labelling a root is a
|
|
272
298
|
// plain store rather than a shape fork between labelled and plain roots.
|
|
273
|
-
const
|
|
274
|
-
id: inheritId(e,
|
|
275
|
-
l:
|
|
299
|
+
const t = {
|
|
300
|
+
id: inheritId(e, r, n),
|
|
301
|
+
l: r ? CONFIG_TRANSPARENT : 0,
|
|
276
302
|
// Present from birth: disposeChildren marks death here on roots too, and
|
|
277
303
|
// a first store of a missing property is a shape transition plus a
|
|
278
304
|
// properties-store allocation per root — on a 100×4 table teardown that
|
|
279
305
|
// was 12 KB and most of disposal's time (2026-10-17).
|
|
280
306
|
R: REACTIVE_NONE,
|
|
281
|
-
|
|
282
|
-
Ye: n?.
|
|
307
|
+
Qe: true,
|
|
308
|
+
Ye: n?.Qe ? n.Ye : n,
|
|
283
309
|
De: null,
|
|
284
310
|
pe: null,
|
|
285
311
|
Ze: null,
|
|
@@ -290,8 +316,8 @@ function disposeRootSelf(e = true) {
|
|
|
290
316
|
_parent: n,
|
|
291
317
|
dispose: disposeRootSelf
|
|
292
318
|
};
|
|
293
|
-
if (n) linkChild(n,
|
|
294
|
-
return
|
|
319
|
+
if (n) linkChild(n, t);
|
|
320
|
+
return t;
|
|
295
321
|
}
|
|
296
322
|
|
|
297
323
|
/**
|
|
@@ -329,11 +355,11 @@ function disposeRootSelf(e = true) {
|
|
|
329
355
|
*
|
|
330
356
|
* @description https://v2.solidjs.com/reference/solid-js/advanced/owner-introspection/create-root
|
|
331
357
|
*/ function createRoot(e, n) {
|
|
332
|
-
const
|
|
358
|
+
const r = createOwner(n);
|
|
333
359
|
// A bound function, not an arrow: an arrow would share this scope, which
|
|
334
360
|
// holds `init`, so keeping `dispose` would keep `init` and all it closes
|
|
335
361
|
// over alive (#4095).
|
|
336
|
-
return runWithOwner(
|
|
362
|
+
return runWithOwner(r, () => e(disposeRootSelf.bind(r, true)));
|
|
337
363
|
}
|
|
338
364
|
|
|
339
|
-
export { cleanup, createOwner, createRoot, dispose, disposeChildren, getNextChildId, getObserver, getOwner, inheritId, isDisposed, linkChild, markDisposal, peekNextChildId };
|
|
365
|
+
export { cleanup, createOwner, createRoot, dispose, disposeChildren, getNextChildId, getObserver, getOwner, inheritId, isDisposed, linkChild, markDisposal, peekNextChildId, rethrowCleanupError, runCleanup };
|