@solidjs/signals 0.8.3 → 0.8.5
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 +761 -815
- package/dist/node.cjs +1614 -1858
- package/dist/prod.js +1635 -1790
- package/dist/types/boundaries.d.ts +1 -1
- package/dist/types/core/constants.d.ts +16 -21
- package/dist/types/core/core.d.ts +6 -5
- package/dist/types/core/heap.d.ts +1 -2
- package/dist/types/core/scheduler.d.ts +3 -3
- package/package.json +8 -3
|
@@ -12,7 +12,7 @@ export declare class CollectionQueue extends Queue {
|
|
|
12
12
|
run(type: number): void;
|
|
13
13
|
notify(node: Effect<any>, type: number, flags: number): boolean;
|
|
14
14
|
}
|
|
15
|
-
export declare enum BoundaryMode {
|
|
15
|
+
export declare const enum BoundaryMode {
|
|
16
16
|
VISIBLE = "visible",
|
|
17
17
|
HIDDEN = "hidden"
|
|
18
18
|
}
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
export declare const enum EffectType {
|
|
18
|
-
Pure = 0,
|
|
19
|
-
Render = 1,
|
|
20
|
-
User = 2
|
|
21
|
-
}
|
|
1
|
+
export declare const REACTIVE_NONE = 0;
|
|
2
|
+
export declare const REACTIVE_CHECK: number;
|
|
3
|
+
export declare const REACTIVE_DIRTY: number;
|
|
4
|
+
export declare const REACTIVE_RECOMPUTING_DEPS: number;
|
|
5
|
+
export declare const REACTIVE_IN_HEAP: number;
|
|
6
|
+
export declare const REACTIVE_IN_HEAP_HEIGHT: number;
|
|
7
|
+
export declare const REACTIVE_ZOMBIE: number;
|
|
8
|
+
export declare const REACTIVE_DISPOSED: number;
|
|
9
|
+
export declare const STATUS_NONE = 0;
|
|
10
|
+
export declare const STATUS_PENDING: number;
|
|
11
|
+
export declare const STATUS_ERROR: number;
|
|
12
|
+
export declare const STATUS_UNINITIALIZED: number;
|
|
13
|
+
export declare const EFFECT_PURE = 0;
|
|
14
|
+
export declare const EFFECT_RENDER = 1;
|
|
15
|
+
export declare const EFFECT_USER = 2;
|
|
22
16
|
export declare const NOT_PENDING: {};
|
|
23
17
|
export declare const SUPPORTS_PROXY: boolean;
|
|
18
|
+
export declare const defaultContext: {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NOT_PENDING
|
|
1
|
+
import { NOT_PENDING } from "./constants.js";
|
|
2
2
|
import { type IQueue, type Transition } from "./scheduler.js";
|
|
3
3
|
export interface Disposable {
|
|
4
4
|
(): void;
|
|
@@ -23,12 +23,13 @@ export interface RawSignal<T> {
|
|
|
23
23
|
_subsTail: Link | null;
|
|
24
24
|
_value: T;
|
|
25
25
|
_error?: unknown;
|
|
26
|
-
_statusFlags:
|
|
26
|
+
_statusFlags: number;
|
|
27
27
|
_name?: string;
|
|
28
28
|
_equals: false | ((a: T, b: T) => boolean);
|
|
29
29
|
_pureWrite?: boolean;
|
|
30
30
|
_unobserved?: () => void;
|
|
31
31
|
_time: number;
|
|
32
|
+
_transition: Transition | null;
|
|
32
33
|
_pendingValue: T | typeof NOT_PENDING;
|
|
33
34
|
_pendingCheck?: Signal<boolean> & {
|
|
34
35
|
_set: (v: boolean) => void;
|
|
@@ -36,7 +37,7 @@ export interface RawSignal<T> {
|
|
|
36
37
|
_pendingSignal?: Signal<T> & {
|
|
37
38
|
_set: (v: T) => void;
|
|
38
39
|
};
|
|
39
|
-
|
|
40
|
+
_optimistic?: boolean;
|
|
40
41
|
}
|
|
41
42
|
export interface FirewallSignal<T> extends RawSignal<T> {
|
|
42
43
|
_firewall: Computed<any>;
|
|
@@ -58,7 +59,7 @@ export interface Owner {
|
|
|
58
59
|
export interface Computed<T> extends RawSignal<T>, Owner {
|
|
59
60
|
_deps: Link | null;
|
|
60
61
|
_depsTail: Link | null;
|
|
61
|
-
_flags:
|
|
62
|
+
_flags: number;
|
|
62
63
|
_height: number;
|
|
63
64
|
_nextHeap: Computed<any> | undefined;
|
|
64
65
|
_prevHeap: Computed<any>;
|
|
@@ -71,6 +72,7 @@ export interface Root extends Owner {
|
|
|
71
72
|
_parentComputed: Computed<any> | null;
|
|
72
73
|
dispose(self?: boolean): void;
|
|
73
74
|
}
|
|
75
|
+
export declare let context: Owner | null;
|
|
74
76
|
export declare function recompute(el: Computed<any>, create?: boolean): void;
|
|
75
77
|
export declare function dispose(node: Computed<unknown>): void;
|
|
76
78
|
export declare function getNextChildId(owner: Owner): string;
|
|
@@ -119,4 +121,3 @@ export declare function runWithOwner<T>(owner: Owner | null, fn: () => T): T;
|
|
|
119
121
|
export declare function staleValues<T>(fn: () => T, set?: boolean): T;
|
|
120
122
|
export declare function pending<T>(fn: () => T): T;
|
|
121
123
|
export declare function isPending(fn: () => any): boolean;
|
|
122
|
-
export declare function isPending(fn: () => any, loadingValue: boolean): boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactiveFlags } from "./constants.js";
|
|
2
1
|
import type { Computed } from "./core.js";
|
|
3
2
|
export interface Heap {
|
|
4
3
|
_heap: (Computed<unknown> | undefined)[];
|
|
@@ -11,5 +10,5 @@ export declare function insertIntoHeap(n: Computed<any>, heap: Heap): void;
|
|
|
11
10
|
export declare function insertIntoHeapHeight(n: Computed<unknown>, heap: Heap): void;
|
|
12
11
|
export declare function deleteFromHeap(n: Computed<unknown>, heap: Heap): void;
|
|
13
12
|
export declare function markHeap(heap: Heap): void;
|
|
14
|
-
export declare function markNode(el: Computed<unknown>, newState?:
|
|
13
|
+
export declare function markNode(el: Computed<unknown>, newState?: number): void;
|
|
15
14
|
export declare function runHeap(heap: Heap, recompute: (el: Computed<unknown>) => void): void;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Computed, Signal } from "./core.js";
|
|
2
2
|
import { type Heap } from "./heap.js";
|
|
3
|
+
export declare const dirtyQueue: Heap;
|
|
4
|
+
export declare const zombieQueue: Heap;
|
|
3
5
|
export declare let clock: number;
|
|
4
6
|
export declare let activeTransition: Transition | null;
|
|
5
7
|
export type QueueCallback = (type: number) => void;
|
|
@@ -14,8 +16,6 @@ export interface Transition {
|
|
|
14
16
|
queueStash: QueueStub;
|
|
15
17
|
}
|
|
16
18
|
export declare function schedule(): void;
|
|
17
|
-
export declare const dirtyQueue: Heap;
|
|
18
|
-
export declare const zombieQueue: Heap;
|
|
19
19
|
export interface IQueue {
|
|
20
20
|
enqueue(type: number, fn: QueueCallback): void;
|
|
21
21
|
run(type: number): boolean | void;
|
|
@@ -55,5 +55,5 @@ export declare const globalQueue: GlobalQueue;
|
|
|
55
55
|
* the queue synchronously to get the latest updates by calling `flush()`.
|
|
56
56
|
*/
|
|
57
57
|
export declare function flush(): void;
|
|
58
|
-
export declare function
|
|
58
|
+
export declare function runInTransition(el: Computed<unknown>, recompute: (el: Computed<unknown>) => void): void;
|
|
59
59
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/signals",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,9 +20,14 @@
|
|
|
20
20
|
],
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
|
|
23
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
24
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
25
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
23
26
|
"@types/node": "^20.5.1",
|
|
24
27
|
"rimraf": "^5.0.1",
|
|
25
|
-
"
|
|
28
|
+
"rollup": "^4.53.4",
|
|
29
|
+
"rollup-plugin-prettier": "^4.1.2",
|
|
30
|
+
"tslib": "^2.8.1",
|
|
26
31
|
"typescript": "5.1.6",
|
|
27
32
|
"vite": "^5.4.10",
|
|
28
33
|
"vitest": "^2.0.0"
|
|
@@ -39,7 +44,7 @@
|
|
|
39
44
|
}
|
|
40
45
|
},
|
|
41
46
|
"scripts": {
|
|
42
|
-
"build": "rimraf dist &&
|
|
47
|
+
"build": "rimraf dist && rollup -c && pnpm types",
|
|
43
48
|
"types": "tsc -p tsconfig.build.json",
|
|
44
49
|
"format": "prettier src tests --write --log-level warn",
|
|
45
50
|
"sandbox": "node ./.sandbox/launch.js",
|