@solidjs/signals 2.0.0-rc.15 → 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 +785 -367
- package/dist/dev.attribution.js +75 -52
- package/dist/dev.js +1120 -567
- package/dist/observe/affects-marks.js +86 -0
- package/dist/observe/affects.js +22 -73
- package/dist/observe/boundaries.js +191 -189
- package/dist/observe/core/async.js +175 -131
- package/dist/observe/core/attribution-queries.js +1 -1
- package/dist/observe/core/attribution.js +176 -159
- package/dist/observe/core/constants.js +17 -3
- package/dist/observe/core/context.js +3 -3
- package/dist/observe/core/core.js +503 -363
- package/dist/observe/core/dev.js +66 -38
- package/dist/observe/core/effect.js +48 -48
- package/dist/observe/core/error.js +5 -3
- package/dist/observe/core/external.js +5 -6
- package/dist/observe/core/graph.js +57 -43
- package/dist/observe/core/heap.js +33 -33
- package/dist/observe/core/identities.js +62 -0
- package/dist/observe/core/lanes.js +226 -259
- package/dist/observe/core/owner.js +62 -50
- package/dist/observe/core/scheduler.js +319 -171
- package/dist/observe/core/truth.js +45 -0
- package/dist/observe/core/verdict.js +88 -50
- package/dist/observe/deferred.js +184 -0
- package/dist/observe/index.js +7 -1
- package/dist/observe/map.js +345 -260
- package/dist/observe/reveal.js +76 -76
- package/dist/observe/signals.js +41 -30
- package/dist/observe/store/affects.js +6 -6
- package/dist/observe/store/edges.js +39 -0
- package/dist/observe/store/optimistic.js +41 -36
- package/dist/observe/store/projection.js +68 -55
- package/dist/observe/store/store.js +157 -104
- package/dist/prod/affects-marks.js +86 -0
- package/dist/prod/affects.js +23 -72
- package/dist/prod/boundaries.js +155 -153
- package/dist/prod/core/async.js +171 -127
- package/dist/prod/core/constants.js +17 -3
- package/dist/prod/core/context.js +3 -3
- package/dist/prod/core/core.js +478 -342
- package/dist/prod/core/effect.js +68 -68
- package/dist/prod/core/error.js +5 -3
- package/dist/prod/core/external.js +5 -6
- package/dist/prod/core/graph.js +57 -43
- package/dist/prod/core/heap.js +38 -38
- package/dist/prod/core/identities.js +62 -0
- package/dist/prod/core/lanes.js +217 -250
- package/dist/prod/core/owner.js +62 -51
- package/dist/prod/core/scheduler.js +310 -162
- package/dist/prod/core/truth.js +45 -0
- package/dist/prod/core/verdict.js +87 -49
- package/dist/prod/deferred.js +182 -0
- package/dist/prod/index.js +7 -1
- package/dist/prod/map.js +360 -275
- package/dist/prod/reveal.js +76 -76
- package/dist/prod/signals.js +41 -30
- package/dist/prod/store/affects.js +6 -6
- package/dist/prod/store/edges.js +39 -0
- package/dist/prod/store/optimistic.js +37 -33
- package/dist/prod/store/projection.js +25 -19
- package/dist/prod/store/store.js +142 -96
- package/dist/types/affects-marks.d.ts +14 -0
- package/dist/types/boundaries.d.ts +1 -1
- package/dist/types/core/async.d.ts +10 -0
- package/dist/types/core/constants.d.ts +13 -1
- package/dist/types/core/core.d.ts +44 -2
- 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 -14
- package/dist/types/core/owner.d.ts +5 -3
- package/dist/types/core/scheduler.d.ts +47 -28
- package/dist/types/core/truth.d.ts +16 -0
- package/dist/types/core/types.d.ts +21 -0
- 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/edges.d.ts +9 -0
- package/dist/types/store/index.d.ts +10 -3
- 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 +1 -1
- package/dist/types/store/target.d.ts +16 -8
- package/dist/types/store/types.d.ts +14 -0
- package/package.json +1 -1
package/dist/types/map.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export type Maybe<T> = T | void | null | undefined | false;
|
|
|
30
30
|
* );
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
|
-
* @description https://
|
|
33
|
+
* @description https://v2.solidjs.com/reference/solid-js/advanced/jsx-component-primitives/map-array
|
|
34
34
|
*/
|
|
35
35
|
export declare function mapArray<Item, MappedItem>(list: Accessor<Maybe<readonly Item[]>>, map: (value: Item, index: Accessor<number>) => MappedItem, options?: {
|
|
36
36
|
keyed?: true;
|
|
@@ -62,7 +62,7 @@ export declare function __smallMoveHits(): number;
|
|
|
62
62
|
* const view = repeat(count, i => `Item ${i}`, { fallback: () => "empty" });
|
|
63
63
|
* ```
|
|
64
64
|
*
|
|
65
|
-
* @description https://
|
|
65
|
+
* @description https://v2.solidjs.com/reference/solid-js/advanced/jsx-component-primitives/repeat
|
|
66
66
|
*/
|
|
67
67
|
export declare function repeat(count: Accessor<number>, map: (index: number) => any, options?: {
|
|
68
68
|
from?: Accessor<number | undefined>;
|
package/dist/types/signals.d.ts
CHANGED
|
@@ -92,6 +92,13 @@ export type EffectBundle<Prev, Next extends Prev = Prev> = {
|
|
|
92
92
|
interface BaseEffectOptions {
|
|
93
93
|
/** Debug name (dev mode only) */
|
|
94
94
|
name?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Source location (`file:line:col`, root-relative) written by the
|
|
97
|
+
* compiler's `sourceNames` `locations` kind beside `name`; dev and observe
|
|
98
|
+
* builds keep it for console reports and diagnostic events, production
|
|
99
|
+
* ignores it. Not meant to be written by hand.
|
|
100
|
+
*/
|
|
101
|
+
loc?: string;
|
|
95
102
|
}
|
|
96
103
|
/** Options for effect primitives that support deferring/scheduling their initial run (`createEffect`, `createRenderEffect`, `createReaction`). */
|
|
97
104
|
export interface EffectOptions extends BaseEffectOptions {
|
|
@@ -144,6 +151,13 @@ export interface EffectOptions extends BaseEffectOptions {
|
|
|
144
151
|
export interface SignalOptions<T> {
|
|
145
152
|
/** Debug name (dev mode only) */
|
|
146
153
|
name?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Source location (`file:line:col`, root-relative) written by the
|
|
156
|
+
* compiler's `sourceNames` `locations` kind beside `name`; dev and observe
|
|
157
|
+
* builds keep it for console reports and diagnostic events, production
|
|
158
|
+
* ignores it. Not meant to be written by hand.
|
|
159
|
+
*/
|
|
160
|
+
loc?: string;
|
|
147
161
|
/**
|
|
148
162
|
* Custom equality function, or `false` to always notify subscribers.
|
|
149
163
|
* Defaults to reference equality (`isEqual`). Pass a comparator (e.g.
|
|
@@ -166,6 +180,13 @@ export interface MemoOptions<T> {
|
|
|
166
180
|
id?: string;
|
|
167
181
|
/** Debug name (dev mode only) */
|
|
168
182
|
name?: string;
|
|
183
|
+
/**
|
|
184
|
+
* Source location (`file:line:col`, root-relative) written by the
|
|
185
|
+
* compiler's `sourceNames` `locations` kind beside `name`; dev and observe
|
|
186
|
+
* builds keep it for console reports and diagnostic events, production
|
|
187
|
+
* ignores it. Not meant to be written by hand.
|
|
188
|
+
*/
|
|
189
|
+
loc?: string;
|
|
169
190
|
/**
|
|
170
191
|
* Advanced (integration tier). When true, the memo is invisible to the
|
|
171
192
|
* hydration id scheme: it inherits its parent's id instead of consuming a
|
|
@@ -275,7 +296,7 @@ export type NoInfer<T extends any> = [T][T extends any ? 0 : never];
|
|
|
275
296
|
* setUser({ ...user(), name: "Alice" });
|
|
276
297
|
* ```
|
|
277
298
|
*
|
|
278
|
-
* @description https://
|
|
299
|
+
* @description https://v2.solidjs.com/reference/solid-js/reactivity/create-signal
|
|
279
300
|
*/
|
|
280
301
|
export declare function createSignal<T>(): Signal<T | undefined>;
|
|
281
302
|
export declare function createSignal<T>(value: Exclude<T, Function>, options?: SignalOptions<T>): Signal<T>;
|
|
@@ -296,7 +317,7 @@ export declare function createSignal<T>(fn: ComputeFunction<T>, options?: Signal
|
|
|
296
317
|
* const [state, setState] = createOptimistic<T>(fn, options?: SignalOptions<T> & MemoOptions<T>);
|
|
297
318
|
* ```
|
|
298
319
|
*
|
|
299
|
-
* @description https://
|
|
320
|
+
* @description https://v2.solidjs.com/reference/solid-js/reactivity/create-optimistic
|
|
300
321
|
*/
|
|
301
322
|
export declare function createOptimistic<T>(): Signal<T | undefined>;
|
|
302
323
|
export declare function createOptimistic<T>(value: Exclude<T, Function>, options?: SignalOptions<T>): Signal<T>;
|
|
@@ -329,7 +350,7 @@ export declare function createOptimistic<T>(fn: ComputeFunction<T>, options?: Si
|
|
|
329
350
|
* });
|
|
330
351
|
* ```
|
|
331
352
|
*
|
|
332
|
-
* @description https://
|
|
353
|
+
* @description https://v2.solidjs.com/reference/solid-js/reactivity/create-memo
|
|
333
354
|
*/
|
|
334
355
|
export declare function createMemo<T>(compute: ComputeFunction<NoInfer<T>, T>, options: MemoOptions<T> & {
|
|
335
356
|
loadingValue: T;
|
|
@@ -401,7 +422,7 @@ export declare function createMemo<T>(compute: ComputeFunction<undefined | NoInf
|
|
|
401
422
|
* );
|
|
402
423
|
* ```
|
|
403
424
|
*
|
|
404
|
-
* @description https://
|
|
425
|
+
* @description https://v2.solidjs.com/reference/solid-js/reactivity/create-effect
|
|
405
426
|
*/
|
|
406
427
|
export declare function createEffect<const T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, effectFn: EffectFunction<NoInfer<T>, T> | EffectBundle<NoInfer<T>, T>, options?: EffectOptions): void;
|
|
407
428
|
/**
|
|
@@ -431,7 +452,7 @@ export declare function createEffect<const T>(compute: ComputeFunction<undefined
|
|
|
431
452
|
* }
|
|
432
453
|
* ```
|
|
433
454
|
*
|
|
434
|
-
* @description https://
|
|
455
|
+
* @description https://v2.solidjs.com/reference/solid-js/advanced/specialized-reactivity/create-render-effect
|
|
435
456
|
*/
|
|
436
457
|
export declare function createRenderEffect<const T>(compute: ComputeFunction<undefined | NoInfer<T>, T>, effectFn: EffectFunction<NoInfer<T>, T>, options?: EffectOptions): void;
|
|
437
458
|
/**
|
|
@@ -477,7 +498,7 @@ export declare function createRenderEffect<const T>(compute: ComputeFunction<und
|
|
|
477
498
|
* });
|
|
478
499
|
* ```
|
|
479
500
|
*
|
|
480
|
-
* @description https://
|
|
501
|
+
* @description https://v2.solidjs.com/reference/solid-js/advanced/specialized-reactivity/create-tracked-effect
|
|
481
502
|
*/
|
|
482
503
|
export declare function createTrackedEffect(compute: () => void | (() => void), options?: BaseEffectOptions): void;
|
|
483
504
|
/**
|
|
@@ -504,7 +525,7 @@ export declare function createTrackedEffect(compute: () => void | (() => void),
|
|
|
504
525
|
* setCount(1); // logs once, reaction re-armed for next change
|
|
505
526
|
* ```
|
|
506
527
|
*
|
|
507
|
-
* @description https://
|
|
528
|
+
* @description https://v2.solidjs.com/reference/solid-js/advanced/specialized-reactivity/create-reaction
|
|
508
529
|
*/
|
|
509
530
|
export declare function createReaction(effectFn: EffectFunction<undefined> | EffectBundle<undefined>, options?: EffectOptions): (tracking: () => void) => void;
|
|
510
531
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal The name of the store `x` belongs to — `x` a store proxy (a
|
|
3
|
+
* setter's entry) or one of its property nodes (the setter notifying it) —
|
|
4
|
+
* or undefined when it has none or it cannot be placed: a projection or
|
|
5
|
+
* optimistic family, a store chained over another store's proxy, a root
|
|
6
|
+
* named twice, or a proxy reached through a store other than the one it
|
|
7
|
+
* was named as the root of.
|
|
8
|
+
*/
|
|
9
|
+
export declare function storeName(x: object | undefined): string | undefined;
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* (`createStore(fn, seed)`), projections, optimistic stores and reconcile
|
|
4
4
|
* return on later steps (plan sec. 31.5).
|
|
5
5
|
*/
|
|
6
|
-
export type { NoFn, NotWrappable, ProjectionOptions, ProjectionStoreReturn, SolidStore, Store, StoreOptions, StoreReturn, StoreSetter } from "./types.js";
|
|
6
|
+
export type { NoArray, NoFn, NotWrappable, ProjectionOptions, ProjectionStoreReturn, SolidStore, Store, StoreOptions, StoreReturn, StoreSetter } from "./types.js";
|
|
7
7
|
export { $PROXY, $RECORD, $TARGET, $TRACK, isWrappable, markRaw } from "./types.js";
|
|
8
8
|
export { storeIsShallow, storeHasFamily, storeHasOptimisticFamily } from "./store.js";
|
|
9
9
|
export { storePath } from "./storePath.js";
|
|
10
10
|
export type { StorePathRange, PathSetter, Part, CustomPartial, ArrayFilterFn } from "./storePath.js";
|
|
11
11
|
import { createOptimisticStore } from "./optimistic.js";
|
|
12
12
|
import { createProjection } from "./projection.js";
|
|
13
|
-
import type { NoFn, ProjectionOptions, ProjectionStoreReturn, Store, StoreOptions, StoreReturn } from "./types.js";
|
|
13
|
+
import type { NoArray, NoFn, ProjectionOptions, ProjectionStoreReturn, Store, StoreOptions, StoreReturn } from "./types.js";
|
|
14
14
|
export { createOptimisticStore, createProjection };
|
|
15
15
|
/** The store's internal record behind a proxy (`store[$TARGET]`). Kept
|
|
16
16
|
* under `next`'s public name; its shape is the L2 target's (plan plan sec. 31–32:
|
|
@@ -23,9 +23,16 @@ export type { SourceKind } from "./utils.js";
|
|
|
23
23
|
* Create a reactive store: a proxy over plain data with fine-grained
|
|
24
24
|
* subscriptions per read path, written through its setter's draft — or, in
|
|
25
25
|
* the derived form, a projection with a setter.
|
|
26
|
+
*
|
|
27
|
+
* The derived form comes in two shapes. Seedless, `createStore(fn)`: `fn`
|
|
28
|
+
* takes no draft and every answer is a complete `T` (plain-object roots only;
|
|
29
|
+
* pass `undefined` for the seed to reach the options). Seeded,
|
|
30
|
+
* `createStore(fn, seed)`: the seed is a complete `T` the derive drafts
|
|
31
|
+
* against — `[]` for an array.
|
|
26
32
|
*/
|
|
27
33
|
export declare function createStore<T extends object = {}>(initialValue: NoFn<T>, options?: StoreOptions): StoreReturn<T>;
|
|
28
|
-
export declare function createStore<T extends object = {}>(fn: (
|
|
34
|
+
export declare function createStore<T extends object = {}>(fn: (() => T | Promise<T> | AsyncIterable<T>) & NoArray<T>, seed?: null, options?: Omit<ProjectionOptions, "seedLoadingValue">): ProjectionStoreReturn<T>;
|
|
35
|
+
export declare function createStore<T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, seed: NoFn<T> | Store<NoFn<T>>, options?: ProjectionOptions): ProjectionStoreReturn<T>;
|
|
29
36
|
/**
|
|
30
37
|
* A setter transform that reconciles `value` into the store by key
|
|
31
38
|
* (`"id"` by default; `null` positional), preserving store identity for
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Refreshable } from "../core/index.js";
|
|
2
2
|
import { type StoreTarget } from "./target.js";
|
|
3
|
-
import { type NoFn, type ProjectionOptions, type Store, type StoreOptions, type StoreSetter } from "./types.js";
|
|
3
|
+
import { type NoArray, type NoFn, type ProjectionOptions, type Store, type StoreOptions, type StoreSetter } from "./types.js";
|
|
4
4
|
export declare function notifyOptimisticWrites(t: StoreTarget, pb: Record<PropertyKey, any>): Record<PropertyKey, any> | null;
|
|
5
5
|
export declare function sweepOverlaid(): void;
|
|
6
6
|
/** An untracked `key in store` on an optimistic family: the presence guess
|
|
@@ -20,4 +20,5 @@ export declare function optimisticView(t: StoreTarget, src: Record<PropertyKey,
|
|
|
20
20
|
* guess is what lands). */
|
|
21
21
|
export declare function latestView(t: StoreTarget, src: Record<PropertyKey, any>): Record<PropertyKey, any>;
|
|
22
22
|
export declare function createOptimisticStore<T extends object = {}>(initialValue: NoFn<T> | Store<NoFn<T>>, options?: StoreOptions): [get: Store<T>, set: StoreSetter<T>];
|
|
23
|
-
export declare function createOptimisticStore<T extends object = {}>(fn: (
|
|
23
|
+
export declare function createOptimisticStore<T extends object = {}>(fn: (() => T | Promise<T> | AsyncIterable<T>) & NoArray<T>, seed?: null, options?: Omit<ProjectionOptions, "seedLoadingValue">): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
|
|
24
|
+
export declare function createOptimisticStore<T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, seed: NoFn<T> | Store<NoFn<T>>, options?: ProjectionOptions): [get: Refreshable<Store<T>>, set: StoreSetter<T>];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Computed } from "../core/types.js";
|
|
2
2
|
import type { Refreshable } from "../core/index.js";
|
|
3
|
-
import { type NoFn, type ProjectionOptions, type Store } from "./types.js";
|
|
3
|
+
import { type NoArray, type NoFn, type ProjectionOptions, type Store } from "./types.js";
|
|
4
4
|
/** The derive's pass: run `fn` against a draft of the store; commit its
|
|
5
5
|
* result (sync, or each async landing) through the reconcile channel.
|
|
6
6
|
* Draft validity is per run (R37): live from here until the NEXT run starts
|
|
@@ -13,6 +13,7 @@ export declare function runProjectionComputed<T extends object>(wrappedStore: St
|
|
|
13
13
|
* firewall). `fn` may be async or an async iterator; the seed is a draft,
|
|
14
14
|
* never an observable value, until the first landing (A25).
|
|
15
15
|
*/
|
|
16
|
-
export declare function createProjection<T extends object = {}>(fn: (
|
|
16
|
+
export declare function createProjection<T extends object = {}>(fn: (() => T | Promise<T> | AsyncIterable<T>) & NoArray<T>, seed?: null, options?: Omit<ProjectionOptions, "seedLoadingValue">): Refreshable<Store<T>>;
|
|
17
|
+
export declare function createProjection<T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, seed: NoFn<T> | Store<NoFn<T>>, options?: ProjectionOptions): Refreshable<Store<T>>;
|
|
17
18
|
/** `createStore(fn, seed, options)`: a projection with a user setter. */
|
|
18
|
-
export declare function createStoreDerived<T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, seed:
|
|
19
|
+
export declare function createStoreDerived<T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, seed: T | null | undefined, options?: ProjectionOptions): [Refreshable<Store<T>>, (f: (draft: T) => T | void) => void];
|
|
@@ -46,7 +46,7 @@ export declare function getHasNode(target: StoreTarget, key: PropertyKey): Signa
|
|
|
46
46
|
* committed backing. */
|
|
47
47
|
export declare function getContainerNode(target: StoreTarget): Signal<any>;
|
|
48
48
|
export declare function bumpDeep(t: StoreTarget): void;
|
|
49
|
-
export declare function nameStore(proxy: any, name: string | undefined): void;
|
|
49
|
+
export declare function nameStore(proxy: any, name: string | undefined, loc?: string): void;
|
|
50
50
|
/** Shallow clone into store ownership. Plain data (grade 2) spreads; anything
|
|
51
51
|
* else copies descriptors (accessors kept, everything made configurable). */
|
|
52
52
|
export declare function cloneRaw(source: Record<PropertyKey, any>, t: StoreTarget): Record<PropertyKey, any>;
|
|
@@ -42,6 +42,11 @@ export interface StoreFamily {
|
|
|
42
42
|
* (`settleFamily`). A sync commit with no wake behind it walks nothing. */
|
|
43
43
|
woke?: boolean;
|
|
44
44
|
}
|
|
45
|
+
/** One setter's written keys; `u` is the batch's earlier setters' (the
|
|
46
|
+
* fold's union), present only once a second setter writes the target. */
|
|
47
|
+
export interface WrittenKeys extends Set<PropertyKey> {
|
|
48
|
+
u?: WrittenKeys;
|
|
49
|
+
}
|
|
45
50
|
export interface StoreTarget {
|
|
46
51
|
/** Committed backing: source object (shared) or owned clone. */
|
|
47
52
|
v: Record<PropertyKey, any>;
|
|
@@ -59,19 +64,22 @@ export interface StoreTarget {
|
|
|
59
64
|
/** Lazy CONTAINER node: membership/iteration/`$TRACK`/`length`
|
|
60
65
|
* subscriptions (§6) and the backing's staging home (plan sec. 31.3). */
|
|
61
66
|
k: Signal<any> | null;
|
|
62
|
-
/** Keys written through the traps
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
/** Keys written through the traps by the current setter, with the earlier
|
|
68
|
+
* setters' of the batch chained behind (`u`) until the fold commit. Bounds
|
|
69
|
+
* the setter notify/hold-check to O(written) instead of O(subscribed
|
|
70
|
+
* nodes) — a record with thousands of per-key subscriptions (selection
|
|
71
|
+
* maps) would otherwise pay a full node scan on every write — and to THIS
|
|
72
|
+
* setter's keys (D-8: a key an earlier setter of the batch wrote is told
|
|
73
|
+
* once, #3743). null = no trap writes this batch (bulk paths fall back to
|
|
74
|
+
* the full scan); WK_ALL = bound unusable (array length write).
|
|
75
|
+
* LOAD-BEARING SHAPE RULE: array proxy targets carry their fields as named
|
|
76
|
+
* properties on a real array, and V8
|
|
69
77
|
* normalizes an array to dictionary properties as the named count grows
|
|
70
78
|
* (empirically at counts ≡ 0 mod 3 from 18 up on V8 13.x) — every trap
|
|
71
79
|
* field read then becomes a hash lookup (~15% uibench, tree suites
|
|
72
80
|
* worst). Future write-side state MUST ride an extension object, not new
|
|
73
81
|
* named fields. */
|
|
74
|
-
wk:
|
|
82
|
+
wk: WrittenKeys | null;
|
|
75
83
|
/** Lazy deep-witness node: `deep()` subscribes ONE node per record instead
|
|
76
84
|
* of one per path; write paths bump it only when it exists. Separate from
|
|
77
85
|
* `k` so $TRACK/mapArray never rerun on leaf value changes (R9). */
|
|
@@ -34,6 +34,13 @@ export interface StoreOptions {
|
|
|
34
34
|
* projection node carries the name itself.
|
|
35
35
|
*/
|
|
36
36
|
name?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Source location (`file:line:col`, root-relative) written by the
|
|
39
|
+
* compiler's `sourceNames` `locations` kind; dev and observe builds keep it
|
|
40
|
+
* for console reports and diagnostic events, production ignores it. Not
|
|
41
|
+
* meant to be written by hand.
|
|
42
|
+
*/
|
|
43
|
+
loc?: string;
|
|
37
44
|
/** Single-layer store: root keys reactive, values raw records replaced by reference */
|
|
38
45
|
shallow?: boolean;
|
|
39
46
|
}
|
|
@@ -60,7 +67,14 @@ export interface ProjectionOptions extends StoreOptions {
|
|
|
60
67
|
*/
|
|
61
68
|
seedLoadingValue?: boolean;
|
|
62
69
|
}
|
|
70
|
+
/** @internal */
|
|
63
71
|
export type NoFn<T> = T extends Function ? never : T;
|
|
72
|
+
/**
|
|
73
|
+
* Rejects array roots on the seedless derived form: a store's root shape is
|
|
74
|
+
* fixed when it is created, and `[]` is already a complete seed for an array.
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
export type NoArray<T> = Extract<T, readonly unknown[]> extends never ? unknown : never;
|
|
64
78
|
/** Brand keys the proxy answers directly (never user data). */
|
|
65
79
|
export declare const $TRACK: unique symbol, $TARGET: unique symbol, $PROXY: unique symbol, $RECORD: unique symbol;
|
|
66
80
|
export declare namespace SolidStore {
|
package/package.json
CHANGED