@solidjs/signals 2.0.0-beta.18 → 2.0.0-beta.20

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.
Files changed (68) hide show
  1. package/dist/dev.js +3276 -928
  2. package/dist/node.cjs +6646 -4189
  3. package/dist/prod/affects.js +218 -0
  4. package/dist/prod/boundaries.js +568 -0
  5. package/dist/prod/core/action.js +96 -0
  6. package/dist/prod/core/async.js +380 -0
  7. package/dist/prod/core/constants.js +92 -0
  8. package/dist/prod/core/context.js +67 -0
  9. package/dist/prod/core/core.js +772 -0
  10. package/dist/prod/core/dev.js +3 -0
  11. package/dist/prod/core/effect.js +145 -0
  12. package/dist/prod/core/error.js +59 -0
  13. package/dist/prod/core/external.js +98 -0
  14. package/dist/prod/core/graph.js +91 -0
  15. package/dist/prod/core/heap.js +132 -0
  16. package/dist/prod/core/invariants.js +42 -0
  17. package/dist/prod/core/lanes.js +140 -0
  18. package/dist/prod/core/optimistic.js +273 -0
  19. package/dist/prod/core/owner.js +293 -0
  20. package/dist/prod/core/scheduler.js +689 -0
  21. package/dist/prod/core/verdict.js +292 -0
  22. package/dist/prod/index.js +45 -0
  23. package/dist/prod/map.js +293 -0
  24. package/dist/prod/signals.js +389 -0
  25. package/dist/prod/store/optimistic.js +184 -0
  26. package/dist/prod/store/projection.js +184 -0
  27. package/dist/prod/store/reconcile.js +426 -0
  28. package/dist/prod/store/store.js +870 -0
  29. package/dist/prod/store/storePath.js +103 -0
  30. package/dist/prod/store/utils.js +316 -0
  31. package/dist/types/affects.d.ts +1 -1
  32. package/dist/types/boundaries.d.ts +6 -6
  33. package/dist/types/core/action.d.ts +19 -6
  34. package/dist/types/core/async.d.ts +4 -38
  35. package/dist/types/core/constants.d.ts +12 -0
  36. package/dist/types/core/core.d.ts +12 -78
  37. package/dist/types/core/dev.d.ts +7 -0
  38. package/dist/types/core/external.d.ts +0 -30
  39. package/dist/types/core/heap.d.ts +8 -0
  40. package/dist/types/core/index.d.ts +3 -2
  41. package/dist/types/core/lanes.d.ts +2 -0
  42. package/dist/types/core/optimistic.d.ts +6 -0
  43. package/dist/types/core/owner.d.ts +8 -0
  44. package/dist/types/core/scheduler.d.ts +40 -39
  45. package/dist/types/core/types.d.ts +9 -1
  46. package/dist/types/core/verdict.d.ts +2 -0
  47. package/dist/types/store/projection.d.ts +0 -1
  48. package/dist/types/store/store.d.ts +8 -2
  49. package/dist/types-cjs/affects.d.cts +1 -1
  50. package/dist/types-cjs/boundaries.d.cts +6 -6
  51. package/dist/types-cjs/core/action.d.cts +19 -6
  52. package/dist/types-cjs/core/async.d.cts +4 -38
  53. package/dist/types-cjs/core/constants.d.cts +12 -0
  54. package/dist/types-cjs/core/core.d.cts +12 -78
  55. package/dist/types-cjs/core/dev.d.cts +7 -0
  56. package/dist/types-cjs/core/external.d.cts +0 -30
  57. package/dist/types-cjs/core/heap.d.cts +8 -0
  58. package/dist/types-cjs/core/index.d.cts +3 -2
  59. package/dist/types-cjs/core/lanes.d.cts +2 -0
  60. package/dist/types-cjs/core/optimistic.d.cts +6 -0
  61. package/dist/types-cjs/core/owner.d.cts +8 -0
  62. package/dist/types-cjs/core/scheduler.d.cts +40 -39
  63. package/dist/types-cjs/core/types.d.cts +9 -1
  64. package/dist/types-cjs/core/verdict.d.cts +2 -0
  65. package/dist/types-cjs/store/projection.d.cts +0 -1
  66. package/dist/types-cjs/store/store.d.cts +8 -2
  67. package/package.json +8 -6
  68. package/dist/prod.js +0 -4637
@@ -1,4 +1,12 @@
1
1
  import type { Computed } from "./types.cjs";
2
+ /** The queue a node belongs to, picked from its own zombie flag. */
3
+ export declare function queueFor(n: Computed<any>): Heap;
4
+ /**
5
+ * Schedule one subscriber to re-run on the next flush: tracked effects bypass
6
+ * the heap and go directly to their effect queue; everything else is inserted
7
+ * into its own (zombie-flag-routed) heap with the `_min` cursor pulled down.
8
+ */
9
+ export declare function enqueueSub(node: Computed<any>): void;
2
10
  export interface Heap {
3
11
  _heap: (Computed<unknown> | undefined)[];
4
12
  _marked: boolean;
@@ -1,12 +1,13 @@
1
1
  export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.cjs";
2
- export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, isPending, latest, refresh, staleValues, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots } from "./core.cjs";
2
+ export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, setMemo, suppressComputedRecompute, optimisticSignal, optimisticComputed, refresh, staleValues, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots } from "./core.cjs";
3
3
  export { enableExternalSource, _resetExternalSourceConfig, type ExternalSourceFactory, type ExternalSource, type ExternalSourceConfig } from "./external.cjs";
4
4
  export { createOwner, createRoot, dispose, getNextChildId, getObserver, getOwner, isDisposed, cleanup, peekNextChildId } from "./owner.cjs";
5
5
  export { createContext, getContext, setContext, type Context, type ContextRecord } from "./context.cjs";
6
6
  export { handleAsync } from "./async.cjs";
7
+ export { isPending, latest } from "./verdict.cjs";
7
8
  export type { Computed, Disposable, FirewallSignal, Link, Owner, Root, Signal, NodeOptions } from "./types.cjs";
8
9
  export { effect, trackedEffect, type Effect, type TrackedEffect } from "./effect.cjs";
9
10
  export { action } from "./action.cjs";
10
- export { flush, Queue, GlobalQueue, trackOptimisticStore, enforceLoadingBoundary, resetErrorHalt, type IQueue, type QueueCallback } from "./scheduler.cjs";
11
+ export { flush, Queue, GlobalQueue, enforceLoadingBoundary, resetErrorHalt, type IQueue, type QueueCallback } from "./scheduler.cjs";
11
12
  export { DEV, type Dev, type DevHooks, type DiagnosticCapture, type DiagnosticCode, type DiagnosticEvent, type DiagnosticKind, type Diagnostics, type DiagnosticSeverity } from "./dev.cjs";
12
13
  export * from "./constants.cjs";
@@ -37,6 +37,8 @@ export declare function resolveLane(el: {
37
37
  export declare function resolveTransition(el: {
38
38
  _optimisticLane?: OptimisticLane;
39
39
  _transition?: Transition | null;
40
+ _overrideValue?: any;
41
+ _overrideOwner?: Transition | null;
40
42
  }): Transition | null | undefined;
41
43
  /**
42
44
  * Check if a node has an active optimistic override.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Installs the engine's hooks. Idempotent; called by every module that can
3
+ * create optimistic state (verdict.ts at module top level, createOptimistic
4
+ * and createOptimisticStore at first call) BEFORE any optimistic node exists.
5
+ */
6
+ export declare function installOptimisticEngine(): void;
@@ -9,6 +9,14 @@ export declare function disposeChildren(node: Owner, self?: boolean, zombie?: bo
9
9
  * @internal
10
10
  */
11
11
  export declare function getNextChildId(owner: Owner): string;
12
+ /**
13
+ * The id a freshly-created node inherits: an explicit `options.id` wins;
14
+ * transparent nodes share their parent's id; otherwise the parent's next
15
+ * child id is consumed (or `undefined` outside an id-carrying tree).
16
+ */
17
+ export declare function inheritId(options: {
18
+ id?: string;
19
+ } | undefined, transparent: boolean, parent: Owner | null | undefined): string | undefined;
12
20
  /**
13
21
  * Returns the *next* child id for `owner` without consuming it. Used by
14
22
  * hydration plumbing to peek at the id a future child will receive.
@@ -1,5 +1,5 @@
1
1
  import { type Heap } from "./heap.cjs";
2
- import { activeLanes, assignOrMergeLane, findLane } from "./lanes.cjs";
2
+ import { activeLanes, assignOrMergeLane, findLane, type OptimisticLane } from "./lanes.cjs";
3
3
  import type { Computed, Signal } from "./types.cjs";
4
4
  export { activeLanes, assignOrMergeLane, findLane };
5
5
  export { getOrCreateLane, hasActiveOverride, mergeLanes, resolveLane } from "./lanes.cjs";
@@ -20,7 +20,6 @@ export declare function resetUnhandledAsync(): void;
20
20
  * @internal
21
21
  */
22
22
  export declare function enforceLoadingBoundary(enabled: boolean): void;
23
- export declare function shouldReadStashedOptimisticValue(node: Signal<any>): boolean;
24
23
  export declare function setProjectionWriteActive(value: boolean): void;
25
24
  export declare function setTrackedQueueCallback(value: boolean): void;
26
25
  export type QueueCallback = (type: number) => void;
@@ -47,7 +46,7 @@ export declare function schedule(): void;
47
46
  * every boundary — app state is undefined at that point, so scheduling stops
48
47
  * entirely rather than limping along with a half-applied update.
49
48
  */
50
- export declare function haltReactivity(): void;
49
+ export declare function haltReactivity(cause?: unknown): void;
51
50
  /** @internal Test/dev-reload hook. Revives scheduling after a halt. */
52
51
  export declare function resetErrorHalt(): void;
53
52
  export interface IQueue {
@@ -76,18 +75,44 @@ export declare class Queue implements IQueue {
76
75
  }
77
76
  export declare class GlobalQueue extends Queue {
78
77
  _running: boolean;
79
- _pendingNode: Signal<any> | null;
80
- _pendingNodes: Signal<any>[];
81
- _optimisticNodes: OptimisticNode[];
82
- _affectsNodes: OptimisticNode[];
83
- _optimisticStores: Set<any>;
78
+ _batch: Transition;
84
79
  static _update: (el: Computed<unknown>) => void;
85
80
  static _dispose: (el: Computed<unknown>, self: boolean, zombie: boolean) => void;
86
81
  static _runEffect: (el: Computed<unknown>) => void;
87
- static _clearOptimisticStore: ((store: any) => void) | null;
82
+ static _clearOptimisticStores: ((stores: Set<any>, completing: Transition | null) => void) | null;
88
83
  static _releaseAffectsScope: ((node: OptimisticNode) => void) | null;
89
- static _propagateAffects: ((node: OptimisticNode) => void) | null;
90
- static _settleAffects: ((node: OptimisticNode) => void) | null;
84
+ static _applyAffectsReads: ((el: Computed<any>, sources: (Signal<any> | Computed<any>)[]) => void) | null;
85
+ static _releaseAffectsMarks: ((nodes: OptimisticNode[]) => void) | null;
86
+ static _markAffects: ((node: OptimisticNode) => void) | null;
87
+ 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
+ static _wireExternalSource: ((self: Computed<any>) => void) | null;
91
+ static _externalUntrack: (<T>(fn: () => T) => T) | null;
92
+ static _syncCompanions: (<T>(el: Signal<T> | Computed<T>, value: T) => void) | null;
93
+ static _updatePendingSignal: ((el: OptimisticNode) => void) | null;
94
+ static _updateChildCompanions: ((el: Computed<any>) => void) | null;
95
+ static _snapCompanions: ((el: OptimisticNode) => void) | null;
96
+ static _latestRead: (<T>(el: Signal<T> | Computed<T>) => T) | null;
97
+ static _pendingCheck: ((el: OptimisticNode, c: Computed<any> | null, owner: OptimisticNode, firewall: Computed<any> | null) => void) | null;
98
+ static _recordFresh: ((el: OptimisticNode, value: any) => void) | null;
99
+ static _applyReask: ((el: Computed<any>, hadReask: boolean) => boolean) | null;
100
+ static _repollVerdicts: ((el: Computed<any>) => void) | null;
101
+ static _witnessAffects: ((node: OptimisticNode) => void) | null;
102
+ static _optimisticWrite: (<T>(el: Signal<T> | Computed<T>, v: T | ((prev: T) => T)) => T) | null;
103
+ static _resolveOptimistic: ((nodes: OptimisticNode[]) => void) | null;
104
+ static _stashOptimistic: ((stashedTransition: Transition) => void) | null;
105
+ static _transitionBlocked: ((transition: Transition) => boolean) | null;
106
+ static _cleanupLanes: ((completingTransition: Transition | null) => void) | null;
107
+ static _runLaneEffects: ((type: number) => void) | null;
108
+ static _readStashed: ((el: Signal<any>) => boolean) | null;
109
+ static _gatedRead: ((el: Signal<any>, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
110
+ static _laneSuspends: ((owner: OptimisticNode) => boolean) | null;
111
+ static _laneReadsCommitted: ((el: OptimisticNode, owner: OptimisticNode, c: Computed<any>) => boolean) | null;
112
+ static _recomputeLane: ((el: Computed<any>, own: boolean) => OptimisticLane | null) | null;
113
+ static _laneAsyncPending: ((el: Computed<any>) => void) | null;
114
+ static _laneAsyncSettled: ((el: Computed<any>) => void) | null;
115
+ static _trackOptimisticStore: ((store: any) => void) | null;
91
116
  flush(): void;
92
117
  notify(node: Computed<any>, mask: number, flags: number, error?: any): boolean;
93
118
  initTransition(transition?: Transition | null): void;
@@ -96,7 +121,6 @@ export declare function queuePendingNode(node: Signal<any>): void;
96
121
  export declare function armReaskClear(): void;
97
122
  export declare function insertSubs(node: Signal<any> | Computed<any>, optimistic?: boolean): void;
98
123
  export declare function finalizePureQueue(completingTransition?: Transition | null, incomplete?: boolean): void;
99
- export declare function trackOptimisticStore(store: any): void;
100
124
  /**
101
125
  * Count of live `affects()` registrations across the system (including
102
126
  * store-scope inherited marks). Gates the read-path mark check in `read()` so
@@ -104,36 +128,13 @@ export declare function trackOptimisticStore(store: any): void;
104
128
  */
105
129
  export declare let activeAffectsMarks: number;
106
130
  /**
107
- * The counting half of a mark, shared by direct registration and store-scope
108
- * inheritance (a node created inside a live keyless mark's identity scope):
109
- * bumps the refcount and pokes the node's verdict companions so an
110
- * already-materialized `false` flips reactively.
111
- *
112
- * @internal
113
- */
114
- export declare function markAffects(node: OptimisticNode): void;
115
- /**
116
- * Registers one `affects()` mark on a node: counts it, records the
117
- * registration with the current transaction (after initTransition the queue's
118
- * array aliases the active transition's, mirroring `_optimisticNodes`), and
119
- * propagates STATUS_PENDING downstream on the status rails so everything
120
- * DERIVED from the marked data reads pending too. Propagation runs on every
121
- * registration (not just the first): subscribers gained since an earlier
122
- * overlapping registration get covered, and dedup stops re-descent early.
123
- *
124
- * @internal
125
- */
126
- export declare function registerAffectsMark(node: OptimisticNode): void;
127
- /**
128
- * Releases one registration. When the node's last mark drops, settles the
129
- * mark's sentinel out of every downstream `_pendingSources` (waking blocked
130
- * nodes and re-deriving verdicts along the walk). Companion writes go through
131
- * the settlement snap (committed, not transition-scoped) so releasing a mark
132
- * can't open a fresh override window that would itself need settlement.
131
+ * Counter mutation seam for the mark engine in affects.ts: an imported `let`
132
+ * binding is read-only, and the read-path gate above must stay a plain module
133
+ * variable so `read()` pays one integer compare, not a function call.
133
134
  *
134
135
  * @internal
135
136
  */
136
- export declare function releaseAffectsMark(node: OptimisticNode): void;
137
+ export declare function shiftAffectsMarks(delta: 1 | -1): void;
137
138
  export declare const globalQueue: GlobalQueue;
138
139
  /**
139
140
  * Synchronously processes the pending reactive queue, or runs `fn` in a synchronous
@@ -44,6 +44,15 @@ export interface RawSignal<T> {
44
44
  _transition: Transition | null;
45
45
  _pendingValue: T | typeof NOT_PENDING;
46
46
  _overrideValue?: T | typeof NOT_PENDING;
47
+ /**
48
+ * The transaction that owns the active override (stamped at optimistic
49
+ * write, cleared at settle). Ownership must live on the node: a lane's
50
+ * _transition is a scheduling affinity that a shared subscriber can merge
51
+ * across transactions (#2912) — following it would let one action's settle
52
+ * revert another action's live override. Node-level sibling of the store
53
+ * layer's STORE_OPTIMISTIC_OWNERS stamps (#2899). `null` = ambient write.
54
+ */
55
+ _overrideOwner?: Transition | null;
47
56
  _optimisticLane?: OptimisticLane;
48
57
  _pendingSignal?: Signal<boolean>;
49
58
  _latestValueComputed?: Computed<T>;
@@ -93,7 +102,6 @@ export interface Computed<T> extends RawSignal<T>, Owner {
93
102
  _depGen: number;
94
103
  _flags: number;
95
104
  _blocked?: boolean;
96
- _pendingSource?: Computed<any>;
97
105
  _pendingSources?: Set<Computed<any>>;
98
106
  _error?: unknown;
99
107
  _statusFlags: number;
@@ -0,0 +1,2 @@
1
+ export declare function latest<T>(fn: () => T): T;
2
+ export declare function isPending(fn: () => any): boolean;
@@ -63,4 +63,3 @@ export declare function createProjection<T extends object = {}>(fn: (draft: T) =
63
63
  */
64
64
  export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void, onDraftWrite?: () => void): Computed<void | T>;
65
65
  export declare function createWriteTraps(isActive?: () => boolean, onDraftWrite?: () => void): ProxyHandler<any>;
66
- export declare const writeTraps: ProxyHandler<any>;
@@ -1,4 +1,5 @@
1
1
  import { STORE_SNAPSHOT_PROPS, type Computed, type Refreshable, type Signal } from "../core/index.cjs";
2
+ import { type Transition } from "../core/scheduler.cjs";
2
3
  /** A read-only view of a store's value as seen by consumers. Mutate it via the paired `StoreSetter`. */
3
4
  export type Store<T> = Readonly<T>;
4
5
  /**
@@ -41,12 +42,13 @@ type DataNodes = Record<PropertyKey, DataNode>;
41
42
  * @internal
42
43
  */
43
44
  export declare const $TRACK: unique symbol, $TARGET: unique symbol, $PROXY: unique symbol, $DELETED: unique symbol, $AFFECTS: unique symbol;
44
- export declare const STORE_VALUE = "v", STORE_OVERRIDE = "o", STORE_OPTIMISTIC_OVERRIDE = "x", STORE_NODE = "n", STORE_HAS = "h", STORE_CUSTOM_PROTO = "c", STORE_WRAP = "w", STORE_LOOKUP = "l", STORE_FIREWALL = "f", STORE_OPTIMISTIC = "p";
45
+ export declare const STORE_VALUE = "v", STORE_OVERRIDE = "o", STORE_OPTIMISTIC_OVERRIDE = "x", STORE_NODE = "n", STORE_HAS = "h", STORE_CUSTOM_PROTO = "c", STORE_WRAP = "w", STORE_LOOKUP = "l", STORE_FIREWALL = "f", STORE_OPTIMISTIC = "p", STORE_OPTIMISTIC_OWNERS = "t", STORE_PARENT = "u", STORE_DESC = "d";
45
46
  export type StoreNode = {
46
47
  [$PROXY]: any;
47
48
  [STORE_VALUE]: Record<PropertyKey, any>;
48
49
  [STORE_OVERRIDE]?: Record<PropertyKey, any>;
49
50
  [STORE_OPTIMISTIC_OVERRIDE]?: Record<PropertyKey, any>;
51
+ [STORE_OPTIMISTIC_OWNERS]?: Record<PropertyKey, Transition | null>;
50
52
  [STORE_NODE]?: DataNodes;
51
53
  [STORE_HAS]?: DataNodes;
52
54
  [STORE_CUSTOM_PROTO]?: boolean;
@@ -55,6 +57,8 @@ export type StoreNode = {
55
57
  [STORE_FIREWALL]?: Computed<any>;
56
58
  [STORE_OPTIMISTIC]?: boolean;
57
59
  [STORE_SNAPSHOT_PROPS]?: Record<PropertyKey, any>;
60
+ [STORE_PARENT]?: StoreNode;
61
+ [STORE_DESC]?: boolean;
58
62
  };
59
63
  export declare namespace SolidStore {
60
64
  interface Unwrappable {
@@ -91,7 +95,7 @@ export declare function visibleNodeValue(node: DataNode): any;
91
95
  *
92
96
  * @internal
93
97
  */
94
- export declare function witnessAffectsMark(target: StoreNode): void;
98
+ export declare function witnessAffectsMark(target: StoreNode, property?: PropertyKey): void;
95
99
  /**
96
100
  * Resolves the store nodes an `affects()` declaration marks: with a `key`,
97
101
  * the named slot's leaf node (upserted so the mark has an addressable
@@ -114,6 +118,8 @@ export declare function notifySelf(target: StoreNode): void;
114
118
  */
115
119
  export declare function mergedOverlay(target: StoreNode): Record<PropertyKey, any> | undefined;
116
120
  export declare function getKeys(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, enumerable?: boolean): PropertyKey[];
121
+ export declare function getStoreKeys(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined): PropertyKey[];
122
+ export declare function getStoreSymbols(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined): symbol[];
117
123
  export declare function getPropertyDescriptor(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, property: PropertyKey): PropertyDescriptor | undefined;
118
124
  export declare const storeTraps: ProxyHandler<StoreNode>;
119
125
  export declare function storeSetter<T extends object>(store: Store<T>, fn: (draft: T) => T | void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidjs/signals",
3
- "version": "2.0.0-beta.18",
3
+ "version": "2.0.0-beta.20",
4
4
  "description": "Solid's reactive primitives: signals, memos, effects, stores, and async-aware computations.",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
@@ -14,7 +14,9 @@
14
14
  "access": "public"
15
15
  },
16
16
  "main": "./dist/node.cjs",
17
- "module": "./dist/prod.js",
17
+ "module": "./dist/prod/index.js",
18
+ "unpkg": "./dist/prod/index.js",
19
+ "jsdelivr": "./dist/prod/index.js",
18
20
  "types": "./dist/types/index.d.ts",
19
21
  "type": "module",
20
22
  "sideEffects": false,
@@ -28,7 +30,7 @@
28
30
  "types": "./dist/types/index.d.ts",
29
31
  "test": "./dist/dev.js",
30
32
  "development": "./dist/dev.js",
31
- "default": "./dist/prod.js"
33
+ "default": "./dist/prod/index.js"
32
34
  },
33
35
  "require": {
34
36
  "types": "./dist/types-cjs/index.d.cts",
@@ -40,12 +42,12 @@
40
42
  "devDependencies": {
41
43
  "@ianvs/prettier-plugin-sort-imports": "^4.1.1",
42
44
  "@rollup/plugin-replace": "^6.0.3",
43
- "@rollup/plugin-terser": "^0.4.4",
44
45
  "@rollup/plugin-typescript": "^12.3.0",
45
46
  "@types/node": "^25.0.8",
46
47
  "rimraf": "^5.0.1",
47
48
  "rollup": "^4.53.4",
48
49
  "rollup-plugin-prettier": "^4.1.2",
50
+ "terser": "^5.49.0",
49
51
  "tslib": "^2.8.1",
50
52
  "typescript": "^6.0.3",
51
53
  "vite": "^7.0.0",
@@ -53,8 +55,8 @@
53
55
  },
54
56
  "scripts": {
55
57
  "build": "npm-run-all -nl build:* && pnpm types",
56
- "build:clean": "rimraf dist/dev.js dist/prod.js dist/node.cjs",
57
- "build:js": "rollup -c",
58
+ "build:clean": "rimraf dist/dev dist/prod dist/node dist/dev.js dist/prod.js dist/node.cjs",
59
+ "build:js": "rollup -c && node ./scripts/mangle-props.mjs dist/prod dist/node.cjs && node ./scripts/check-pure.mjs dist/prod",
58
60
  "types": "tsc -p tsconfig.build.json && node ../../scripts/sync-dual-types.mjs ./dist/types ./dist/types-cjs",
59
61
  "test": "vitest run",
60
62
  "test:watch": "vitest watch tests",