@solidjs/signals 2.0.0-beta.21 → 2.0.0-beta.23
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.js +210 -301
- package/dist/node.cjs +1106 -1196
- package/dist/prod/affects.js +71 -163
- package/dist/prod/boundaries.js +141 -137
- package/dist/prod/core/action.js +3 -3
- package/dist/prod/core/async.js +103 -103
- package/dist/prod/core/core.js +254 -297
- package/dist/prod/core/effect.js +46 -46
- package/dist/prod/core/external.js +4 -4
- package/dist/prod/core/graph.js +60 -47
- package/dist/prod/core/heap.js +50 -50
- package/dist/prod/core/lanes.js +34 -34
- package/dist/prod/core/optimistic.js +64 -106
- package/dist/prod/core/owner.js +52 -52
- package/dist/prod/core/scheduler.js +210 -211
- package/dist/prod/core/verdict.js +129 -78
- package/dist/prod/map.js +101 -101
- package/dist/prod/signals.js +23 -5
- package/dist/prod/store/optimistic.js +11 -11
- package/dist/prod/store/projection.js +2 -2
- package/dist/prod/store/store.js +14 -14
- package/dist/types/affects.d.ts +9 -9
- package/dist/types/core/async.d.ts +1 -1
- package/dist/types/core/error.d.ts +7 -0
- package/dist/types/core/scheduler.d.ts +1 -6
- package/dist/types/core/types.d.ts +6 -11
- package/dist/types-cjs/affects.d.cts +9 -9
- package/dist/types-cjs/core/async.d.cts +1 -1
- package/dist/types-cjs/core/error.d.cts +7 -0
- package/dist/types-cjs/core/scheduler.d.cts +1 -6
- package/dist/types-cjs/core/types.d.cts +6 -11
- package/package.json +1 -1
|
@@ -81,12 +81,9 @@ export declare class GlobalQueue extends Queue {
|
|
|
81
81
|
static _runEffect: (el: Computed<unknown>) => void;
|
|
82
82
|
static _clearOptimisticStores: ((stores: Set<any>, completing: Transition | null) => void) | null;
|
|
83
83
|
static _releaseAffectsScope: ((node: OptimisticNode) => void) | null;
|
|
84
|
-
static _applyAffectsReads: ((el: Computed<any>, sources: (Signal<any> | Computed<any>)[]) => void) | null;
|
|
85
84
|
static _releaseAffectsMarks: ((nodes: OptimisticNode[]) => void) | null;
|
|
86
85
|
static _markAffects: ((node: OptimisticNode) => void) | null;
|
|
87
86
|
static _releaseAffectsMark: ((node: OptimisticNode) => void) | null;
|
|
88
|
-
static _onlyMarkPending: ((el: Computed<any>) => boolean) | null;
|
|
89
|
-
static _collectMarkSources: ((el: Computed<any>, into: OptimisticNode[]) => void) | null;
|
|
90
87
|
static _wireExternalSource: ((self: Computed<any>) => void) | null;
|
|
91
88
|
static _externalUntrack: (<T>(fn: () => T) => T) | null;
|
|
92
89
|
static _syncCompanions: (<T>(el: Signal<T> | Computed<T>, value: T) => void) | null;
|
|
@@ -97,15 +94,13 @@ export declare class GlobalQueue extends Queue {
|
|
|
97
94
|
static _pendingCheck: ((el: OptimisticNode, c: Computed<any> | null, owner: OptimisticNode, firewall: Computed<any> | null) => void) | null;
|
|
98
95
|
static _recordFresh: ((el: OptimisticNode, value: any) => void) | null;
|
|
99
96
|
static _applyReask: ((el: Computed<any>, hadReask: boolean) => boolean) | null;
|
|
100
|
-
static _repollVerdicts: ((el: Computed<any
|
|
97
|
+
static _repollVerdicts: ((el: Computed<any>, snap?: boolean) => void) | null;
|
|
101
98
|
static _witnessAffects: ((node: OptimisticNode) => void) | null;
|
|
102
99
|
static _optimisticWrite: (<T>(el: Signal<T> | Computed<T>, v: T | ((prev: T) => T)) => T) | null;
|
|
103
100
|
static _resolveOptimistic: ((nodes: OptimisticNode[]) => void) | null;
|
|
104
|
-
static _stashOptimistic: ((stashedTransition: Transition) => void) | null;
|
|
105
101
|
static _transitionBlocked: ((transition: Transition) => boolean) | null;
|
|
106
102
|
static _cleanupLanes: ((completingTransition: Transition | null) => void) | null;
|
|
107
103
|
static _runLaneEffects: ((type: number) => void) | null;
|
|
108
|
-
static _readStashed: ((el: Signal<any>) => boolean) | null;
|
|
109
104
|
static _gatedRead: ((el: Signal<any>, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
|
|
110
105
|
static _laneSuspends: ((owner: OptimisticNode) => boolean) | null;
|
|
111
106
|
static _laneReadsCommitted: ((el: OptimisticNode, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
|
|
@@ -59,19 +59,14 @@ export interface RawSignal<T> {
|
|
|
59
59
|
_parentSource?: Signal<any> | Computed<any>;
|
|
60
60
|
/**
|
|
61
61
|
* Live `affects()` marks on this node (refcount). Non-zero is declared
|
|
62
|
-
* motion: the node
|
|
63
|
-
*
|
|
62
|
+
* motion: the node — and, via the verdict layer's dep-graph coverage walk,
|
|
63
|
+
* everything derived from it — reads pending regardless of graph state,
|
|
64
|
+
* until every declaring transaction settles/reverts and releases its mark.
|
|
65
|
+
* This count is the mark's ONLY graph state: the dedicated channel stores
|
|
66
|
+
* nothing downstream and never touches status flags, errors, or pending
|
|
67
|
+
* sources.
|
|
64
68
|
*/
|
|
65
69
|
_affectsCount?: number;
|
|
66
|
-
/**
|
|
67
|
-
* The mark's identity on the pending-source rails (lazy, see
|
|
68
|
-
* `getAffectsSentinel`). Downstream subscribers hold it in
|
|
69
|
-
* `_pendingSources` exactly like a real in-flight source, but with its own
|
|
70
|
-
* identity so a landing or quiet re-ask on the node itself can't clear it.
|
|
71
|
-
*/
|
|
72
|
-
_affectsSentinel?: Computed<any>;
|
|
73
|
-
/** Set only on sentinels: the marked node this sentinel stands for. */
|
|
74
|
-
_affectsFor?: Signal<any> | Computed<any>;
|
|
75
70
|
}
|
|
76
71
|
export interface FirewallSignal<T> extends RawSignal<T> {
|
|
77
72
|
_firewall: Computed<any>;
|
|
@@ -4,15 +4,15 @@ import { type Store } from "./store/store.cjs";
|
|
|
4
4
|
* Declares that in-flight work will change the targeted data: the named
|
|
5
5
|
* slot(s) — and everything DERIVED from them — read as pending
|
|
6
6
|
* (`isPending` → `true`) from the declaration until the surrounding
|
|
7
|
-
* transaction settles or reverts.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* makes it a real question).
|
|
7
|
+
* transaction settles or reverts. A mark lives on its own channel — a
|
|
8
|
+
* refcount on the marked node plus dep-graph reachability in the verdict
|
|
9
|
+
* layer — so the marked values themselves stay readable (a mark is a promise
|
|
10
|
+
* of change, not an absence of value), no reader ever suspends on one, and
|
|
11
|
+
* completion/settlement accounting never sees one. This is the declaration
|
|
12
|
+
* verb of the pending model — additive only. A mark can turn pending ON for
|
|
13
|
+
* data the graph can't see changing yet; nothing can turn pending OFF while
|
|
14
|
+
* a real change is in flight — a quiet `refresh()` re-ask under a mark still
|
|
15
|
+
* reads pending (declaring the reload is what makes it a real question).
|
|
16
16
|
*
|
|
17
17
|
* Targets:
|
|
18
18
|
* - `affects(store)` — a store proxy (any record, root or nested): every
|
|
@@ -3,7 +3,7 @@ import type { Computed, Link } from "./types.cjs";
|
|
|
3
3
|
export declare function addPendingSource(el: Computed<any>, source: Computed<any>): boolean;
|
|
4
4
|
export declare function setPendingError(el: Computed<any>, source?: Computed<any>, error?: any): void;
|
|
5
5
|
export declare function forEachDependent(el: Computed<any>, fn: (node: Computed<any>, link: Link) => void): void;
|
|
6
|
-
export declare function settlePendingSource(el: Computed<any
|
|
6
|
+
export declare function settlePendingSource(el: Computed<any>): void;
|
|
7
7
|
export declare function isThenable<T>(value: T | PromiseLike<T>): value is PromiseLike<T>;
|
|
8
8
|
export declare function handleAsync<T>(el: Computed<T>, result: T | PromiseLike<T> | AsyncIterable<T>, setter?: (value: T) => void): T;
|
|
9
9
|
export declare function clearStatus(el: Computed<any>, clearUninitialized?: boolean): void;
|
|
@@ -24,6 +24,13 @@
|
|
|
24
24
|
*/
|
|
25
25
|
export declare class NotReadyError extends Error {
|
|
26
26
|
source: any;
|
|
27
|
+
/**
|
|
28
|
+
* Tags a visibility-only notification on the affects() boundary channel:
|
|
29
|
+
* boundaries update display state from it, but the root queue never
|
|
30
|
+
* registers a reporter — marks are invisible to completion accounting by
|
|
31
|
+
* construction.
|
|
32
|
+
*/
|
|
33
|
+
_markVisual?: boolean;
|
|
27
34
|
constructor(source: any);
|
|
28
35
|
}
|
|
29
36
|
export declare class StatusError extends Error {
|
|
@@ -81,12 +81,9 @@ export declare class GlobalQueue extends Queue {
|
|
|
81
81
|
static _runEffect: (el: Computed<unknown>) => void;
|
|
82
82
|
static _clearOptimisticStores: ((stores: Set<any>, completing: Transition | null) => void) | null;
|
|
83
83
|
static _releaseAffectsScope: ((node: OptimisticNode) => void) | null;
|
|
84
|
-
static _applyAffectsReads: ((el: Computed<any>, sources: (Signal<any> | Computed<any>)[]) => void) | null;
|
|
85
84
|
static _releaseAffectsMarks: ((nodes: OptimisticNode[]) => void) | null;
|
|
86
85
|
static _markAffects: ((node: OptimisticNode) => void) | null;
|
|
87
86
|
static _releaseAffectsMark: ((node: OptimisticNode) => void) | null;
|
|
88
|
-
static _onlyMarkPending: ((el: Computed<any>) => boolean) | null;
|
|
89
|
-
static _collectMarkSources: ((el: Computed<any>, into: OptimisticNode[]) => void) | null;
|
|
90
87
|
static _wireExternalSource: ((self: Computed<any>) => void) | null;
|
|
91
88
|
static _externalUntrack: (<T>(fn: () => T) => T) | null;
|
|
92
89
|
static _syncCompanions: (<T>(el: Signal<T> | Computed<T>, value: T) => void) | null;
|
|
@@ -97,15 +94,13 @@ export declare class GlobalQueue extends Queue {
|
|
|
97
94
|
static _pendingCheck: ((el: OptimisticNode, c: Computed<any> | null, owner: OptimisticNode, firewall: Computed<any> | null) => void) | null;
|
|
98
95
|
static _recordFresh: ((el: OptimisticNode, value: any) => void) | null;
|
|
99
96
|
static _applyReask: ((el: Computed<any>, hadReask: boolean) => boolean) | null;
|
|
100
|
-
static _repollVerdicts: ((el: Computed<any
|
|
97
|
+
static _repollVerdicts: ((el: Computed<any>, snap?: boolean) => void) | null;
|
|
101
98
|
static _witnessAffects: ((node: OptimisticNode) => void) | null;
|
|
102
99
|
static _optimisticWrite: (<T>(el: Signal<T> | Computed<T>, v: T | ((prev: T) => T)) => T) | null;
|
|
103
100
|
static _resolveOptimistic: ((nodes: OptimisticNode[]) => void) | null;
|
|
104
|
-
static _stashOptimistic: ((stashedTransition: Transition) => void) | null;
|
|
105
101
|
static _transitionBlocked: ((transition: Transition) => boolean) | null;
|
|
106
102
|
static _cleanupLanes: ((completingTransition: Transition | null) => void) | null;
|
|
107
103
|
static _runLaneEffects: ((type: number) => void) | null;
|
|
108
|
-
static _readStashed: ((el: Signal<any>) => boolean) | null;
|
|
109
104
|
static _gatedRead: ((el: Signal<any>, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
|
|
110
105
|
static _laneSuspends: ((owner: OptimisticNode) => boolean) | null;
|
|
111
106
|
static _laneReadsCommitted: ((el: OptimisticNode, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
|
|
@@ -59,19 +59,14 @@ export interface RawSignal<T> {
|
|
|
59
59
|
_parentSource?: Signal<any> | Computed<any>;
|
|
60
60
|
/**
|
|
61
61
|
* Live `affects()` marks on this node (refcount). Non-zero is declared
|
|
62
|
-
* motion: the node
|
|
63
|
-
*
|
|
62
|
+
* motion: the node — and, via the verdict layer's dep-graph coverage walk,
|
|
63
|
+
* everything derived from it — reads pending regardless of graph state,
|
|
64
|
+
* until every declaring transaction settles/reverts and releases its mark.
|
|
65
|
+
* This count is the mark's ONLY graph state: the dedicated channel stores
|
|
66
|
+
* nothing downstream and never touches status flags, errors, or pending
|
|
67
|
+
* sources.
|
|
64
68
|
*/
|
|
65
69
|
_affectsCount?: number;
|
|
66
|
-
/**
|
|
67
|
-
* The mark's identity on the pending-source rails (lazy, see
|
|
68
|
-
* `getAffectsSentinel`). Downstream subscribers hold it in
|
|
69
|
-
* `_pendingSources` exactly like a real in-flight source, but with its own
|
|
70
|
-
* identity so a landing or quiet re-ask on the node itself can't clear it.
|
|
71
|
-
*/
|
|
72
|
-
_affectsSentinel?: Computed<any>;
|
|
73
|
-
/** Set only on sentinels: the marked node this sentinel stands for. */
|
|
74
|
-
_affectsFor?: Signal<any> | Computed<any>;
|
|
75
70
|
}
|
|
76
71
|
export interface FirewallSignal<T> extends RawSignal<T> {
|
|
77
72
|
_firewall: Computed<any>;
|
package/package.json
CHANGED