@solidjs/signals 2.0.0-rc.14 → 2.0.0-rc.16
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 +882 -405
- package/dist/dev.attribution.js +172 -66
- package/dist/dev.js +1529 -745
- package/dist/observe/affects-marks.js +86 -0
- package/dist/observe/affects.js +32 -80
- package/dist/observe/boundaries.js +202 -166
- package/dist/observe/core/async.js +192 -141
- package/dist/observe/core/attribution-queries.js +1 -1
- package/dist/observe/core/attribution.js +315 -214
- package/dist/observe/core/constants.js +23 -4
- package/dist/observe/core/context.js +3 -3
- package/dist/observe/core/core.js +532 -360
- package/dist/observe/core/dev.js +63 -35
- package/dist/observe/core/effect.js +47 -47
- package/dist/observe/core/error.js +5 -3
- package/dist/observe/core/external.js +5 -6
- package/dist/observe/core/graph.js +56 -42
- package/dist/observe/core/heap.js +33 -33
- package/dist/observe/core/identities.js +62 -0
- package/dist/observe/core/lanes.js +242 -229
- package/dist/observe/core/owner.js +62 -50
- package/dist/observe/core/scheduler.js +322 -168
- package/dist/observe/core/truth.js +45 -0
- package/dist/observe/core/verdict.js +114 -64
- package/dist/observe/deferred.js +184 -0
- package/dist/observe/index.js +7 -1
- package/dist/observe/map.js +339 -254
- package/dist/observe/reveal.js +77 -77
- package/dist/observe/signals.js +54 -33
- package/dist/observe/store/affects.js +76 -69
- package/dist/observe/store/edges.js +39 -0
- package/dist/observe/store/hooks.js +13 -0
- package/dist/observe/store/index.js +0 -2
- package/dist/observe/store/optimistic.js +82 -44
- package/dist/observe/store/projection.js +83 -64
- package/dist/observe/store/reconcile.js +32 -30
- package/dist/observe/store/store.js +219 -123
- package/dist/prod/affects-marks.js +86 -0
- package/dist/prod/affects.js +33 -79
- package/dist/prod/boundaries.js +185 -149
- package/dist/prod/core/async.js +176 -135
- package/dist/prod/core/constants.js +23 -4
- package/dist/prod/core/context.js +3 -3
- package/dist/prod/core/core.js +521 -353
- package/dist/prod/core/effect.js +66 -66
- package/dist/prod/core/error.js +5 -3
- package/dist/prod/core/external.js +5 -6
- package/dist/prod/core/graph.js +56 -42
- package/dist/prod/core/heap.js +38 -38
- package/dist/prod/core/identities.js +62 -0
- package/dist/prod/core/lanes.js +237 -224
- package/dist/prod/core/owner.js +62 -51
- package/dist/prod/core/scheduler.js +312 -158
- package/dist/prod/core/truth.js +45 -0
- package/dist/prod/core/verdict.js +113 -63
- package/dist/prod/deferred.js +182 -0
- package/dist/prod/index.js +7 -1
- package/dist/prod/map.js +366 -281
- package/dist/prod/reveal.js +77 -77
- package/dist/prod/signals.js +59 -38
- package/dist/prod/store/affects.js +76 -69
- package/dist/prod/store/edges.js +39 -0
- package/dist/prod/store/hooks.js +13 -0
- package/dist/prod/store/index.js +0 -2
- package/dist/prod/store/optimistic.js +121 -84
- package/dist/prod/store/projection.js +46 -34
- package/dist/prod/store/reconcile.js +32 -30
- package/dist/prod/store/store.js +205 -116
- package/dist/types/affects-marks.d.ts +14 -0
- package/dist/types/boundaries.d.ts +5 -1
- package/dist/types/core/async.d.ts +10 -0
- package/dist/types/core/attribution.d.ts +6 -2
- package/dist/types/core/constants.d.ts +18 -1
- package/dist/types/core/core.d.ts +77 -5
- package/dist/types/core/dev.d.ts +43 -13
- package/dist/types/core/graph.d.ts +11 -0
- package/dist/types/core/identities.d.ts +17 -0
- package/dist/types/core/index.d.ts +2 -1
- package/dist/types/core/lanes.d.ts +2 -4
- package/dist/types/core/owner.d.ts +5 -3
- package/dist/types/core/scheduler.d.ts +59 -34
- package/dist/types/core/truth.d.ts +16 -0
- package/dist/types/core/types.d.ts +21 -6
- package/dist/types/core/verdict.d.ts +32 -0
- package/dist/types/deferred.d.ts +28 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/map.d.ts +2 -2
- package/dist/types/signals.d.ts +28 -7
- package/dist/types/store/affects.d.ts +11 -0
- package/dist/types/store/edges.d.ts +9 -0
- package/dist/types/store/hooks.d.ts +48 -0
- package/dist/types/store/index.d.ts +10 -4
- package/dist/types/store/optimistic.d.ts +3 -2
- package/dist/types/store/projection.d.ts +4 -3
- package/dist/types/store/store.d.ts +4 -39
- package/dist/types/store/target.d.ts +16 -8
- package/dist/types/store/types.d.ts +14 -0
- package/package.json +1 -1
|
@@ -2,7 +2,9 @@ import { isEqual } from "../core/core.js";
|
|
|
2
2
|
|
|
3
3
|
import { isOwned, $OWNER, storeLookup, lookupTarget } from "./target.js";
|
|
4
4
|
|
|
5
|
-
import { userWriting,
|
|
5
|
+
import { userWriting, unwrapValue, adoptPB, sameKey, materializePB, notifyFold, sameRow, targetsEqual, bumpDeep, notifyKeyValue, notifyKeyDiff, notifyFoldTail, hasAccessorFlag } from "./store.js";
|
|
6
|
+
|
|
7
|
+
import { optHooks } from "./hooks.js";
|
|
6
8
|
|
|
7
9
|
import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "./types.js";
|
|
8
10
|
|
|
@@ -73,33 +75,33 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
73
75
|
// — key matching from the arrangement the guesses made (R28), so a row
|
|
74
76
|
// the guess added keeps its proxy when the server returns it.
|
|
75
77
|
const i = l?.opt === true ? optHooks.view(e, f) : f;
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
+
const s = Array.isArray(n);
|
|
79
|
+
const u = e.s === true;
|
|
78
80
|
const r = f;
|
|
79
81
|
adoptPB(e, n, false);
|
|
80
|
-
if (
|
|
81
|
-
if (Array.isArray(i) !==
|
|
82
|
+
if (u) markRawIngest(n);
|
|
83
|
+
if (Array.isArray(i) !== s) {
|
|
82
84
|
notifyFold(e, r, n);
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
85
|
-
if (
|
|
87
|
+
if (s) {
|
|
86
88
|
const f = i;
|
|
87
|
-
const
|
|
89
|
+
const s = n;
|
|
88
90
|
const a = e.n;
|
|
89
91
|
let c = 0;
|
|
90
|
-
if (t && !
|
|
92
|
+
if (t && !u) {
|
|
91
93
|
const i = f.length;
|
|
92
|
-
const
|
|
94
|
+
const u = s.length;
|
|
93
95
|
let d = false;
|
|
94
96
|
let p = 0;
|
|
95
97
|
// Aligned prefix: same row (by reference or key) at the same index.
|
|
96
|
-
for (const y = Math.min(i,
|
|
97
|
-
const i =
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
98
|
+
for (const y = Math.min(i, u); p < y; p++) {
|
|
99
|
+
const i = s[p];
|
|
100
|
+
const u = f[p];
|
|
101
|
+
if (u !== i && !sameRow(u, i, t)) break;
|
|
100
102
|
// misaligned: fall to the keyed remainder below
|
|
101
|
-
if ((
|
|
102
|
-
if (e.dk !== null && !d && !(i !== null && typeof i === "object" ? targetsEqual(
|
|
103
|
+
if ((u !== i || i !== null && typeof i === "object" && isOwned(i)) && i !== null && typeof i === "object") descend(unwrapValue(u), i, t, l, o);
|
|
104
|
+
if (e.dk !== null && !d && !(i !== null && typeof i === "object" ? targetsEqual(u, i) : isEqual(u, i))) {
|
|
103
105
|
bumpDeep(e);
|
|
104
106
|
d = true;
|
|
105
107
|
}
|
|
@@ -111,12 +113,12 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
}
|
|
114
|
-
if (e.dk !== null && !d && p <
|
|
116
|
+
if (e.dk !== null && !d && p < s.length) bumpDeep(e);
|
|
115
117
|
const y = p;
|
|
116
118
|
// misalignment point (== nlen on aligned ticks)
|
|
117
119
|
let w = null;
|
|
118
|
-
for (;p <
|
|
119
|
-
const e =
|
|
120
|
+
for (;p < s.length; p++) {
|
|
121
|
+
const e = s[p];
|
|
120
122
|
if (e !== null && typeof e === "object") {
|
|
121
123
|
const n = t(e);
|
|
122
124
|
let i;
|
|
@@ -156,12 +158,12 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
160
|
} else {
|
|
159
|
-
const i = Math.min(f.length,
|
|
160
|
-
const d =
|
|
161
|
+
const i = Math.min(f.length, s.length);
|
|
162
|
+
const d = s.length;
|
|
161
163
|
let p = false;
|
|
162
164
|
for (let y = 0; y < d; y++) {
|
|
163
|
-
const d =
|
|
164
|
-
if (!
|
|
165
|
+
const d = s[y];
|
|
166
|
+
if (!u && y < i && d !== null && typeof d === "object") descend(unwrapValue(f[y]), d, t, l, o);
|
|
165
167
|
if (e.dk !== null && !p && !(d !== null && typeof d === "object" ? targetsEqual(f[y], d) : isEqual(f[y], d))) {
|
|
166
168
|
bumpDeep(e);
|
|
167
169
|
p = true;
|
|
@@ -179,7 +181,7 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
179
181
|
if (a !== null && c < e.nc) {
|
|
180
182
|
for (const e of Reflect.ownKeys(a)) {
|
|
181
183
|
const t = typeof e === "string" ? +e : NaN;
|
|
182
|
-
if (!(t >= 0 && t <
|
|
184
|
+
if (!(t >= 0 && t < s.length)) notifyKeyDiff(a[e], e, r, n, false);
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
notifyFoldTail(e, r, n);
|
|
@@ -189,15 +191,15 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
189
191
|
let c = 0;
|
|
190
192
|
let d = false;
|
|
191
193
|
for (const f in n) {
|
|
192
|
-
const
|
|
194
|
+
const s = n[f];
|
|
193
195
|
const p = r[f];
|
|
194
|
-
const y =
|
|
195
|
-
if (p ===
|
|
196
|
+
const y = s !== null && typeof s === "object";
|
|
197
|
+
if (p === s && (!y || !isOwned(s)) && (a === null || a[f] === undefined || !hasAccessorFlag(a[f]))) {
|
|
196
198
|
if (a !== null && a[f] !== undefined) c++;
|
|
197
199
|
continue;
|
|
198
200
|
}
|
|
199
|
-
if (y && !
|
|
200
|
-
if (e.dk !== null && !d && !(y ? targetsEqual(p,
|
|
201
|
+
if (y && !u) descend(unwrapValue(i[f]), s, t, l, o);
|
|
202
|
+
if (e.dk !== null && !d && !(y ? targetsEqual(p, s) : isEqual(p, s))) {
|
|
201
203
|
bumpDeep(e);
|
|
202
204
|
d = true;
|
|
203
205
|
}
|
|
@@ -205,7 +207,7 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
205
207
|
const e = a[f];
|
|
206
208
|
if (e !== undefined) {
|
|
207
209
|
c++;
|
|
208
|
-
notifyKeyValue(e, f, p,
|
|
210
|
+
notifyKeyValue(e, f, p, s, r, n);
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
213
|
}
|
|
@@ -214,7 +216,7 @@ import { $TARGET, markRawIngest, isWrappable, rawValuesUsed, isRawValue } from "
|
|
|
214
216
|
const f = p[e];
|
|
215
217
|
if (f === $OWNER) continue;
|
|
216
218
|
const i = n[f];
|
|
217
|
-
if (!
|
|
219
|
+
if (!u && i !== null && typeof i === "object") descend(unwrapValue(r[f]), i, t, l, o);
|
|
218
220
|
if (a !== null) {
|
|
219
221
|
const e = a[f];
|
|
220
222
|
if (e !== undefined) {
|