@solidjs/signals 2.0.0-rc.19 → 2.0.0-rc.20
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 +553 -264
- package/dist/dev.attribution.js +18 -18
- package/dist/dev.js +1030 -439
- package/dist/observe/affects.js +12 -2
- package/dist/observe/boundaries.js +168 -115
- package/dist/observe/core/async.js +57 -37
- package/dist/observe/core/attribution.js +6 -6
- package/dist/observe/core/constants.js +9 -1
- package/dist/observe/core/copies.js +10 -0
- package/dist/observe/core/core.js +261 -181
- package/dist/observe/core/effect.js +32 -27
- package/dist/observe/core/graph.js +7 -7
- package/dist/observe/core/heap.js +29 -29
- package/dist/observe/core/lanes.js +301 -101
- package/dist/observe/core/owner.js +13 -13
- package/dist/observe/core/scheduler.js +124 -69
- package/dist/observe/core/truth.js +9 -7
- package/dist/observe/core/verdict.js +160 -98
- package/dist/observe/deferred.js +1 -1
- package/dist/observe/index.js +2 -0
- package/dist/observe/map.js +120 -116
- package/dist/observe/reveal.js +48 -48
- package/dist/observe/signals.js +5 -5
- package/dist/observe/store/affects.js +2 -2
- package/dist/observe/store/optimistic.js +272 -176
- package/dist/observe/store/projection.js +21 -10
- package/dist/observe/store/reconcile.js +8 -2
- package/dist/observe/store/store.js +91 -55
- package/dist/observe/store/types.js +11 -1
- package/dist/observe/store/utils.js +1 -1
- package/dist/prod/affects.js +12 -2
- package/dist/prod/boundaries.js +164 -109
- package/dist/prod/core/async.js +201 -181
- package/dist/prod/core/constants.js +9 -1
- package/dist/prod/core/copies.js +10 -0
- package/dist/prod/core/core.js +244 -164
- package/dist/prod/core/dev.js +108 -3
- package/dist/prod/core/effect.js +28 -23
- package/dist/prod/core/graph.js +9 -9
- package/dist/prod/core/heap.js +16 -16
- package/dist/prod/core/identities.js +1 -1
- package/dist/prod/core/lanes.js +307 -95
- package/dist/prod/core/owner.js +22 -22
- package/dist/prod/core/scheduler.js +266 -211
- package/dist/prod/core/truth.js +9 -7
- package/dist/prod/core/verdict.js +161 -99
- package/dist/prod/deferred.js +1 -1
- package/dist/prod/index.js +2 -0
- package/dist/prod/map.js +78 -74
- package/dist/prod/reveal.js +34 -34
- package/dist/prod/signals.js +3 -3
- package/dist/prod/store/affects.js +15 -15
- package/dist/prod/store/optimistic.js +185 -89
- package/dist/prod/store/projection.js +49 -38
- package/dist/prod/store/reconcile.js +8 -2
- package/dist/prod/store/store.js +99 -63
- package/dist/prod/store/types.js +11 -1
- package/dist/types/affects.d.ts +3 -2
- package/dist/types/boundaries.d.ts +14 -2
- package/dist/types/core/async.d.ts +2 -1
- package/dist/types/core/constants.d.ts +8 -0
- package/dist/types/core/copies.d.ts +54 -0
- package/dist/types/core/core.d.ts +15 -0
- package/dist/types/core/dev.d.ts +1 -1
- package/dist/types/core/lanes.d.ts +8 -1
- package/dist/types/core/scheduler.d.ts +36 -4
- package/dist/types/core/truth.d.ts +3 -1
- package/dist/types/core/types.d.ts +6 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/store/hooks.d.ts +15 -1
- package/dist/types/store/store.d.ts +2 -1
- package/dist/types/store/target.d.ts +5 -0
- package/dist/types/store/types.d.ts +7 -0
- package/package.json +1 -1
package/dist/prod/core/owner.js
CHANGED
|
@@ -67,7 +67,7 @@ function disposeChildren(e, n = false, r) {
|
|
|
67
67
|
// cleanups never run and it stays subscribed, rerunning in a torn-down
|
|
68
68
|
// tree (#3561). Death only (`self`): a re-pass leaves the frame reacting
|
|
69
69
|
// until the commit.
|
|
70
|
-
if (n && !r && e.T !== null && (e.T.
|
|
70
|
+
if (n && !r && e.T !== null && (e.T.me !== null || e.T.Le !== null)) disposeChildren(e, false, true);
|
|
71
71
|
if (n) {
|
|
72
72
|
e.R = t | REACTIVE_DISPOSED;
|
|
73
73
|
}
|
|
@@ -80,8 +80,8 @@ function disposeChildren(e, n = false, r) {
|
|
|
80
80
|
// Nothing else re-examines a dead node, so make sure a seam comes.
|
|
81
81
|
if (e.m & STATUS_PENDING && e.T?.Re != null || t & REACTIVE_FRAME_READ || pendingNodes.length) schedule();
|
|
82
82
|
}
|
|
83
|
-
let l = r ? e.T.
|
|
84
|
-
if (r) e.T.
|
|
83
|
+
let l = r ? e.T.me : e.pe;
|
|
84
|
+
if (r) e.T.me = null; else e.pe = null;
|
|
85
85
|
while (l) {
|
|
86
86
|
const e = l;
|
|
87
87
|
// Owner teardown is death regardless of the child's own lifecycle
|
|
@@ -105,7 +105,7 @@ function disposeChildren(e, n = false, r) {
|
|
|
105
105
|
// on the fresh head and survives. Pointing each drained child's prev at
|
|
106
106
|
// itself routes its later splice onto the detached chain, never the head,
|
|
107
107
|
// and keeps the dev owner-chain-head invariant honest for those children.
|
|
108
|
-
l.
|
|
108
|
+
l.we = l;
|
|
109
109
|
disposeChildren(l, true);
|
|
110
110
|
// Read after, not before: a sibling this disposal made dormant spliced
|
|
111
111
|
// itself out of the detached chain, and a cleanup may then have linked
|
|
@@ -113,34 +113,34 @@ function disposeChildren(e, n = false, r) {
|
|
|
113
113
|
// would still be holding.
|
|
114
114
|
l = l.Ge;
|
|
115
115
|
}
|
|
116
|
-
if (!r) e.
|
|
116
|
+
if (!r) e.be = 0;
|
|
117
117
|
// O(1) splice out of parent's chain on individual dispose. Skipped during
|
|
118
118
|
// batch dispose (parent already disposed) and for a zombie (it sits on the
|
|
119
119
|
// parent's parked frame, drained whole by the commit). We leave
|
|
120
120
|
// node._nextSibling intact so outer walks that already advanced past us
|
|
121
121
|
// still reach later siblings.
|
|
122
122
|
if (n && !r && !(t & REACTIVE_ZOMBIE) && e._parent !== null && !(e._parent.R & REACTIVE_DISPOSED)) {
|
|
123
|
-
const n = e.
|
|
123
|
+
const n = e.we;
|
|
124
124
|
const r = e.Ge;
|
|
125
125
|
if (n !== null) n.Ge = r; else e._parent.pe = r;
|
|
126
|
-
if (r !== null) r.
|
|
127
|
-
e.
|
|
126
|
+
if (r !== null) r.we = n;
|
|
127
|
+
e.we = null;
|
|
128
128
|
}
|
|
129
129
|
runDisposal(e, r);
|
|
130
130
|
// Final effect-returned cleanup fires at true disposal, after `_disposal`
|
|
131
131
|
// to mirror rerun ordering (compute-phase teardown first, cleanup last).
|
|
132
|
-
if (n && e.
|
|
133
|
-
const n = e.
|
|
134
|
-
e.
|
|
132
|
+
if (n && e.ze) {
|
|
133
|
+
const n = e.ze;
|
|
134
|
+
e.ze = undefined;
|
|
135
135
|
runCleanup(n);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
function linkChild(e, n) {
|
|
140
140
|
const r = e.pe;
|
|
141
|
-
n.
|
|
141
|
+
n.we = null;
|
|
142
142
|
n.Ge = r;
|
|
143
|
-
if (r !== null) r.
|
|
143
|
+
if (r !== null) r.we = n;
|
|
144
144
|
e.pe = n;
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -151,9 +151,9 @@ function runDisposal(e, n) {
|
|
|
151
151
|
// walk ran every entry a second time. Detached, the re-entrant drain finds
|
|
152
152
|
// nothing. The same shape latched a throwing cleanup: the list survived the
|
|
153
153
|
// throw and every later drain re-ran and re-threw it.
|
|
154
|
-
const r = n ? e.T.
|
|
154
|
+
const r = n ? e.T.Le : e.ke;
|
|
155
155
|
if (!r) return;
|
|
156
|
-
if (n) e.T.
|
|
156
|
+
if (n) e.T.Le = null; else e.ke = null;
|
|
157
157
|
if (Array.isArray(r)) {
|
|
158
158
|
// Unwind order (#3572, restores 1.x #1562): later registrations run
|
|
159
159
|
// before earlier ones. Children have already been disposed by the caller,
|
|
@@ -170,7 +170,7 @@ function runDisposal(e, n) {
|
|
|
170
170
|
function childId(e, n) {
|
|
171
171
|
let r = e;
|
|
172
172
|
while (r.l & CONFIG_TRANSPARENT && r._parent) r = r._parent;
|
|
173
|
-
if (r.id != null) return formatId(r.id, n ? r.
|
|
173
|
+
if (r.id != null) return formatId(r.id, n ? r.be++ : r.be);
|
|
174
174
|
throw new Error("");
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -252,7 +252,7 @@ function formatId(e, n) {
|
|
|
252
252
|
* one.
|
|
253
253
|
*/ function cleanup(e, n = context) {
|
|
254
254
|
if (!n) return e;
|
|
255
|
-
if (!n.
|
|
255
|
+
if (!n.ke) n.ke = e; else if (Array.isArray(n.ke)) n.ke.push(e); else n.ke = [ n.ke, e ];
|
|
256
256
|
return e;
|
|
257
257
|
}
|
|
258
258
|
|
|
@@ -279,7 +279,7 @@ function disposeRootSelf(e = true) {
|
|
|
279
279
|
disposeChildren(this, e);
|
|
280
280
|
// Outside a flush the dispose call rethrows; inside one, the flush does.
|
|
281
281
|
// Kept out of `disposeChildren`, whose hot path it slows.
|
|
282
|
-
if (cleanupError && !globalQueue.
|
|
282
|
+
if (cleanupError && !globalQueue.Y) rethrowCleanupError();
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
/**
|
|
@@ -306,13 +306,13 @@ function disposeRootSelf(e = true) {
|
|
|
306
306
|
// was 12 KB and most of disposal's time (2026-10-17).
|
|
307
307
|
R: REACTIVE_NONE,
|
|
308
308
|
Qe: true,
|
|
309
|
-
|
|
309
|
+
Ke: n?.Qe ? n.Ke : n,
|
|
310
310
|
pe: null,
|
|
311
311
|
Ge: null,
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
we: null,
|
|
313
|
+
ke: null,
|
|
314
314
|
A: n?.A || defaultContext,
|
|
315
|
-
|
|
315
|
+
be: 0,
|
|
316
316
|
T: null,
|
|
317
317
|
_parent: n,
|
|
318
318
|
dispose: disposeRootSelf
|