@shadow-js/core 1.0.0 → 1.0.1

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 (117) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/dev/action.d.ts +0 -2
  3. package/dist/dev/action.js +1 -2
  4. package/dist/dev/cache.d.ts +0 -2
  5. package/dist/dev/cache.js +1 -2
  6. package/dist/dev/context.d.ts +0 -2
  7. package/dist/dev/context.js +1 -2
  8. package/dist/dev/effect.d.ts +0 -2
  9. package/dist/dev/effect.js +1 -2
  10. package/dist/dev/env.d.ts +0 -2
  11. package/dist/dev/env.js +1 -2
  12. package/dist/dev/events.d.ts +0 -2
  13. package/dist/dev/events.js +1 -2
  14. package/dist/dev/extend/index.d.ts +0 -2
  15. package/dist/dev/extend/index.js +1 -2
  16. package/dist/dev/external-store.d.ts +0 -2
  17. package/dist/dev/external-store.js +1 -2
  18. package/dist/dev/internal/concurrency.d.ts +0 -2
  19. package/dist/dev/internal/concurrency.js +1 -2
  20. package/dist/dev/internal/devtools.d.ts +0 -2
  21. package/dist/dev/internal/devtools.js +1 -2
  22. package/dist/dev/internal/diagnostics.d.ts +0 -2
  23. package/dist/dev/internal/diagnostics.js +1 -2
  24. package/dist/dev/internal/dispose.d.ts +0 -2
  25. package/dist/dev/internal/dispose.js +1 -2
  26. package/dist/dev/internal/flags.js +1 -2
  27. package/dist/dev/internal/graph.d.ts +0 -2
  28. package/dist/dev/internal/graph.js +1 -2
  29. package/dist/dev/internal/hydration-flag.d.ts +0 -2
  30. package/dist/dev/internal/hydration-flag.js +1 -2
  31. package/dist/dev/internal/messages.d.ts +0 -2
  32. package/dist/dev/internal/messages.js +1 -2
  33. package/dist/dev/internal/owner.d.ts +0 -2
  34. package/dist/dev/internal/owner.js +1 -2
  35. package/dist/dev/internal/queue.js +1 -2
  36. package/dist/dev/internal/scheduler.d.ts +0 -2
  37. package/dist/dev/internal/scheduler.js +1 -2
  38. package/dist/dev/internal/state.d.ts +0 -2
  39. package/dist/dev/internal/state.js +1 -2
  40. package/dist/dev/internal/suspension.d.ts +0 -2
  41. package/dist/dev/internal/suspension.js +1 -2
  42. package/dist/dev/internal/types.d.ts +0 -2
  43. package/dist/dev/list.d.ts +0 -2
  44. package/dist/dev/list.js +1 -2
  45. package/dist/dev/memo.d.ts +0 -2
  46. package/dist/dev/memo.js +1 -2
  47. package/dist/dev/optimistic.d.ts +0 -2
  48. package/dist/dev/optimistic.js +1 -2
  49. package/dist/dev/ownership.d.ts +0 -2
  50. package/dist/dev/ownership.js +1 -2
  51. package/dist/dev/props.d.ts +0 -2
  52. package/dist/dev/props.js +1 -2
  53. package/dist/dev/reaction.d.ts +0 -2
  54. package/dist/dev/reaction.js +1 -2
  55. package/dist/dev/reducer.d.ts +0 -2
  56. package/dist/dev/reducer.js +1 -2
  57. package/dist/dev/refs.d.ts +0 -2
  58. package/dist/dev/refs.js +1 -2
  59. package/dist/dev/resource.d.ts +0 -2
  60. package/dist/dev/resource.js +1 -2
  61. package/dist/dev/selector.d.ts +0 -2
  62. package/dist/dev/selector.js +1 -2
  63. package/dist/dev/signal.d.ts +0 -2
  64. package/dist/dev/signal.js +1 -2
  65. package/dist/dev/store/nodes.js +1 -2
  66. package/dist/dev/store/proxies.js +1 -2
  67. package/dist/dev/store/read.d.ts +0 -2
  68. package/dist/dev/store/read.js +1 -2
  69. package/dist/dev/store/reconcile.d.ts +0 -2
  70. package/dist/dev/store/reconcile.js +1 -2
  71. package/dist/dev/store/types.d.ts +0 -2
  72. package/dist/dev/store/use-store.d.ts +0 -2
  73. package/dist/dev/store/use-store.js +1 -2
  74. package/dist/dev/suspense.d.ts +0 -2
  75. package/dist/dev/suspense.js +1 -2
  76. package/dist/dev/transitions.d.ts +0 -2
  77. package/dist/dev/transitions.js +1 -2
  78. package/dist/server-dev/action.js +1 -2
  79. package/dist/server-dev/cache.js +1 -2
  80. package/dist/server-dev/context.js +1 -2
  81. package/dist/server-dev/effect.js +1 -2
  82. package/dist/server-dev/env.js +1 -2
  83. package/dist/server-dev/events.js +1 -2
  84. package/dist/server-dev/extend/index.js +1 -2
  85. package/dist/server-dev/external-store.js +1 -2
  86. package/dist/server-dev/internal/concurrency.js +1 -2
  87. package/dist/server-dev/internal/devtools.js +1 -2
  88. package/dist/server-dev/internal/diagnostics.js +1 -2
  89. package/dist/server-dev/internal/dispose.js +1 -2
  90. package/dist/server-dev/internal/flags.js +1 -2
  91. package/dist/server-dev/internal/graph.js +1 -2
  92. package/dist/server-dev/internal/hydration-flag.js +1 -2
  93. package/dist/server-dev/internal/messages.js +1 -2
  94. package/dist/server-dev/internal/owner.js +1 -2
  95. package/dist/server-dev/internal/queue.js +1 -2
  96. package/dist/server-dev/internal/scheduler.js +1 -2
  97. package/dist/server-dev/internal/state.js +1 -2
  98. package/dist/server-dev/internal/suspension.js +1 -2
  99. package/dist/server-dev/list.js +1 -2
  100. package/dist/server-dev/memo.js +1 -2
  101. package/dist/server-dev/optimistic.js +1 -2
  102. package/dist/server-dev/ownership.js +1 -2
  103. package/dist/server-dev/props.js +1 -2
  104. package/dist/server-dev/reaction.js +1 -2
  105. package/dist/server-dev/reducer.js +1 -2
  106. package/dist/server-dev/refs.js +1 -2
  107. package/dist/server-dev/resource.js +1 -2
  108. package/dist/server-dev/selector.js +1 -2
  109. package/dist/server-dev/signal.js +1 -2
  110. package/dist/server-dev/store/nodes.js +1 -2
  111. package/dist/server-dev/store/proxies.js +1 -2
  112. package/dist/server-dev/store/read.js +1 -2
  113. package/dist/server-dev/store/reconcile.js +1 -2
  114. package/dist/server-dev/store/use-store.js +1 -2
  115. package/dist/server-dev/suspense.js +1 -2
  116. package/dist/server-dev/transitions.js +1 -2
  117. package/package.json +1 -1
@@ -1,5 +1,4 @@
1
1
  import { Accessor, Equals } from "./internal/types.js";
2
- //#region src/memo.d.ts
3
2
  /**
4
3
  * Options of {@link useMemo}.
5
4
  * @since 1.0.0
@@ -56,5 +55,4 @@ export interface MemoOptions<T> {
56
55
  * @since 1.0.0
57
56
  */
58
57
  export declare function useMemo<T>(fn: (previous: T | undefined) => T, options?: MemoOptions<T>): Accessor<T>;
59
- //#endregion
60
58
  //# sourceMappingURL=memo.d.ts.map
package/dist/dev/memo.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createComputation, readComputation } from "./extend/index.js";
2
- //#region src/memo.ts
2
+ // src/memo.ts
3
3
  /**
4
4
  * Creates a cached derivation that recomputes only when a dependency actually changed.
5
5
  * Dependencies are discovered on every run, so branches that are not taken are not tracked.
@@ -35,7 +35,6 @@ function useMemo(fn, options) {
35
35
  });
36
36
  return () => readComputation(node);
37
37
  }
38
- //#endregion
39
38
  export { useMemo };
40
39
 
41
40
  //# sourceMappingURL=memo.js.map
@@ -1,5 +1,4 @@
1
1
  import { Accessor } from "./internal/types.js";
2
- //#region src/optimistic.d.ts
3
2
  /**
4
3
  * Optimistic state: shows `reducer` applied over the real value for every action whose
5
4
  * `settled` promise is still pending. When the promise settles (either way) the action is
@@ -22,5 +21,4 @@ import { Accessor } from "./internal/types.js";
22
21
  * @since 1.0.0
23
22
  */
24
23
  export declare function useOptimistic<T, A>(source: Accessor<T>, reducer: (state: T, action: A) => T): [Accessor<T>, (action: A, settled: Promise<unknown>) => void];
25
- //#endregion
26
24
  //# sourceMappingURL=optimistic.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { useSignal } from "./signal.js";
2
2
  import { useMemo } from "./memo.js";
3
- //#region src/optimistic.ts
3
+ // src/optimistic.ts
4
4
  /**
5
5
  * Optimistic state: shows `reducer` applied over the real value for every action whose
6
6
  * `settled` promise is still pending. When the promise settles (either way) the action is
@@ -39,7 +39,6 @@ function useOptimistic(source, reducer) {
39
39
  };
40
40
  return [state, apply];
41
41
  }
42
- //#endregion
43
42
  export { useOptimistic };
44
43
 
45
44
  //# sourceMappingURL=optimistic.js.map
@@ -1,6 +1,5 @@
1
1
  import { Cleanup, ErrorHandler } from "./internal/types.js";
2
2
  import { Owner } from "./internal/owner.js";
3
- //#region src/ownership.d.ts
4
3
  /**
5
4
  * Runs `fn` without subscribing the running computation to anything `fn` reads. Use it inside an
6
5
  * effect or a memo to read a value without re-running when that value changes. The current owner
@@ -199,6 +198,5 @@ export declare function catchError<T>(fn: () => T, handler: ErrorHandler): T | u
199
198
  * @since 1.0.0
200
199
  */
201
200
  export declare function useId(): string;
202
- //#endregion
203
201
  export type { Owner };
204
202
  //# sourceMappingURL=ownership.d.ts.map
@@ -2,7 +2,7 @@ import { ShadowError, warn } from "./internal/diagnostics.js";
2
2
  import { Owner, addCleanup, handleError } from "./internal/owner.js";
3
3
  import { disposeTree } from "./internal/dispose.js";
4
4
  import { currentOwner, runInScope } from "./extend/index.js";
5
- //#region src/ownership.ts
5
+ // src/ownership.ts
6
6
  /**
7
7
  * Runs `fn` without subscribing the running computation to anything `fn` reads. Use it inside an
8
8
  * effect or a memo to read a value without re-running when that value changes. The current owner
@@ -255,7 +255,6 @@ function useId() {
255
255
  owner.idCount += 1;
256
256
  return `s${path.join("-")}_${sequence}`;
257
257
  }
258
- //#endregion
259
258
  export { catchError, createRoot, getOwner, onCleanup, onError, runWithOwner, untrack, useId };
260
259
 
261
260
  //# sourceMappingURL=ownership.js.map
@@ -1,4 +1,3 @@
1
- //#region src/props.d.ts
2
1
  /**
3
2
  * A value accepted by {@link mergeProps}: an object, a function that returns one (called at every
4
3
  * read, so it can be reactive), or `null`, `undefined` or `false`, which are skipped. Use it to type
@@ -129,6 +128,5 @@ export declare function splitProps<T extends object, const K extends readonly (r
129
128
  * @since 1.0.0
130
129
  */
131
130
  export declare function children(fn: () => unknown): ResolvedChildren;
132
- //#endregion
133
131
  export {};
134
132
  //# sourceMappingURL=props.d.ts.map
package/dist/dev/props.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { untrack } from "./ownership.js";
2
2
  import { useMemo } from "./memo.js";
3
- //#region src/props.ts
3
+ // src/props.ts
4
4
  /**
5
5
  * Keys that never take part in a merge or a split. Reading them through a props object that came
6
6
  * from JSON or from user input could reach `Object.prototype`, so they are skipped everywhere.
@@ -276,7 +276,6 @@ function children(fn) {
276
276
  }
277
277
  });
278
278
  }
279
- //#endregion
280
279
  export { children, mergeProps, splitProps };
281
280
 
282
281
  //# sourceMappingURL=props.js.map
@@ -1,4 +1,3 @@
1
- //#region src/reaction.d.ts
2
1
  /**
3
2
  * Creates a tracker that reports the first change of what it reads. `useReaction(onInvalidate)`
4
3
  * returns `track(fn)`: `fn` runs at once (synchronously) and the signals it reads are recorded.
@@ -25,5 +24,4 @@
25
24
  * @since 1.0.0
26
25
  */
27
26
  export declare function useReaction(onInvalidate: () => void): (track: () => void) => void;
28
- //#endregion
29
27
  //# sourceMappingURL=reaction.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { untrack } from "./ownership.js";
2
2
  import { disposeTree } from "./internal/dispose.js";
3
3
  import { createComputation, createOwner, currentOwner, runInScope } from "./extend/index.js";
4
- //#region src/reaction.ts
4
+ // src/reaction.ts
5
5
  /**
6
6
  * Creates a tracker that reports the first change of what it reads. `useReaction(onInvalidate)`
7
7
  * returns `track(fn)`: `fn` runs at once (synchronously) and the signals it reads are recorded.
@@ -55,7 +55,6 @@ function useReaction(onInvalidate) {
55
55
  });
56
56
  };
57
57
  }
58
- //#endregion
59
58
  export { useReaction };
60
59
 
61
60
  //# sourceMappingURL=reaction.js.map
@@ -1,5 +1,4 @@
1
1
  import { Accessor, Equals } from "./internal/types.js";
2
- //#region src/reducer.d.ts
3
2
  /** Options of {@link useReducer}. @since 1.0.0 */
4
3
  export interface ReducerOptions {
5
4
  /**
@@ -37,5 +36,4 @@ export interface ReducerOptions {
37
36
  * @since 1.0.0
38
37
  */
39
38
  export declare function useReducer<S, A>(reducer: (state: S, action: A) => S, initialState: S, options?: ReducerOptions): [Accessor<S>, (action: A) => void];
40
- //#endregion
41
39
  //# sourceMappingURL=reducer.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { useSignal } from "./signal.js";
2
- //#region src/reducer.ts
2
+ // src/reducer.ts
3
3
  /**
4
4
  * A state cell whose writes go through a reducer: `dispatch(action)` stores
5
5
  * `reducer(state, action)`. Equivalent to `useSignal` with the transition written in one place,
@@ -33,7 +33,6 @@ function useReducer(reducer, initialState, options) {
33
33
  };
34
34
  return [state, dispatch];
35
35
  }
36
- //#endregion
37
36
  export { useReducer };
38
37
 
39
38
  //# sourceMappingURL=reducer.js.map
@@ -1,4 +1,3 @@
1
- //#region src/refs.d.ts
2
1
  /**
3
2
  * A ref object that is also a ref callback: pass it as `ref={r}` (the renderer calls it with the
4
3
  * element) and read the element as `r.current`. `undefined` when nothing is attached.
@@ -48,5 +47,4 @@ export declare function createRef<T>(): Ref<T>;
48
47
  * @since 1.0.0
49
48
  */
50
49
  export declare function useImperativeHandle<T>(ref: ((value: T | undefined) => void) | null | undefined, create: () => T): void;
51
- //#endregion
52
50
  //# sourceMappingURL=refs.d.ts.map
package/dist/dev/refs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { onCleanup, untrack } from "./ownership.js";
2
- //#region src/refs.ts
2
+ // src/refs.ts
3
3
  /**
4
4
  * Creates a {@link Ref}. Calling it with a value stores the value; calling it with `undefined`
5
5
  * clears it. The same object works as a plain ref callback, so no `forwardRef` is needed.
@@ -52,7 +52,6 @@ function useImperativeHandle(ref, create) {
52
52
  ref(untrack(create));
53
53
  onCleanup(() => ref(void 0));
54
54
  }
55
- //#endregion
56
55
  export { createRef, useImperativeHandle };
57
56
 
58
57
  //# sourceMappingURL=refs.js.map
@@ -1,5 +1,4 @@
1
1
  import { Accessor } from "./internal/types.js";
2
- //#region src/resource.d.ts
3
2
  /**
4
3
  * Where a {@link Resource} is in its life: `"unresolved"` (no value and no fetch, for example while
5
4
  * the source is falsy), `"pending"` (the first fetch is in flight), `"ready"` (a value is shown and
@@ -131,5 +130,4 @@ export declare function useResource<S, T>(source: Accessor<S | false | null | un
131
130
  export declare function useResource<S extends string | number | boolean | bigint | object, T>(source: S, fetcher: (source: S, info: ResourceInfo) => T | Promise<T>, options?: ResourceOptions<T>): Resource<T>;
132
131
  export declare function useResource<T>(fetcher: (info: ResourceInfo<T>) => T | Promise<T>, options?: ResourceOptions<T>): Resource<T>;
133
132
  export declare function useResource<S, T>(source: Accessor<S | false | null | undefined>, fetcher: (source: S, info: ResourceInfo<T>) => T | Promise<T>, options?: ResourceOptions<T>): Resource<T>;
134
- //#endregion
135
133
  //# sourceMappingURL=resource.d.ts.map
@@ -7,7 +7,7 @@ import { useContext } from "./context.js";
7
7
  import { ResourceCacheContext, SuspenseContext } from "./suspense.js";
8
8
  import { holdReader, inTransition } from "./internal/concurrency.js";
9
9
  import { createSignalNode, currentListener, currentOwner, writeSignal } from "./extend/index.js";
10
- //#region src/resource.ts
10
+ // src/resource.ts
11
11
  /**
12
12
  * A signal cell whose writes are allowed everywhere (see {@link createSignalNode}). `distinct`
13
13
  * false notifies on every write, true only when the value changes.
@@ -171,7 +171,6 @@ function useResource(first, second, third) {
171
171
  });
172
172
  return read;
173
173
  }
174
- //#endregion
175
174
  export { useResource };
176
175
 
177
176
  //# sourceMappingURL=resource.js.map
@@ -1,4 +1,3 @@
1
- //#region src/selector.d.ts
2
1
  /**
3
2
  * Creates a selection set over `source`. `isSelected(key)` answers whether `key` matches the
4
3
  * current source value. Reading it inside an effect or memo subscribes only to that key's boolean,
@@ -30,5 +29,4 @@
30
29
  * @since 1.0.0
31
30
  */
32
31
  export declare function useSelector<T, K = T>(source: () => T, equals?: (key: K, value: T) => boolean): (key: K) => boolean;
33
- //#endregion
34
32
  //# sourceMappingURL=selector.d.ts.map
@@ -2,7 +2,7 @@ import { track } from "./internal/graph.js";
2
2
  import { onCleanup, untrack } from "./ownership.js";
3
3
  import { useRenderEffect } from "./effect.js";
4
4
  import { isTracking, notify } from "./extend/index.js";
5
- //#region src/selector.ts
5
+ // src/selector.ts
6
6
  /**
7
7
  * The boolean for one key, shared by every reader that asked about that key. It is a reactive source itself (the
8
8
  * shape `track` and `notify` take), so a key costs one object where a separate signal would cost two.
@@ -112,7 +112,6 @@ function useSelector(source, equals) {
112
112
  });
113
113
  return isSelected;
114
114
  }
115
- //#endregion
116
115
  export { useSelector };
117
116
 
118
117
  //# sourceMappingURL=selector.js.map
@@ -1,5 +1,4 @@
1
1
  import { Accessor, Equals, Setter } from "./internal/types.js";
2
- //#region src/signal.d.ts
3
2
  /**
4
3
  * Options of {@link useSignal}.
5
4
  * @since 1.0.0
@@ -38,5 +37,4 @@ export interface SignalOptions<T> {
38
37
  * @since 1.0.0
39
38
  */
40
39
  export declare function useSignal<T>(value: T, options?: SignalOptions<T>): [Accessor<T>, Setter<T>];
41
- //#endregion
42
40
  //# sourceMappingURL=signal.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { readSignal } from "./internal/graph.js";
2
2
  import { untrack } from "./ownership.js";
3
3
  import { createSignalNode, writeSignal } from "./extend/index.js";
4
- //#region src/signal.ts
4
+ // src/signal.ts
5
5
  /**
6
6
  * Creates a reactive cell holding one value: the low-level primitive `useStore` builds on. Reads
7
7
  * inside effects and memos subscribe them; writes notify them. Works at module scope.
@@ -33,7 +33,6 @@ function useSignal(value, options) {
33
33
  });
34
34
  return [read, write];
35
35
  }
36
- //#endregion
37
36
  export { useSignal };
38
37
 
39
38
  //# sourceMappingURL=signal.js.map
@@ -1,6 +1,6 @@
1
1
  import { track } from "../internal/graph.js";
2
2
  import { createSignalNode, isTracking, notify as notify$1 } from "../extend/index.js";
3
- //#region src/store/nodes.ts
3
+ // src/store/nodes.ts
4
4
  /** Keys that could reach `Object.prototype` if written; they are never stored as own properties. */
5
5
  const RESERVED_KEYS = /* @__PURE__ */ new Set([
6
6
  "__proto__",
@@ -186,7 +186,6 @@ function deleteRaw(target, key) {
186
186
  notify(node.keys);
187
187
  return true;
188
188
  }
189
- //#endregion
190
189
  export { NODES, RAW, deleteRaw, isReservedKey, isWrappable, nodeOf, readRaw, trackKeys, trackProperty, unwrapDeep, unwrapValue, writeRaw };
191
190
 
192
191
  //# sourceMappingURL=nodes.js.map
@@ -1,5 +1,5 @@
1
1
  import { RAW, deleteRaw, isReservedKey, isWrappable, nodeOf, readRaw, trackKeys, trackProperty, unwrapValue, writeRaw } from "./nodes.js";
2
- //#region src/store/proxies.ts
2
+ // src/store/proxies.ts
3
3
  /**
4
4
  * One `setStore` call. Drafts made for it are cached here, so a draft object keeps its identity
5
5
  * inside the update, and they stop accepting writes when the call returns.
@@ -154,7 +154,6 @@ function draftOf(raw, tx) {
154
154
  tx.drafts.set(raw, proxy);
155
155
  return proxy;
156
156
  }
157
- //#endregion
158
157
  export { Transaction, draftOf, readProxyOf };
159
158
 
160
159
  //# sourceMappingURL=proxies.js.map
@@ -1,5 +1,4 @@
1
1
  import { Mutable, Store } from "./types.js";
2
- //#region src/store/read.d.ts
3
2
  /**
4
3
  * Returns the raw data behind a store. Reads and writes on the result bypass tracking and
5
4
  * notification, so writing to it is a bug; use it for identity checks and passing data on.
@@ -35,5 +34,4 @@ export declare function unwrap<T>(store: Store<T>): Mutable<T>;
35
34
  * @since 1.0.0
36
35
  */
37
36
  export declare function snapshot<T>(store: Store<T>): Mutable<T>;
38
- //#endregion
39
37
  //# sourceMappingURL=read.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { isReservedKey, isWrappable, readRaw, unwrapValue } from "./nodes.js";
2
- //#region src/store/read.ts
2
+ // src/store/read.ts
3
3
  /**
4
4
  * Returns the raw data behind a store. Reads and writes on the result bypass tracking and
5
5
  * notification, so writing to it is a bug; use it for identity checks and passing data on.
@@ -66,7 +66,6 @@ function snapshot(store) {
66
66
  }
67
67
  return out;
68
68
  }
69
- //#endregion
70
69
  export { snapshot, unwrap };
71
70
 
72
71
  //# sourceMappingURL=read.js.map
@@ -1,5 +1,4 @@
1
1
  import { Reconciler } from "./types.js";
2
- //#region src/store/reconcile.d.ts
3
2
  /**
4
3
  * Options of {@link reconcile}.
5
4
  * @since 1.0.0
@@ -69,5 +68,4 @@ export declare function reconcile<T>(next: T, options?: ReconcileOptions): Recon
69
68
  * @since 1.0.0
70
69
  */
71
70
  export declare function produce<T>(update: (draft: T) => void): (draft: T) => void;
72
- //#endregion
73
71
  //# sourceMappingURL=reconcile.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { deleteRaw, isReservedKey, isWrappable, unwrapValue, writeRaw } from "./nodes.js";
2
- //#region src/store/reconcile.ts
2
+ // src/store/reconcile.ts
3
3
  /** Each reconciler function maps to its spec. Keys are the reconciler functions themselves. */
4
4
  const SPECS = /* @__PURE__ */ new WeakMap();
5
5
  /**
@@ -180,7 +180,6 @@ function mergeArray(target, source, spec, enqueue) {
180
180
  function produce(update) {
181
181
  return update;
182
182
  }
183
- //#endregion
184
183
  export { applyReconcile, produce, reconcile, specOf };
185
184
 
186
185
  //# sourceMappingURL=reconcile.js.map
@@ -1,5 +1,4 @@
1
1
  import { Accessor, Setter } from "../internal/types.js";
2
- //#region src/store/types.d.ts
3
2
  /** Values that are never wrapped in a store view: primitives, functions and built-in objects. */
4
3
  type Opaque = string | number | bigint | boolean | symbol | null | undefined | ((...args: never[]) => unknown) | Date | RegExp | Map<unknown, unknown> | Set<unknown> | WeakMap<object, unknown> | WeakSet<object> | Promise<unknown>;
5
4
  /**
@@ -101,6 +100,5 @@ export type NotMixed<T> = IsMixed<T> extends true ? never : unknown;
101
100
  * @since 1.0.0
102
101
  */
103
102
  export type MixedInitial<T> = Extract<T, Opaque>;
104
- //#endregion
105
103
  export {};
106
104
  //# sourceMappingURL=types.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { MixedInitial, NotMixed, StoreResult } from "./types.js";
2
- //#region src/store/use-store.d.ts
3
2
  /**
4
3
  * Options of {@link useStore}.
5
4
  * @since 1.0.0
@@ -56,5 +55,4 @@ export interface StoreOptions {
56
55
  */
57
56
  export declare function useStore<T extends NotMixed<T>>(initial: T, options?: StoreOptions): StoreResult<T>;
58
57
  export declare function useStore<T>(initial: MixedInitial<T>, options?: StoreOptions): StoreResult<T>;
59
- //#endregion
60
58
  //# sourceMappingURL=use-store.d.ts.map
@@ -8,7 +8,7 @@ import { isReservedKey, isWrappable, unwrapValue } from "./nodes.js";
8
8
  import { snapshot } from "./read.js";
9
9
  import { applyReconcile, reconcile, specOf } from "./reconcile.js";
10
10
  import { Transaction, draftOf, readProxyOf } from "./proxies.js";
11
- //#region src/store/use-store.ts
11
+ // src/store/use-store.ts
12
12
  function isPlainObject(value) {
13
13
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
14
14
  const prototype = Object.getPrototypeOf(value);
@@ -162,7 +162,6 @@ function wrapCell(value) {
162
162
  const raw = unwrapValue(value);
163
163
  return isWrappable(raw) ? readProxyOf(raw) : value;
164
164
  }
165
- //#endregion
166
165
  export { useStore };
167
166
 
168
167
  //# sourceMappingURL=use-store.js.map
@@ -1,5 +1,4 @@
1
1
  import { Context } from "./context.js";
2
- //#region src/suspense.d.ts
3
2
  /**
4
3
  * Counter protocol between asynchronous sources and the nearest `<Suspense>` boundary.
5
4
  * A source calls `increment()` when it starts blocking its readers and `decrement()` exactly once
@@ -97,5 +96,4 @@ export interface ResourceTrackOptions {
97
96
  * @since 1.0.0
98
97
  */
99
98
  export declare const ResourceCacheContext: Context<ResourceCache | null>;
100
- //#endregion
101
99
  //# sourceMappingURL=suspense.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { createContext } from "./context.js";
2
- //#region src/suspense.ts
2
+ // src/suspense.ts
3
3
  /**
4
4
  * The context through which an asynchronous source finds the nearest `<Suspense>` boundary. Each
5
5
  * boundary provides its {@link SuspenseTracker}; the value is `null` outside any boundary. Read it
@@ -39,7 +39,6 @@ const SuspenseContext = /* @__PURE__ */ createContext(null, { name: "Suspense" }
39
39
  * @since 1.0.0
40
40
  */
41
41
  const ResourceCacheContext = /* @__PURE__ */ createContext(null, { name: "ResourceCache" });
42
- //#endregion
43
42
  export { ResourceCacheContext, SuspenseContext };
44
43
 
45
44
  //# sourceMappingURL=suspense.js.map
@@ -1,6 +1,5 @@
1
1
  import { Accessor, Equals } from "./internal/types.js";
2
2
  import { inTransition } from "./internal/concurrency.js";
3
- //#region src/transitions.d.ts
4
3
  /**
5
4
  * Options of {@link useDeferredValue}.
6
5
  * @since 1.0.0
@@ -73,5 +72,4 @@ export declare function useTransition(): [Accessor<boolean>, (fn: () => void) =>
73
72
  * @since 1.0.0
74
73
  */
75
74
  export declare function useDeferredValue<T>(source: Accessor<T>, options?: DeferredValueOptions<T>): Accessor<T>;
76
- //#endregion
77
75
  //# sourceMappingURL=transitions.d.ts.map
@@ -2,7 +2,7 @@ import { untrack } from "./ownership.js";
2
2
  import { useSignal } from "./signal.js";
3
3
  import { registerTransitionLane, startTransition } from "./internal/concurrency.js";
4
4
  import { createComputation } from "./extend/index.js";
5
- //#region src/transitions.ts
5
+ // src/transitions.ts
6
6
  /**
7
7
  * Runs `fn` as a transition and reports whether it is pending. Returns `[isPending, start]`:
8
8
  * `isPending` is true from `start(fn)` until the transition has been applied (including any Suspense
@@ -95,7 +95,6 @@ function useDeferredValue(source, options) {
95
95
  });
96
96
  return value;
97
97
  }
98
- //#endregion
99
98
  export { useDeferredValue, useTransition };
100
99
 
101
100
  //# sourceMappingURL=transitions.js.map
@@ -3,7 +3,7 @@ import { batch } from "./internal/scheduler.js";
3
3
  import { untrack } from "./ownership.js";
4
4
  import { useSignal } from "./signal.js";
5
5
  import { currentOwner } from "./extend/index.js";
6
- //#region src/action.ts
6
+ // src/action.ts
7
7
  function isPromiseLike(value) {
8
8
  return value !== null && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
9
9
  }
@@ -84,7 +84,6 @@ function useAction(action, initialState) {
84
84
  pending
85
85
  ];
86
86
  }
87
- //#endregion
88
87
  export { useAction };
89
88
 
90
89
  //# sourceMappingURL=action.js.map
@@ -1,5 +1,5 @@
1
1
  import { currentOwner } from "./extend/index.js";
2
- //#region src/cache.ts
2
+ // src/cache.ts
3
3
  function sameArgs(a, b) {
4
4
  if (a.length !== b.length) return false;
5
5
  for (let i = 0; i < a.length; i += 1) if (!Object.is(a[i], b[i])) return false;
@@ -56,7 +56,6 @@ function cache(fn, options) {
56
56
  return value;
57
57
  };
58
58
  }
59
- //#endregion
60
59
  export { cache };
61
60
 
62
61
  //# sourceMappingURL=cache.js.map
@@ -2,7 +2,7 @@ import { ShadowError } from "./internal/diagnostics.js";
2
2
  import { Owner } from "./internal/owner.js";
3
3
  import { runWithOwner } from "./ownership.js";
4
4
  import { currentOwner } from "./extend/index.js";
5
- //#region src/context.ts
5
+ // src/context.ts
6
6
  /**
7
7
  * Creates a context: a value that components read with {@link useContext} without passing it
8
8
  * through props. Render the returned component around a subtree to provide a value. The value is
@@ -102,7 +102,6 @@ function useContext(context) {
102
102
  if (context.defaultValue === void 0) throw new ShadowError("CONTEXT_MISSING");
103
103
  return context.defaultValue;
104
104
  }
105
- //#endregion
106
105
  export { createContext, runWithContext, useContext };
107
106
 
108
107
  //# sourceMappingURL=context.js.map
@@ -1,5 +1,5 @@
1
1
  import { warn } from "./internal/diagnostics.js";
2
- //#region src/effect.ts
2
+ // src/effect.ts
3
3
  function useEffect(first, second, third) {
4
4
  if (typeof second === "function") third?.defer, third?.name;
5
5
  else {
@@ -50,7 +50,6 @@ function useRenderEffect(compute, apply) {}
50
50
  * @since 1.0.0
51
51
  */
52
52
  function onMount(fn) {}
53
- //#endregion
54
53
  export { onMount, useEffect, useRenderEffect };
55
54
 
56
55
  //# sourceMappingURL=effect.js.map
@@ -1,4 +1,4 @@
1
- //#region src/env.ts
1
+ // src/env.ts
2
2
  /**
3
3
  * True in the server condition build, where effects never run and rendering produces strings. Use
4
4
  * it to skip browser-only work. The value is fixed per build: the package export conditions
@@ -25,7 +25,6 @@ const isServer = true;
25
25
  * @since 1.0.0
26
26
  */
27
27
  const isDev = true;
28
- //#endregion
29
28
  export { isDev, isServer };
30
29
 
31
30
  //# sourceMappingURL=env.js.map
@@ -1,5 +1,5 @@
1
1
  import { untrack } from "./ownership.js";
2
- //#region src/events.ts
2
+ // src/events.ts
3
3
  /**
4
4
  * A stable callback that always runs its handler untracked. The ShadowJS form of React's
5
5
  * `useEffectEvent`: components run once and props are getters, so the handler already sees the
@@ -27,7 +27,6 @@ import { untrack } from "./ownership.js";
27
27
  function useEvent(handler) {
28
28
  return (...args) => untrack(() => handler(...args));
29
29
  }
30
- //#endregion
31
30
  export { useEvent };
32
31
 
33
32
  //# sourceMappingURL=events.js.map
@@ -11,7 +11,7 @@ import { disposeTree } from "../internal/dispose.js";
11
11
  import { SUSPENSION, isSuspension } from "../internal/suspension.js";
12
12
  import { beginHold, createTransitionHold, endHold, holdReader, inTransition, pauseOwner, registerTransitionLane, resumeOwner, startTransition, transitionHooks, wakeSuspended } from "../internal/concurrency.js";
13
13
  import { isHydrating, withHydration } from "../internal/hydration-flag.js";
14
- //#region src/extend.ts
14
+ // src/extend.ts
15
15
  /**
16
16
  * The extension API: everything the built-in hooks (`useSignal`, `useMemo`, `useEffect`,
17
17
  * `useStore`, `useResource`, `mapArray`, `useSelector`, contexts, ...) are built from. They import
@@ -311,7 +311,6 @@ function refresh(node) {
311
311
  function createOwner(parent) {
312
312
  return new Owner(parent === void 0 ? rt.owner : parent);
313
313
  }
314
- //#endregion
315
314
  export { Computation as ComputationNode, DEVTOOLS_EVENT, MESSAGES, Owner, SUSPENSION, ShadowError, Signal as SignalNode, addCleanup, batch, beginHold, createComputation, createOwner, createSignalNode, createTransitionHold, currentListener, currentOwner, report as devtoolsReport, disposeTree as disposeOwner, endHold, flush, flushSync, formatMessage, group, handleError, holdReader, inTransition, isComputingMemo, isHydrating, isSuspension, isTracking, markObservers, notify, observersOf, pauseOwner, readComputation, readSignal, refresh, registerTransitionLane, resetWarningDedupe, resumeOwner, runInScope, runWithContext, schedule, setWarningListener, sourcesOf, startTransition, track, transitionHooks, wakeSuspended, warn, withHydration, writeSignal };
316
315
 
317
316
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { untrack } from "./ownership.js";
2
- //#region src/external-store.ts
2
+ // src/external-store.ts
3
3
  /**
4
4
  * Reads a value that lives outside ShadowJS (a store, a browser API, an observable) as a reactive
5
5
  * accessor. The one bridge for every external source, and the ShadowJS form of React's
@@ -40,7 +40,6 @@ function useExternalStore(subscribe, getSnapshot, options) {
40
40
  return () => snapshot;
41
41
  }
42
42
  }
43
- //#endregion
44
43
  export { useExternalStore };
45
44
 
46
45
  //# sourceMappingURL=external-store.js.map
@@ -10,7 +10,7 @@ import { runWithContext } from "../context.js";
10
10
  import { SuspenseContext } from "../suspense.js";
11
11
  import { disposeTree } from "./dispose.js";
12
12
  import { SUSPENSION, isSuspension } from "./suspension.js";
13
- //#region src/internal/concurrency.ts
13
+ // src/internal/concurrency.ts
14
14
  /** Transition-lane effects run per macrotask; between two chunks urgent work and input can run. */
15
15
  const LANE_CHUNK = 64;
16
16
  /** Visits `root` and every node below it. Iterative: the depth is user controlled. */
@@ -627,7 +627,6 @@ function pauseOwner(owner) {
627
627
  function resumeOwner(owner) {
628
628
  rt.hooks?.resume(owner);
629
629
  }
630
- //#endregion
631
630
  export { beginHold, createTransitionHold, endHold, holdReader, inTransition, pauseOwner, registerTransitionLane, resumeOwner, startTransition, transitionHooks, wakeSuspended };
632
631
 
633
632
  //# sourceMappingURL=concurrency.js.map