@solidjs/signals 2.0.0-rc.13 → 2.0.0-rc.14
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 +2000 -3768
- package/dist/dev.attribution.js +132 -79
- package/dist/dev.js +7226 -8488
- package/dist/observe/affects.js +125 -104
- package/dist/observe/boundaries.js +458 -665
- package/dist/observe/core/action.js +63 -66
- package/dist/observe/core/async.js +240 -383
- package/dist/observe/core/attribution-queries.js +1 -1
- package/dist/observe/core/attribution.js +240 -183
- package/dist/observe/core/constants.js +115 -187
- package/dist/observe/core/context.js +3 -3
- package/dist/observe/core/core.js +840 -1438
- package/dist/observe/core/dev.js +3 -3
- package/dist/observe/core/effect.js +75 -86
- package/dist/observe/core/external.js +5 -5
- package/dist/observe/core/graph.js +61 -70
- package/dist/observe/core/heap.js +75 -98
- package/dist/observe/core/invariants.js +1 -34
- package/dist/observe/core/lanes.js +704 -181
- package/dist/observe/core/owner.js +80 -101
- package/dist/observe/core/scheduler.js +708 -1351
- package/dist/observe/core/verdict.js +302 -621
- package/dist/observe/flatten.js +79 -0
- package/dist/observe/index.js +15 -13
- package/dist/observe/map.js +232 -235
- package/dist/observe/reveal.js +212 -0
- package/dist/observe/signals.js +133 -215
- package/dist/observe/store/affects.js +135 -0
- package/dist/observe/store/index.js +29 -24
- package/dist/observe/store/optimistic.js +538 -0
- package/dist/observe/store/projection.js +302 -0
- package/dist/observe/store/reconcile.js +257 -0
- package/dist/observe/store/store.js +1945 -277
- package/dist/observe/store/storePath.js +1 -1
- package/dist/{prod/store/next → observe/store}/target.js +17 -18
- package/dist/observe/store/types.js +73 -0
- package/dist/observe/store/utils.js +1 -13
- package/dist/prod/affects.js +127 -106
- package/dist/prod/boundaries.js +442 -654
- package/dist/prod/core/action.js +71 -74
- package/dist/prod/core/async.js +307 -442
- package/dist/prod/core/constants.js +112 -186
- package/dist/prod/core/context.js +3 -3
- package/dist/prod/core/core.js +852 -1458
- package/dist/prod/core/effect.js +88 -99
- package/dist/prod/core/external.js +5 -5
- package/dist/prod/core/graph.js +61 -70
- package/dist/prod/core/heap.js +75 -98
- package/dist/prod/core/invariants.js +1 -32
- package/dist/prod/core/lanes.js +666 -181
- package/dist/prod/core/owner.js +75 -96
- package/dist/prod/core/scheduler.js +677 -1332
- package/dist/prod/core/verdict.js +297 -621
- package/dist/prod/flatten.js +77 -0
- package/dist/prod/index.js +15 -13
- package/dist/prod/map.js +143 -146
- package/dist/prod/reveal.js +212 -0
- package/dist/prod/signals.js +144 -226
- package/dist/prod/store/affects.js +135 -0
- package/dist/prod/store/index.js +28 -19
- package/dist/prod/store/optimistic.js +533 -0
- package/dist/prod/store/projection.js +295 -0
- package/dist/prod/store/reconcile.js +257 -0
- package/dist/prod/store/store.js +1840 -272
- package/dist/prod/store/storePath.js +1 -1
- package/dist/{observe/store/next → prod/store}/target.js +13 -17
- package/dist/prod/store/types.js +73 -0
- package/dist/prod/store/utils.js +1 -11
- package/dist/types/affects.d.ts +11 -30
- package/dist/types/boundaries.d.ts +62 -176
- package/dist/types/carved.d.ts +1 -0
- package/dist/types/core/action.d.ts +5 -6
- package/dist/types/core/async.d.ts +10 -5
- package/dist/types/core/attribution-hooks.d.ts +20 -1
- package/dist/types/core/attribution.d.ts +20 -9
- package/dist/types/core/constants.d.ts +125 -180
- package/dist/types/core/core.d.ts +104 -264
- package/dist/types/core/dev.d.ts +2 -2
- package/dist/types/core/effect.d.ts +0 -7
- package/dist/types/core/graph.d.ts +7 -1
- package/dist/types/core/heap.d.ts +5 -7
- package/dist/types/core/index.d.ts +5 -5
- package/dist/types/core/invariants.d.ts +0 -29
- package/dist/types/core/lanes.d.ts +65 -87
- package/dist/types/core/owner.d.ts +3 -3
- package/dist/types/core/scheduler.d.ts +249 -331
- package/dist/types/core/types.d.ts +51 -85
- package/dist/types/core/verdict.d.ts +3 -0
- package/dist/types/flatten.d.ts +8 -0
- package/dist/types/index.d.ts +6 -4
- package/dist/types/reveal.d.ts +19 -0
- package/dist/types/signals.d.ts +35 -91
- package/dist/types/store/affects.d.ts +1 -0
- package/dist/types/store/index.d.ts +35 -15
- package/dist/types/store/optimistic.d.ts +23 -0
- package/dist/types/store/projection.d.ts +18 -0
- package/dist/types/store/reconcile.d.ts +3 -0
- package/dist/types/store/store.d.ts +165 -143
- package/dist/types/store/storePath.d.ts +1 -1
- package/dist/types/store/target.d.ts +151 -0
- package/dist/types/store/types.d.ts +84 -0
- package/package.json +1 -1
- package/dist/observe/core/optimistic.js +0 -669
- package/dist/observe/store/next/optimistic.js +0 -717
- package/dist/observe/store/next/projection.js +0 -266
- package/dist/observe/store/next/reconcile.js +0 -375
- package/dist/observe/store/next/store.js +0 -2608
- package/dist/prod/core/optimistic.js +0 -658
- package/dist/prod/store/next/optimistic.js +0 -710
- package/dist/prod/store/next/projection.js +0 -257
- package/dist/prod/store/next/reconcile.js +0 -373
- package/dist/prod/store/next/store.js +0 -2484
- package/dist/types/core/optimistic.d.ts +0 -6
- package/dist/types/store/next/optimistic.d.ts +0 -25
- package/dist/types/store/next/projection.d.ts +0 -27
- package/dist/types/store/next/reconcile.d.ts +0 -10
- package/dist/types/store/next/store.d.ts +0 -145
- package/dist/types/store/next/target.d.ts +0 -196
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { NotReadyError } from "./core/error.js";
|
|
2
|
+
|
|
3
|
+
import "./core/verdict.js";
|
|
4
|
+
|
|
5
|
+
import "./core/core.js";
|
|
6
|
+
|
|
7
|
+
import "./core/dev.js";
|
|
8
|
+
|
|
9
|
+
import "./core/scheduler.js";
|
|
10
|
+
|
|
11
|
+
import "./core/effect.js";
|
|
12
|
+
|
|
13
|
+
// CARVE 4: `flatten` lived in boundaries.ts but is the general children
|
|
14
|
+
// resolver the renderers (`web`, `universal`, `solid`'s `children()`) walk
|
|
15
|
+
// through — not a boundary feature. Moved verbatim so the boundary carve
|
|
16
|
+
// measures boundaries alone.
|
|
17
|
+
/**
|
|
18
|
+
* Resolves nested accessors and arrays in a children tree to their rendered
|
|
19
|
+
* values. See the `children()` helper in solid-js for the memoized form.
|
|
20
|
+
*/
|
|
21
|
+
function flatten(r, t) {
|
|
22
|
+
if (typeof r === "function" && !r.length) {
|
|
23
|
+
if (t?.doNotUnwrap) return r;
|
|
24
|
+
do {
|
|
25
|
+
r = r();
|
|
26
|
+
} while (typeof r === "function" && !r.length);
|
|
27
|
+
}
|
|
28
|
+
if (t?.skipNonRendered && (r == null || r === true || r === false || r === "")) return;
|
|
29
|
+
if (Array.isArray(r)) {
|
|
30
|
+
let e = [];
|
|
31
|
+
if (flattenArray(r, e, t)) {
|
|
32
|
+
return () => {
|
|
33
|
+
let r = [];
|
|
34
|
+
flattenArray(e, r, {
|
|
35
|
+
...t,
|
|
36
|
+
doNotUnwrap: false
|
|
37
|
+
});
|
|
38
|
+
return r;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return e;
|
|
42
|
+
}
|
|
43
|
+
return r;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function flattenArray(r, t = [], e) {
|
|
47
|
+
let o = null;
|
|
48
|
+
let f = false;
|
|
49
|
+
for (let n = 0; n < r.length; n++) {
|
|
50
|
+
try {
|
|
51
|
+
let o = r[n];
|
|
52
|
+
if (typeof o === "function" && !o.length) {
|
|
53
|
+
if (e?.doNotUnwrap) {
|
|
54
|
+
t.push(o);
|
|
55
|
+
f = true;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
do {
|
|
59
|
+
o = o();
|
|
60
|
+
} while (typeof o === "function" && !o.length);
|
|
61
|
+
}
|
|
62
|
+
if (Array.isArray(o)) {
|
|
63
|
+
// OR, don't overwrite: an accessor already pushed under doNotUnwrap
|
|
64
|
+
// still needs the resolving wrapper even when a later sibling
|
|
65
|
+
// fragment contains no functions (#3133).
|
|
66
|
+
f = flattenArray(o, t, e) || f;
|
|
67
|
+
} else if (e?.skipNonRendered && (o == null || o === true || o === false || o === "")) {
|
|
68
|
+
// skip
|
|
69
|
+
} else t.push(o);
|
|
70
|
+
} catch (r) {
|
|
71
|
+
if (!(r instanceof NotReadyError)) throw r;
|
|
72
|
+
o = r;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (o) throw o;
|
|
76
|
+
return f;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { flatten };
|
package/dist/observe/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export { ContextNotFoundError, NoOwnerError, NotReadyError, TimeoutError } from "./core/error.js";
|
|
2
2
|
|
|
3
|
+
export { isPending, latest } from "./core/verdict.js";
|
|
4
|
+
|
|
5
|
+
export { action } from "./core/action.js";
|
|
6
|
+
|
|
3
7
|
export { clearSnapshots, isEqual, markSnapshotScope, releaseSnapshotScope, runWithOwner, setSnapshotCapture, untrack } from "./core/core.js";
|
|
4
8
|
|
|
5
9
|
export { enableExternalSource } from "./core/external.js";
|
|
@@ -10,41 +14,39 @@ export { createContext, getContext, setContext } from "./core/context.js";
|
|
|
10
14
|
|
|
11
15
|
export { $REFRESH, SUPPORTS_PROXY } from "./core/constants.js";
|
|
12
16
|
|
|
13
|
-
import "./core/invariants.js";
|
|
14
|
-
|
|
15
17
|
import { OBSERVE as OBSERVE$1 } from "./core/dev.js";
|
|
16
18
|
|
|
17
19
|
export { setConsoleFooter } from "./core/dev.js";
|
|
18
20
|
|
|
19
21
|
export { ROOT_ERROR_HOOK, enforceLoadingBoundary, flush, resetErrorHalt } from "./core/scheduler.js";
|
|
20
22
|
|
|
21
|
-
export { isPending, latest } from "./core/verdict.js";
|
|
22
|
-
|
|
23
23
|
import "./core/effect.js";
|
|
24
24
|
|
|
25
|
-
export { action } from "./core/action.js";
|
|
26
|
-
|
|
27
25
|
export { configureClientErrors } from "./core/error-hooks.js";
|
|
28
26
|
|
|
29
27
|
export { createEffect, createMemo, createOptimistic, createReaction, createRenderEffect, createSignal, createTrackedEffect, onCleanup, onSettled, refresh, resolve, until } from "./signals.js";
|
|
30
28
|
|
|
31
|
-
export { affects } from "./affects.js";
|
|
32
|
-
|
|
33
29
|
export { mapArray, repeat } from "./map.js";
|
|
34
30
|
|
|
35
31
|
export { createStore, deep, reconcile, snapshot } from "./store/index.js";
|
|
36
32
|
|
|
37
|
-
export {
|
|
33
|
+
export { affects } from "./affects.js";
|
|
34
|
+
|
|
35
|
+
export { flatten } from "./flatten.js";
|
|
36
|
+
|
|
37
|
+
export { createErrorBoundary, createLoadingBoundary } from "./boundaries.js";
|
|
38
|
+
|
|
39
|
+
export { createRevealOrder } from "./reveal.js";
|
|
38
40
|
|
|
39
|
-
export { $PROXY, $RECORD, $TARGET, $TRACK, isWrappable } from "./store/
|
|
41
|
+
export { $PROXY, $RECORD, $TARGET, $TRACK, isWrappable, markRaw } from "./store/types.js";
|
|
40
42
|
|
|
41
43
|
export { MergeView, OmitView, SOURCE_MEMO, SOURCE_MERGE, SOURCE_OMIT, SOURCE_PLAIN, SOURCE_PROXY, hasStaticKeys, isStatic, merge, mergeSources, mergeView, omit, omitView, resolvedTable, sourceGet, sourceHas, sourceKeys, sourceOwners, viewOf } from "./store/utils.js";
|
|
42
44
|
|
|
43
|
-
export {
|
|
45
|
+
export { createOptimisticStore } from "./store/optimistic.js";
|
|
44
46
|
|
|
45
|
-
export {
|
|
47
|
+
export { createProjection } from "./store/projection.js";
|
|
46
48
|
|
|
47
|
-
export { storeHasFamily, storeHasOptimisticFamily, storeIsShallow } from "./store/
|
|
49
|
+
export { storeHasFamily, storeHasOptimisticFamily, storeIsShallow } from "./store/store.js";
|
|
48
50
|
|
|
49
51
|
export { storePath } from "./store/storePath.js";
|
|
50
52
|
|