signalium 3.0.3 → 4.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 (143) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/cjs/development/{component-shared-DzjqSRY-.js → component-shared-CU7qN_Ks.js} +2 -2
  3. package/dist/cjs/development/{component-shared-DzjqSRY-.js.map → component-shared-CU7qN_Ks.js.map} +1 -1
  4. package/dist/cjs/development/config-D6wyrhrW.js +58 -0
  5. package/dist/cjs/development/config-D6wyrhrW.js.map +1 -0
  6. package/dist/cjs/development/config.js +1 -1
  7. package/dist/cjs/development/{debug-CDy1L3Id.js → debug-BS6RdX4D.js} +252 -32
  8. package/dist/cjs/development/debug-BS6RdX4D.js.map +1 -0
  9. package/dist/cjs/development/debug.js +3 -1
  10. package/dist/cjs/development/debug.js.map +1 -1
  11. package/dist/cjs/development/index.js +3 -2
  12. package/dist/cjs/development/index.js.map +1 -1
  13. package/dist/cjs/development/react/index.js +399 -52
  14. package/dist/cjs/development/react/index.js.map +1 -1
  15. package/dist/cjs/development/react/index.server.js +2 -2
  16. package/dist/cjs/development/react/index.server.js.map +1 -1
  17. package/dist/cjs/development/react/server.js +1 -1
  18. package/dist/cjs/development/{snapshot-D8Ydfj9E.js → snapshot-BLa9mv8h.js} +4 -2
  19. package/dist/cjs/development/snapshot-BLa9mv8h.js.map +1 -0
  20. package/dist/cjs/development/transform/index.js +5 -2
  21. package/dist/cjs/development/transform/index.js.map +1 -1
  22. package/dist/cjs/development/utils.js +34 -2
  23. package/dist/cjs/development/utils.js.map +1 -1
  24. package/dist/cjs/production/{component-shared-BuDl2V-v.js → component-shared-BrbkxFeg.js} +2 -2
  25. package/dist/cjs/production/{component-shared-BuDl2V-v.js.map → component-shared-BrbkxFeg.js.map} +1 -1
  26. package/dist/cjs/production/config-BHvmcsLQ.js +52 -0
  27. package/dist/cjs/production/config-BHvmcsLQ.js.map +1 -0
  28. package/dist/cjs/production/config.js +1 -1
  29. package/dist/cjs/production/{contexts-CMvA-Ae9.js → contexts-Bkwv59kH.js} +252 -32
  30. package/dist/cjs/production/contexts-Bkwv59kH.js.map +1 -0
  31. package/dist/cjs/production/debug.js +3 -1
  32. package/dist/cjs/production/debug.js.map +1 -1
  33. package/dist/cjs/production/index.js +3 -2
  34. package/dist/cjs/production/index.js.map +1 -1
  35. package/dist/cjs/production/react/index.js +399 -52
  36. package/dist/cjs/production/react/index.js.map +1 -1
  37. package/dist/cjs/production/react/index.server.js +2 -2
  38. package/dist/cjs/production/react/index.server.js.map +1 -1
  39. package/dist/cjs/production/react/server.js +1 -1
  40. package/dist/cjs/production/{snapshot-I8W4cb8t.js → snapshot-gv-aZDmB.js} +4 -2
  41. package/dist/cjs/production/snapshot-gv-aZDmB.js.map +1 -0
  42. package/dist/cjs/production/transform/index.js +5 -2
  43. package/dist/cjs/production/transform/index.js.map +1 -1
  44. package/dist/cjs/production/utils.js +34 -2
  45. package/dist/cjs/production/utils.js.map +1 -1
  46. package/dist/esm/config.d.ts +1 -1
  47. package/dist/esm/config.d.ts.map +1 -1
  48. package/dist/esm/debug.d.ts +1 -0
  49. package/dist/esm/debug.d.ts.map +1 -1
  50. package/dist/esm/development/{component-shared-D_i2IMKF.js → component-shared-C6HefNX-.js} +2 -2
  51. package/dist/esm/development/{component-shared-D_i2IMKF.js.map → component-shared-C6HefNX-.js.map} +1 -1
  52. package/dist/esm/development/config-CQLKpPRj.js +59 -0
  53. package/dist/esm/development/config-CQLKpPRj.js.map +1 -0
  54. package/dist/esm/development/config.js +2 -2
  55. package/dist/esm/development/{debug-DCgp_XPm.js → debug-D7mtRqCt.js} +280 -60
  56. package/dist/esm/development/debug-D7mtRqCt.js.map +1 -0
  57. package/dist/esm/development/debug.js +12 -10
  58. package/dist/esm/development/index.js +18 -17
  59. package/dist/esm/development/react/index.js +400 -53
  60. package/dist/esm/development/react/index.js.map +1 -1
  61. package/dist/esm/development/react/index.server.js +2 -2
  62. package/dist/esm/development/react/index.server.js.map +1 -1
  63. package/dist/esm/development/react/server.js +1 -1
  64. package/dist/esm/development/{snapshot-D19Mgcgz.js → snapshot-CMsut-I_.js} +7 -5
  65. package/dist/esm/development/snapshot-CMsut-I_.js.map +1 -0
  66. package/dist/esm/development/transform/index.js +5 -2
  67. package/dist/esm/development/transform/index.js.map +1 -1
  68. package/dist/esm/development/utils.js +38 -6
  69. package/dist/esm/development/utils.js.map +1 -1
  70. package/dist/esm/index.d.ts +1 -1
  71. package/dist/esm/index.d.ts.map +1 -1
  72. package/dist/esm/internals/async.d.ts.map +1 -1
  73. package/dist/esm/internals/config.d.ts +40 -0
  74. package/dist/esm/internals/config.d.ts.map +1 -1
  75. package/dist/esm/internals/lease.d.ts +30 -0
  76. package/dist/esm/internals/lease.d.ts.map +1 -0
  77. package/dist/esm/internals/reactive.d.ts +18 -1
  78. package/dist/esm/internals/reactive.d.ts.map +1 -1
  79. package/dist/esm/internals/utils/hash.d.ts +7 -0
  80. package/dist/esm/internals/utils/hash.d.ts.map +1 -1
  81. package/dist/esm/internals/utils/snapshot.d.ts +2 -0
  82. package/dist/esm/internals/utils/snapshot.d.ts.map +1 -1
  83. package/dist/esm/production/{component-shared-XZnx53QZ.js → component-shared-DzYWFipC.js} +2 -2
  84. package/dist/esm/production/{component-shared-XZnx53QZ.js.map → component-shared-DzYWFipC.js.map} +1 -1
  85. package/dist/esm/production/config-BhtwQYAN.js +53 -0
  86. package/dist/esm/production/config-BhtwQYAN.js.map +1 -0
  87. package/dist/esm/production/config.js +2 -2
  88. package/dist/esm/production/{contexts-Cpo7QZDe.js → contexts-D2PPNujL.js} +283 -63
  89. package/dist/esm/production/contexts-D2PPNujL.js.map +1 -0
  90. package/dist/esm/production/debug.js +3 -1
  91. package/dist/esm/production/index.js +19 -18
  92. package/dist/esm/production/react/index.js +400 -53
  93. package/dist/esm/production/react/index.js.map +1 -1
  94. package/dist/esm/production/react/index.server.js +2 -2
  95. package/dist/esm/production/react/index.server.js.map +1 -1
  96. package/dist/esm/production/react/server.js +1 -1
  97. package/dist/esm/production/{snapshot-CZTu3qTo.js → snapshot-Bx73RooF.js} +7 -5
  98. package/dist/esm/production/snapshot-Bx73RooF.js.map +1 -0
  99. package/dist/esm/production/transform/index.js +5 -2
  100. package/dist/esm/production/transform/index.js.map +1 -1
  101. package/dist/esm/production/utils.js +39 -7
  102. package/dist/esm/production/utils.js.map +1 -1
  103. package/dist/esm/react/async-component.d.ts +10 -2
  104. package/dist/esm/react/async-component.d.ts.map +1 -1
  105. package/dist/esm/react/component-server.d.ts +6 -2
  106. package/dist/esm/react/component-server.d.ts.map +1 -1
  107. package/dist/esm/react/component.d.ts +5 -2
  108. package/dist/esm/react/component.d.ts.map +1 -1
  109. package/dist/esm/react/delivery.d.ts +107 -0
  110. package/dist/esm/react/delivery.d.ts.map +1 -0
  111. package/dist/esm/react/index.d.ts +3 -2
  112. package/dist/esm/react/index.d.ts.map +1 -1
  113. package/dist/esm/react/pause-signals-context.d.ts +16 -2
  114. package/dist/esm/react/pause-signals-context.d.ts.map +1 -1
  115. package/dist/esm/react/props-hash.d.ts +20 -0
  116. package/dist/esm/react/props-hash.d.ts.map +1 -0
  117. package/dist/esm/react/use-reactive.d.ts +6 -3
  118. package/dist/esm/react/use-reactive.d.ts.map +1 -1
  119. package/dist/esm/transform/async.d.ts.map +1 -1
  120. package/dist/esm/transform/callback.d.ts.map +1 -1
  121. package/dist/esm/transform/promise.d.ts.map +1 -1
  122. package/dist/esm/transform/use-reactive.d.ts.map +1 -1
  123. package/dist/esm/transform/utils.d.ts +1 -1
  124. package/dist/esm/transform/utils.d.ts.map +1 -1
  125. package/dist/esm/utils.d.ts +17 -1
  126. package/dist/esm/utils.d.ts.map +1 -1
  127. package/package.json +1 -1
  128. package/dist/cjs/development/config-B0MtLBgx.js +0 -21
  129. package/dist/cjs/development/config-B0MtLBgx.js.map +0 -1
  130. package/dist/cjs/development/debug-CDy1L3Id.js.map +0 -1
  131. package/dist/cjs/development/snapshot-D8Ydfj9E.js.map +0 -1
  132. package/dist/cjs/production/config-B0MtLBgx.js +0 -21
  133. package/dist/cjs/production/config-B0MtLBgx.js.map +0 -1
  134. package/dist/cjs/production/contexts-CMvA-Ae9.js.map +0 -1
  135. package/dist/cjs/production/snapshot-I8W4cb8t.js.map +0 -1
  136. package/dist/esm/development/config-CPQL7hX-.js +0 -22
  137. package/dist/esm/development/config-CPQL7hX-.js.map +0 -1
  138. package/dist/esm/development/debug-DCgp_XPm.js.map +0 -1
  139. package/dist/esm/development/snapshot-D19Mgcgz.js.map +0 -1
  140. package/dist/esm/production/config-CPQL7hX-.js +0 -22
  141. package/dist/esm/production/config-CPQL7hX-.js.map +0 -1
  142. package/dist/esm/production/contexts-Cpo7QZDe.js.map +0 -1
  143. package/dist/esm/production/snapshot-CZTu3qTo.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # signalium
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4512494: Fix a rejected async reactive turning Ready with no value. Suppose a reactive rejects, one of its awaited dependencies then goes pending, and that dependency resolves to an equal value. The reactive used to leave pending by resolving with its stored value, which cleared the error, set `isReady`, and left `value` `undefined`. It now returns to its rejected state with the error preserved.
8
+
9
+ ## 4.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - c4449de: Release the React render-path changes as a major version. They change behavior that existing apps can observe:
14
+
15
+ - `component()` props are treated as immutable, the same contract as `React.memo`. When every prop is identical (by `Object.is`) to the previous render, the previous props hash is reused, and React element props are hashed by identity. A plain object, array, `Map`, `Set` or `Date` mutated in place and passed again no longer re-renders a `component()` child; pass a new value instead. Freshly created element children (`children={<X />}`) re-render the child on every parent render.
16
+ - `component()` mounts in one render instead of two.
17
+ - Watches taken during render are leases. A render React discards (an interrupted transition, a mount that suspends, a StrictMode double render) releases its relays after `renderLeaseTtl` (default 10 s) instead of keeping them active for the rest of the session. `useReactive` and `useReactiveShallow` readers suspended by React 19's `use()` for longer than the TTL lose their lease, so their relays may deactivate and restart when React retries the render.
18
+
19
+ ### Minor Changes
20
+
21
+ - d96ce16: `component()` no longer walks React element trees when hashing props. A React element is a plain object, so the structural props hash recursed through `props` and every descendant element — for a component taking `children`, that walk dominated each render, and reached into whatever the child elements' own props pointed at. Element-valued props are now hashed by identity: nothing reads through an element, and `hashValue` already hashes by identity any object whose prototype it doesn't recognise — elements only escaped that because they happen to be plain objects.
22
+
23
+ Every other prop keeps its structural hash, so a new-but-equivalent object or array still reuses the previous render, and a value whose class has a `registerCustomHash` function (an `Array` subclass included) is still hashed by it. Applies to async `component()` too, which hashed props the same way.
24
+
25
+ **Behaviour change:** a freshly-created children tree that is structurally identical to the previous one no longer reuses the memoized render, so such a component re-renders where it used to be skipped. Nothing can go stale as a result — React skips a subtree whose element is referentially identical, so a re-render was never what made an update visible. If a component relied on being skipped for a fresh-but-equal `children` (or other element) prop, hoist the element or memoize it so the same element is passed again.
26
+
27
+ - c4449de: `component()` no longer hashes its props when every prop is identical (by `Object.is`) to the previous render's — the common case of a parent re-rendering without changing anything — and reuses the previous hash instead. A shallow identity check costs a fraction of the structural hash (6–30x less for typical props in a micro-benchmark).
28
+
29
+ **Behaviour change:** props are now treated as immutable, the same contract as `React.memo` and the React Compiler: a plain object, array, `Map`, `Set` or `Date` prop mutated in place and passed again under the same identity no longer re-renders the component (the structural hash used to notice such a mutation). Pass a new object, or read changing data from a signal inside the component. Applies to async `component()` too.
30
+
31
+ - 1b46c55: Export `snapshotArray`, `snapshotPlainObject` and the `SnapshotFn` type from `signalium/utils`.
32
+ - c4449de: New opt-in `'state'` delivery mode for React readers. By default `component()`, `useReactive` and `useReactiveShallow` reach React through `useSyncExternalStore`, which always renders at SyncLane and throws away any in-progress transition render; with live data ticking underneath, a transition only finishes at React's ~5 s expiry. In `'state'` mode a reader reads its signal directly during render, subscribes on commit (claiming its render lease), and delivers changes with a default-priority `setState`, coalesced per reader and flushed for all readers in one `runBatch` on a microtask (`scheduleReactDelivery`). Default-priority updates wait for an in-progress transition instead of restarting it. A change between render and subscribe, or during a delivered render, is caught by a version check on commit, which first re-validates the signal so a change it missed while unwatched (an expired render lease) is not lost. The subscription lives as long as a `useSyncExternalStore` one would: a Suspense hide (react-freeze) keeps it and its relays, `<Activity mode="hidden">` and unmount release it. A hidden reader is not rendered, unless its own render is what suspended, so it can still recover when a change no longer needs the pending data; when it is revealed (including the first reveal of content prerendered inside a hidden `<Activity>`) it re-validates and, if anything changed since it rendered, renders before that commit paints. A first mount delivers a change between its render and its commit at default priority instead.
33
+
34
+ Enable globally with `setConfig({ reactDelivery: 'state' })` (the default stays `'sync'`), or per reader with `component(fn, { delivery })`, `useReactive(fn, { delivery })` and `useReactiveShallow(fn, { delivery })`. The Babel preset memoizes the thunk of a `useReactive` / `useReactiveShallow` / `useReactiveDeep` call that passes options too (it used to skip any call with a second argument, so such a call created a new signal on every render); the options argument is left as written. The mode is fixed when a reader mounts. Trade-off: updates are consistent per delivery batch, but a reader that mounts while a delivery is pending can show a newer value than its already-mounted siblings for one commit; readers whose values must stay correlated keep `'sync'`.
35
+
36
+ - 98ef30c: React render-time watches are now leases. `component()`, `useReactive` and `useReactiveShallow` watch their signal while rendering so relays read during the render activate, but React can discard a render (an interrupted transition, a mount that suspends, a StrictMode double render) without ever subscribing or running an effect, and the watch — with every relay under it — stayed active for the rest of the session. The render-time watch is now a provisional lease: the store subscription React makes on commit claims it (keeping the relays warm, with no restart), and a lease nobody claims is released after `renderLeaseTtl` (default 10 s, configurable via `setConfig`; a lease lives between one and two TTLs). A render that reads a still-leased signal again extends the lease. A `component()` render that suspends keeps its lease until the thrown thenable settles; one suspended by React 19's `use()` (whose thenable React keeps to itself) keeps it until React retries or commits it, or for 30 TTLs if React abandons it. `useReactive` / `useReactiveShallow` cannot see a `use()` that suspends the component after they return, so their leases follow the TTL. Committed components behave exactly as before.
37
+
38
+ `PauseSignalsProvider` pausing is counted per reader. A signal stays watched while any of its subscribers is unpaused, so a `useReactiveShallow` signal shared with readers outside a paused provider keeps updating for them, and an unpaused reader that suspends on such a signal still starts its relays. Readers register on commit, before they subscribe, so un-pausing no longer re-watches a signal from a discarded render; a provider also tracks render leases taken under it, so pausing reaches a mount that suspended before committing.
39
+
40
+ New: `retain(fn, { ttl })` keeps `fn`'s relays/queries watched for `ttl` ms (or until the returned release function is called) — an app-level lease for prefetching or keeping a hidden surface warm. The Babel preset transforms async callbacks passed to it. `ttl: Infinity` retains until released, and a `ttl` above 2^31 - 1 ms (the longest timer delay) is clamped to it. `setConfig({ renderLeaseTtl })` clamps values above that limit and ignores non-positive ones, warning in development. `signalium/debug` exports `getRenderLeaseCount()` and `releaseRenderLeases()`, which both include leases pinned for a suspended render.
41
+
3
42
  ## 3.0.3
4
43
 
5
44
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const debug = require("./debug-CDy1L3Id.js");
2
+ const debug = require("./debug-BS6RdX4D.js");
3
3
  function isGeneratorFunction(fn) {
4
4
  return typeof fn === "function" && fn.constructor?.name === "GeneratorFunction";
5
5
  }
@@ -30,4 +30,4 @@ exports.createServerAsyncComponentWrapper = createServerAsyncComponentWrapper;
30
30
  exports.createServerSyncComponentWrapper = createServerSyncComponentWrapper;
31
31
  exports.isAsyncFunctionWithoutTransform = isAsyncFunctionWithoutTransform;
32
32
  exports.isGeneratorFunction = isGeneratorFunction;
33
- //# sourceMappingURL=component-shared-DzjqSRY-.js.map
33
+ //# sourceMappingURL=component-shared-CU7qN_Ks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-shared-DzjqSRY-.js","sources":["../../../.tsc-out/react/component-shared.js"],"sourcesContent":["import { getCurrentConsumer, setCurrentConsumer } from '../internals/consumer.js';\nimport { getCurrentScope } from '../internals/contexts.js';\nimport { createReactiveSignal } from '../internals/reactive.js';\nimport { generatorResultToPromiseWithConsumer } from '../internals/generators.js';\nexport function isGeneratorFunction(fn) {\n return (typeof fn === 'function' && fn.constructor?.name === 'GeneratorFunction');\n}\nexport function isAsyncFunctionWithoutTransform(fn) {\n return typeof fn === 'function' && fn.constructor?.name === 'AsyncFunction';\n}\n/**\n * Wrap a Babel-transformed async generator in a real `async function` that drives it\n * with {@link generatorResultToPromiseWithConsumer}. Used on the server (RSC + SSR)\n * where hooks-based Suspense replay is not appropriate.\n */\nexport function createServerAsyncComponentWrapper(fn) {\n return async function (props) {\n const scope = getCurrentScope();\n const owned = createReactiveSignal({ compute: () => null, equals: () => true, isRelay: false, tracer: undefined }, [], undefined, scope);\n return generatorResultToPromiseWithConsumer(fn(props), owned);\n };\n}\n/**\n * Wrap a sync render function with consumer/scope tracking. Used by the server\n * `component()` for non-generator definitions.\n */\nexport function createServerSyncComponentWrapper(fn) {\n return function (props) {\n const scope = getCurrentScope();\n const owned = createReactiveSignal({ compute: () => null, equals: () => true, isRelay: false, tracer: undefined }, [], undefined, scope);\n const prevConsumer = getCurrentConsumer();\n try {\n setCurrentConsumer(owned);\n return fn(props);\n }\n finally {\n setCurrentConsumer(prevConsumer);\n }\n };\n}\n"],"names":["getCurrentScope","createReactiveSignal","generatorResultToPromiseWithConsumer","getCurrentConsumer","setCurrentConsumer"],"mappings":";;AAIO,SAAS,oBAAoB,IAAI;AACpC,SAAQ,OAAO,OAAO,cAAc,GAAG,aAAa,SAAS;AACjE;AACO,SAAS,gCAAgC,IAAI;AAChD,SAAO,OAAO,OAAO,cAAc,GAAG,aAAa,SAAS;AAChE;AAMO,SAAS,kCAAkC,IAAI;AAClD,SAAO,eAAgB,OAAO;AAC1B,UAAM,QAAQA,MAAAA,gBAAe;AAC7B,UAAM,QAAQC,MAAAA,qBAAqB,EAAE,SAAS,MAAM,MAAM,QAAQ,MAAM,MAAM,SAAS,OAAO,QAAQ,OAAS,GAAI,CAAA,GAAI,QAAW,KAAK;AACvI,WAAOC,2CAAqC,GAAG,KAAK,GAAG,KAAK;AAAA,EAChE;AACJ;AAKO,SAAS,iCAAiC,IAAI;AACjD,SAAO,SAAU,OAAO;AACpB,UAAM,QAAQF,MAAAA,gBAAe;AAC7B,UAAM,QAAQC,MAAAA,qBAAqB,EAAE,SAAS,MAAM,MAAM,QAAQ,MAAM,MAAM,SAAS,OAAO,QAAQ,OAAS,GAAI,CAAA,GAAI,QAAW,KAAK;AACvI,UAAM,eAAeE,MAAAA,mBAAkB;AACvC,QAAI;AACAC,YAAAA,mBAAmB,KAAK;AACxB,aAAO,GAAG,KAAK;AAAA,IACnB,UACR;AACYA,YAAAA,mBAAmB,YAAY;AAAA,IACnC;AAAA,EACJ;AACJ;;;;;"}
1
+ {"version":3,"file":"component-shared-CU7qN_Ks.js","sources":["../../../.tsc-out/react/component-shared.js"],"sourcesContent":["import { getCurrentConsumer, setCurrentConsumer } from '../internals/consumer.js';\nimport { getCurrentScope } from '../internals/contexts.js';\nimport { createReactiveSignal } from '../internals/reactive.js';\nimport { generatorResultToPromiseWithConsumer } from '../internals/generators.js';\nexport function isGeneratorFunction(fn) {\n return (typeof fn === 'function' && fn.constructor?.name === 'GeneratorFunction');\n}\nexport function isAsyncFunctionWithoutTransform(fn) {\n return typeof fn === 'function' && fn.constructor?.name === 'AsyncFunction';\n}\n/**\n * Wrap a Babel-transformed async generator in a real `async function` that drives it\n * with {@link generatorResultToPromiseWithConsumer}. Used on the server (RSC + SSR)\n * where hooks-based Suspense replay is not appropriate.\n */\nexport function createServerAsyncComponentWrapper(fn) {\n return async function (props) {\n const scope = getCurrentScope();\n const owned = createReactiveSignal({ compute: () => null, equals: () => true, isRelay: false, tracer: undefined }, [], undefined, scope);\n return generatorResultToPromiseWithConsumer(fn(props), owned);\n };\n}\n/**\n * Wrap a sync render function with consumer/scope tracking. Used by the server\n * `component()` for non-generator definitions.\n */\nexport function createServerSyncComponentWrapper(fn) {\n return function (props) {\n const scope = getCurrentScope();\n const owned = createReactiveSignal({ compute: () => null, equals: () => true, isRelay: false, tracer: undefined }, [], undefined, scope);\n const prevConsumer = getCurrentConsumer();\n try {\n setCurrentConsumer(owned);\n return fn(props);\n }\n finally {\n setCurrentConsumer(prevConsumer);\n }\n };\n}\n"],"names":["getCurrentScope","createReactiveSignal","generatorResultToPromiseWithConsumer","getCurrentConsumer","setCurrentConsumer"],"mappings":";;AAIO,SAAS,oBAAoB,IAAI;AACpC,SAAQ,OAAO,OAAO,cAAc,GAAG,aAAa,SAAS;AACjE;AACO,SAAS,gCAAgC,IAAI;AAChD,SAAO,OAAO,OAAO,cAAc,GAAG,aAAa,SAAS;AAChE;AAMO,SAAS,kCAAkC,IAAI;AAClD,SAAO,eAAgB,OAAO;AAC1B,UAAM,QAAQA,MAAAA,gBAAe;AAC7B,UAAM,QAAQC,MAAAA,qBAAqB,EAAE,SAAS,MAAM,MAAM,QAAQ,MAAM,MAAM,SAAS,OAAO,QAAQ,OAAS,GAAI,CAAA,GAAI,QAAW,KAAK;AACvI,WAAOC,2CAAqC,GAAG,KAAK,GAAG,KAAK;AAAA,EAChE;AACJ;AAKO,SAAS,iCAAiC,IAAI;AACjD,SAAO,SAAU,OAAO;AACpB,UAAM,QAAQF,MAAAA,gBAAe;AAC7B,UAAM,QAAQC,MAAAA,qBAAqB,EAAE,SAAS,MAAM,MAAM,QAAQ,MAAM,MAAM,SAAS,OAAO,QAAQ,OAAS,GAAI,CAAA,GAAI,QAAW,KAAK;AACvI,UAAM,eAAeE,MAAAA,mBAAkB;AACvC,QAAI;AACAC,YAAAA,mBAAmB,KAAK;AACxB,aAAO,GAAG,KAAK;AAAA,IACnB,UACR;AACYA,YAAAA,mBAAmB,YAAY;AAAA,IACnC;AAAA,EACJ;AACJ;;;;;"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ let _scheduleFlush = (flushWatchers) => {
3
+ setTimeout(() => {
4
+ flushWatchers();
5
+ }, 0);
6
+ };
7
+ let _runBatch = (fn) => fn();
8
+ const DEFAULT_RENDER_LEASE_TTL = 1e4;
9
+ let _renderLeaseTtl = DEFAULT_RENDER_LEASE_TTL;
10
+ const MAX_TIMEOUT = 2 ** 31 - 1;
11
+ function validateRenderLeaseTtl(ttl) {
12
+ if (typeof ttl !== "number" || Number.isNaN(ttl) || ttl <= 0) {
13
+ {
14
+ console.warn(`signalium: setConfig({ renderLeaseTtl: ${String(ttl)} }) ignored; it must be a positive number of milliseconds.`);
15
+ }
16
+ return _renderLeaseTtl;
17
+ }
18
+ if (ttl > MAX_TIMEOUT) {
19
+ {
20
+ console.warn(`signalium: setConfig({ renderLeaseTtl: ${String(ttl)} }) clamped to ${MAX_TIMEOUT} ms, the longest timer delay.`);
21
+ }
22
+ return MAX_TIMEOUT;
23
+ }
24
+ return ttl;
25
+ }
26
+ let _reactDelivery = "sync";
27
+ const resolvedPromise = Promise.resolve();
28
+ let _scheduleReactDelivery = (fn) => {
29
+ resolvedPromise.then(fn);
30
+ };
31
+ function setConfig(cfg) {
32
+ _scheduleFlush = cfg.scheduleFlush ?? _scheduleFlush;
33
+ _runBatch = cfg.runBatch ?? _runBatch;
34
+ if (cfg.renderLeaseTtl !== void 0) {
35
+ _renderLeaseTtl = validateRenderLeaseTtl(cfg.renderLeaseTtl);
36
+ }
37
+ _reactDelivery = cfg.reactDelivery ?? _reactDelivery;
38
+ _scheduleReactDelivery = cfg.scheduleReactDelivery ?? _scheduleReactDelivery;
39
+ }
40
+ const scheduleFlush = (fn) => {
41
+ _scheduleFlush(fn);
42
+ };
43
+ const runBatch = (fn) => {
44
+ _runBatch(fn);
45
+ };
46
+ const getRenderLeaseTtl = () => _renderLeaseTtl;
47
+ const getReactDelivery = () => _reactDelivery;
48
+ const scheduleReactDelivery = (fn) => {
49
+ _scheduleReactDelivery(fn);
50
+ };
51
+ exports.MAX_TIMEOUT = MAX_TIMEOUT;
52
+ exports.getReactDelivery = getReactDelivery;
53
+ exports.getRenderLeaseTtl = getRenderLeaseTtl;
54
+ exports.runBatch = runBatch;
55
+ exports.scheduleFlush = scheduleFlush;
56
+ exports.scheduleReactDelivery = scheduleReactDelivery;
57
+ exports.setConfig = setConfig;
58
+ //# sourceMappingURL=config-D6wyrhrW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-D6wyrhrW.js","sources":["../../../.tsc-out/internals/config.js"],"sourcesContent":["let _scheduleFlush = flushWatchers => {\n setTimeout(() => {\n flushWatchers();\n }, 0);\n};\nlet _runBatch = fn => fn();\n/** Default render lease TTL (ms). It must outlive a transition render, which React caps at 5 s. */\nexport const DEFAULT_RENDER_LEASE_TTL = 10_000;\nlet _renderLeaseTtl = DEFAULT_RENDER_LEASE_TTL;\n/** The longest `setTimeout` delay (2^31 - 1 ms); longer ones fire immediately. */\nexport const MAX_TIMEOUT = 2 ** 31 - 1;\nfunction validateRenderLeaseTtl(ttl) {\n if (typeof ttl !== 'number' || Number.isNaN(ttl) || ttl <= 0) {\n if (IS_DEV) {\n console.warn(`signalium: setConfig({ renderLeaseTtl: ${String(ttl)} }) ignored; it must be a positive number of milliseconds.`);\n }\n return _renderLeaseTtl;\n }\n if (ttl > MAX_TIMEOUT) {\n if (IS_DEV) {\n console.warn(`signalium: setConfig({ renderLeaseTtl: ${String(ttl)} }) clamped to ${MAX_TIMEOUT} ms, the longest timer delay.`);\n }\n return MAX_TIMEOUT;\n }\n return ttl;\n}\nlet _reactDelivery = 'sync';\nconst resolvedPromise = Promise.resolve();\nlet _scheduleReactDelivery = fn => {\n resolvedPromise.then(fn);\n};\nexport function setConfig(cfg) {\n _scheduleFlush = cfg.scheduleFlush ?? _scheduleFlush;\n _runBatch = cfg.runBatch ?? _runBatch;\n if (cfg.renderLeaseTtl !== undefined) {\n _renderLeaseTtl = validateRenderLeaseTtl(cfg.renderLeaseTtl);\n }\n _reactDelivery = cfg.reactDelivery ?? _reactDelivery;\n _scheduleReactDelivery = cfg.scheduleReactDelivery ?? _scheduleReactDelivery;\n}\nexport const scheduleFlush = (fn) => {\n _scheduleFlush(fn);\n};\nexport const runBatch = (fn) => {\n _runBatch(fn);\n};\nexport const getRenderLeaseTtl = () => _renderLeaseTtl;\nexport const getReactDelivery = () => _reactDelivery;\nexport const scheduleReactDelivery = (fn) => {\n _scheduleReactDelivery(fn);\n};\n"],"names":[],"mappings":";AAAA,IAAI,iBAAiB,CAAA,kBAAiB;AAClC,aAAW,MAAM;AACb,kBAAA;AAAA,EACJ,GAAG,CAAC;AACR;AACA,IAAI,YAAY,QAAM,GAAA;AAEf,MAAM,2BAA2B;AACxC,IAAI,kBAAkB;AAEf,MAAM,cAAc,KAAK,KAAK;AACrC,SAAS,uBAAuB,KAAK;AACjC,MAAI,OAAO,QAAQ,YAAY,OAAO,MAAM,GAAG,KAAK,OAAO,GAAG;AAC9C;AACR,cAAQ,KAAK,0CAA0C,OAAO,GAAG,CAAC,4DAA4D;AAAA,IAClI;AACA,WAAO;AAAA,EACX;AACA,MAAI,MAAM,aAAa;AACP;AACR,cAAQ,KAAK,0CAA0C,OAAO,GAAG,CAAC,kBAAkB,WAAW,+BAA+B;AAAA,IAClI;AACA,WAAO;AAAA,EACX;AACA,SAAO;AACX;AACA,IAAI,iBAAiB;AACrB,MAAM,kBAAkB,QAAQ,QAAA;AAChC,IAAI,yBAAyB,CAAA,OAAM;AAC/B,kBAAgB,KAAK,EAAE;AAC3B;AACO,SAAS,UAAU,KAAK;AAC3B,mBAAiB,IAAI,iBAAiB;AACtC,cAAY,IAAI,YAAY;AAC5B,MAAI,IAAI,mBAAmB,QAAW;AAClC,sBAAkB,uBAAuB,IAAI,cAAc;AAAA,EAC/D;AACA,mBAAiB,IAAI,iBAAiB;AACtC,2BAAyB,IAAI,yBAAyB;AAC1D;AACO,MAAM,gBAAgB,CAAC,OAAO;AACjC,iBAAe,EAAE;AACrB;AACO,MAAM,WAAW,CAAC,OAAO;AAC5B,YAAU,EAAE;AAChB;AACO,MAAM,oBAAoB,MAAM;AAChC,MAAM,mBAAmB,MAAM;AAC/B,MAAM,wBAAwB,CAAC,OAAO;AACzC,yBAAuB,EAAE;AAC7B;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const config = require("./config-B0MtLBgx.js");
3
+ const config = require("./config-D6wyrhrW.js");
4
4
  exports.setConfig = config.setConfig;
5
5
  //# sourceMappingURL=config.js.map
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const config = require("./config-B0MtLBgx.js");
2
+ const config = require("./config-D6wyrhrW.js");
3
3
  let UNKNOWN_SIGNAL_ID = 0;
4
4
  const UNKNOWN_SIGNAL_NAMES = /* @__PURE__ */ new Map();
5
5
  function getUnknownSignalFnName(fn) {
@@ -1070,7 +1070,11 @@ class ReactivePromiseImpl {
1070
1070
  return this._awaitSubs = /* @__PURE__ */ new Map();
1071
1071
  }
1072
1072
  _clearPending() {
1073
- this._setValue(this._value);
1073
+ if ((this._flags & 2) !== 0) {
1074
+ this._setError(this._error);
1075
+ } else {
1076
+ this._setValue(this._value);
1077
+ }
1074
1078
  }
1075
1079
  async _setPromise(promise) {
1076
1080
  this._promise = promise;
@@ -1604,32 +1608,43 @@ function hashNumber(num, seed = 0) {
1604
1608
  h ^= h >>> 16;
1605
1609
  return h >>> 0;
1606
1610
  }
1607
- function hashArray(arr, seen) {
1608
- let h = ARRAY;
1611
+ function mixHash(h, k) {
1609
1612
  const c1 = 3432918353;
1610
1613
  const c2 = 461845907;
1611
- for (const item of arr) {
1612
- let k = hashValue(item, seen);
1613
- k = imul(k, c1);
1614
- k = k << 15 | k >>> 17;
1615
- k = imul(k, c2);
1616
- h ^= k;
1617
- h = h << 13 | h >>> 19;
1618
- h = imul(h, 5) + 3864292196;
1619
- }
1620
- h ^= arr.length;
1614
+ const n = 3864292196;
1615
+ k = imul(k, c1);
1616
+ k = k << 15 | k >>> 17;
1617
+ k = imul(k, c2);
1618
+ h ^= k;
1619
+ h = h << 13 | h >>> 19;
1620
+ return imul(h, 5) + n | 0;
1621
+ }
1622
+ function finalizeHash(h, length) {
1623
+ const fmix1 = 2246822507;
1624
+ const fmix2 = 3266489909;
1625
+ h ^= length;
1621
1626
  h ^= h >>> 16;
1622
- h = imul(h, 2246822507);
1627
+ h = imul(h, fmix1);
1623
1628
  h ^= h >>> 13;
1624
- h = imul(h, 3266489909);
1629
+ h = imul(h, fmix2);
1625
1630
  h ^= h >>> 16;
1626
1631
  return h >>> 0;
1627
1632
  }
1633
+ function hashArray(arr, seen) {
1634
+ let h = ARRAY_SEED;
1635
+ for (const item of arr) {
1636
+ h = mixHash(h, hashValue(item, seen));
1637
+ }
1638
+ return finalizeHash(h, arr.length);
1639
+ }
1628
1640
  function hashObject(obj, seen) {
1641
+ return hashObjectKeys(obj, Object.keys(obj), seen);
1642
+ }
1643
+ function hashObjectKeys(obj, keys, seen) {
1644
+ const keyMultiplier = 2654435769;
1629
1645
  let sum = OBJECT;
1630
- const keys = Object.keys(obj);
1631
1646
  for (const key of keys) {
1632
- sum += imul(hashValue(key, seen), 2654435769) ^ hashValue(obj[key], seen);
1647
+ sum += imul(hashValue(key, seen), keyMultiplier) ^ hashValue(obj[key], seen);
1633
1648
  }
1634
1649
  return sum >>> 0;
1635
1650
  }
@@ -1641,9 +1656,10 @@ function hashSet(set, seen) {
1641
1656
  return sum >>> 0;
1642
1657
  }
1643
1658
  function hashMap(map, seen) {
1659
+ const keyMultiplier = 2654435769;
1644
1660
  let sum = MAP;
1645
1661
  for (const [key, value] of map) {
1646
- sum += imul(hashValue(key, seen), 2654435769) ^ hashValue(value, seen);
1662
+ sum += imul(hashValue(key, seen), keyMultiplier) ^ hashValue(value, seen);
1647
1663
  }
1648
1664
  return sum >>> 0;
1649
1665
  }
@@ -1682,7 +1698,7 @@ const FALSE = hashStr(
1682
1698
  3
1683
1699
  /* HashType.FALSE */
1684
1700
  );
1685
- const ARRAY = hashStr(
1701
+ const ARRAY_SEED = hashStr(
1686
1702
  "array",
1687
1703
  7
1688
1704
  /* HashType.ARRAY */
@@ -1846,6 +1862,95 @@ function stringifyValue(value) {
1846
1862
  return getObjectId(value);
1847
1863
  }
1848
1864
  }
1865
+ let young = /* @__PURE__ */ new Set();
1866
+ let old = /* @__PURE__ */ new Set();
1867
+ let timer;
1868
+ const pinned = /* @__PURE__ */ new Map();
1869
+ const SUSPENDED_LEASE_HOLD_TTLS = 30;
1870
+ function armTimer() {
1871
+ timer = setTimeout(sweepLeases, config.getRenderLeaseTtl());
1872
+ timer.unref?.();
1873
+ }
1874
+ function sweepLeases() {
1875
+ timer = void 0;
1876
+ const expired = old;
1877
+ for (const signal2 of expired) {
1878
+ signal2._releaseLease();
1879
+ }
1880
+ expired.clear();
1881
+ old = young;
1882
+ young = expired;
1883
+ if (old.size > 0) {
1884
+ armTimer();
1885
+ }
1886
+ }
1887
+ function addLease(signal2) {
1888
+ if (!pinned.delete(signal2)) {
1889
+ old.delete(signal2);
1890
+ }
1891
+ young.add(signal2);
1892
+ if (timer === void 0) {
1893
+ armTimer();
1894
+ }
1895
+ }
1896
+ function removeLease(signal2) {
1897
+ if (!young.delete(signal2) && !old.delete(signal2)) {
1898
+ pinned.delete(signal2);
1899
+ }
1900
+ }
1901
+ function pinLease(signal2) {
1902
+ if (!signal2._isLeased) {
1903
+ return void 0;
1904
+ }
1905
+ young.delete(signal2);
1906
+ old.delete(signal2);
1907
+ const token = {};
1908
+ pinned.set(signal2, token);
1909
+ return token;
1910
+ }
1911
+ function unpinLease(signal2, token) {
1912
+ if (pinned.get(signal2) === token && signal2._isLeased) {
1913
+ addLease(signal2);
1914
+ }
1915
+ }
1916
+ function holdLeaseUntilSettled(signal2, thenable) {
1917
+ const token = pinLease(signal2);
1918
+ if (token === void 0) {
1919
+ return;
1920
+ }
1921
+ const renew = () => unpinLease(signal2, token);
1922
+ thenable.then(renew, renew);
1923
+ }
1924
+ function holdSuspendedLease(signal2) {
1925
+ const token = pinLease(signal2);
1926
+ if (token === void 0) {
1927
+ return;
1928
+ }
1929
+ const hold = setTimeout(() => unpinLease(signal2, token), Math.min(config.getRenderLeaseTtl() * SUSPENDED_LEASE_HOLD_TTLS, config.MAX_TIMEOUT));
1930
+ hold.unref?.();
1931
+ }
1932
+ function releaseAbandonedAttempt(signal2) {
1933
+ const token = pinned.get(signal2);
1934
+ if (token !== void 0) {
1935
+ unpinLease(signal2, token);
1936
+ }
1937
+ }
1938
+ function releaseRenderLeases() {
1939
+ if (timer !== void 0) {
1940
+ clearTimeout(timer);
1941
+ timer = void 0;
1942
+ }
1943
+ const leases = [...old, ...young, ...pinned.keys()];
1944
+ old = /* @__PURE__ */ new Set();
1945
+ young = /* @__PURE__ */ new Set();
1946
+ pinned.clear();
1947
+ for (const signal2 of leases) {
1948
+ signal2._releaseLease();
1949
+ }
1950
+ }
1951
+ function getRenderLeaseCount() {
1952
+ return young.size + old.size + pinned.size;
1953
+ }
1849
1954
  let ID = 0;
1850
1955
  function createReactiveDefinition(id, desc, compute, equals, isRelay2, paramKey, tracer) {
1851
1956
  const def = {
@@ -1918,6 +2023,9 @@ class ReactiveSignal {
1918
2023
  this.flags &= -33;
1919
2024
  }
1920
2025
  }
2026
+ get _isLeased() {
2027
+ return (this.flags & 128) !== 0;
2028
+ }
1921
2029
  get _isLazy() {
1922
2030
  return (this.flags & 64) !== 0;
1923
2031
  }
@@ -1932,6 +2040,7 @@ class ReactiveSignal {
1932
2040
  return this._listeners ?? (this._listeners = {
1933
2041
  updatedAt: 0,
1934
2042
  current: /* @__PURE__ */ new Map(),
2043
+ pausedReaders: 0,
1935
2044
  cachedBoundAdd: this.addListener.bind(this)
1936
2045
  });
1937
2046
  }
@@ -1939,7 +2048,8 @@ class ReactiveSignal {
1939
2048
  return getSignal(this);
1940
2049
  }
1941
2050
  addListener(listener, opts) {
1942
- const { current } = this.listeners;
2051
+ const meta = this.listeners;
2052
+ const { current } = meta;
1943
2053
  if (!current.has(listener)) {
1944
2054
  let effective = listener;
1945
2055
  if (opts?.skipInitial) {
@@ -1952,23 +2062,39 @@ class ReactiveSignal {
1952
2062
  listener();
1953
2063
  };
1954
2064
  }
1955
- if (!this._isListener) {
1956
- watchSignal(this);
1957
- this.flags |= 16;
2065
+ const flags = this.flags;
2066
+ current.set(listener, effective);
2067
+ const unpaused = meta.pausedReaders < current.size;
2068
+ if ((flags & 16) === 0) {
2069
+ this.flags = flags | 16;
2070
+ } else if ((flags & 128) !== 0 && (unpaused || (flags & 256) === 0)) {
2071
+ this.flags = flags & -129;
2072
+ removeLease(this);
2073
+ }
2074
+ if (unpaused) {
2075
+ this._takeListenerWatch();
2076
+ } else {
2077
+ this._pauseListenerWatch();
1958
2078
  }
1959
2079
  if (this.watchCount > 0) {
1960
2080
  schedulePull(this);
1961
2081
  }
1962
- current.set(listener, effective);
1963
2082
  }
1964
2083
  return () => {
1965
2084
  if (current.has(listener)) {
1966
2085
  current.delete(listener);
1967
2086
  if (current.size === 0) {
2087
+ const flags = this.flags;
2088
+ if ((flags & 128) !== 0)
2089
+ return;
1968
2090
  cancelPull(this);
1969
- unwatchSignal(this);
1970
- this.flags &= -17;
1971
- this.listeners.updatedAt = 0;
2091
+ this.flags = flags & -273;
2092
+ if ((flags & 256) !== 0) {
2093
+ unwatchSignal(this);
2094
+ }
2095
+ meta.updatedAt = 0;
2096
+ } else if (meta.pausedReaders >= current.size) {
2097
+ this._pauseListenerWatch();
1972
2098
  }
1973
2099
  }
1974
2100
  };
@@ -1976,15 +2102,99 @@ class ReactiveSignal {
1976
2102
  // This method is used in React hooks specifically. It returns a bound add method
1977
2103
  // that is cached to avoid creating a new one on each call, and it eagerly sets
1978
2104
  // the listener as watched so that relays that are accessed will be activated.
2105
+ //
2106
+ // The eager watch is a lease (see `lease.ts`): the commit's subscription claims it, and a
2107
+ // discarded render's lease expires. Each render of a still-leased signal extends it.
1979
2108
  addListenerLazy(watch = true) {
1980
- if (!this._isListener) {
2109
+ const flags = this.flags;
2110
+ if ((flags & 16) === 0) {
1981
2111
  if (watch) {
1982
2112
  watchSignal(this);
2113
+ this.flags |= 16 | 128 | 256;
2114
+ } else {
2115
+ this.flags |= 16 | 128;
2116
+ }
2117
+ addLease(this);
2118
+ } else if ((flags & 128) !== 0 || watch && (flags & 256) === 0) {
2119
+ if (watch && (flags & 256) === 0) {
2120
+ watchSignal(this);
2121
+ this.flags |= 256;
1983
2122
  }
1984
- this.flags |= 16;
2123
+ this.flags |= 128;
2124
+ addLease(this);
1985
2125
  }
1986
2126
  return this.listeners.cachedBoundAdd;
1987
2127
  }
2128
+ /** Drops the listener watch; listeners stay subscribed. */
2129
+ _pauseWatch() {
2130
+ const flags = this.flags;
2131
+ if ((flags & 256) !== 0) {
2132
+ this.flags = flags & -257;
2133
+ unwatchSignal(this, { isPausing: true });
2134
+ }
2135
+ }
2136
+ /** Retakes the listener watch, pulling changes missed while unwatched. */
2137
+ _resumeWatch() {
2138
+ if ((this.flags & 16) !== 0 && this._takeListenerWatch()) {
2139
+ schedulePull(this);
2140
+ }
2141
+ }
2142
+ _takeListenerWatch() {
2143
+ if ((this.flags & 256) !== 0) {
2144
+ return false;
2145
+ }
2146
+ watchSignal(this);
2147
+ this.flags |= 256;
2148
+ return true;
2149
+ }
2150
+ /** `deferred` reconciles in a microtask, for a reader that unregisters before it unsubscribes. */
2151
+ _addPausedReaders(delta, deferred = false) {
2152
+ this.listeners.pausedReaders += delta;
2153
+ if (deferred) {
2154
+ queueMicrotask(() => this._reconcilePausedReaders());
2155
+ } else {
2156
+ this._reconcilePausedReaders();
2157
+ }
2158
+ }
2159
+ _reconcilePausedReaders() {
2160
+ const { current, pausedReaders } = this.listeners;
2161
+ if (current.size === 0)
2162
+ return;
2163
+ if (pausedReaders < current.size) {
2164
+ this._resumeWatch();
2165
+ } else {
2166
+ this._pauseListenerWatch();
2167
+ }
2168
+ }
2169
+ /** Pauses for the listeners' sake; an unclaimed render lease's watch belongs to its render. */
2170
+ _pauseListenerWatch() {
2171
+ if ((this.flags & 128) === 0) {
2172
+ this._pauseWatch();
2173
+ }
2174
+ }
2175
+ /** Releases an unclaimed render lease; a no-op once claimed. */
2176
+ _releaseLease() {
2177
+ const flags = this.flags;
2178
+ if ((flags & 128) === 0) {
2179
+ return;
2180
+ }
2181
+ const meta = this._listeners;
2182
+ if (meta !== null && meta.current.size > 0) {
2183
+ this.flags = flags & -129;
2184
+ if (meta.pausedReaders >= meta.current.size) {
2185
+ this._pauseWatch();
2186
+ }
2187
+ return;
2188
+ }
2189
+ this.flags = flags & -401;
2190
+ if (meta !== null) {
2191
+ meta.updatedAt = 0;
2192
+ }
2193
+ cancelPull(this);
2194
+ if ((flags & 256) !== 0) {
2195
+ unwatchSignal(this);
2196
+ }
2197
+ }
1988
2198
  }
1989
2199
  const runListeners = (signal2) => {
1990
2200
  const { listeners } = signal2;
@@ -2124,11 +2334,13 @@ const getScopeOwner = (obj) => {
2124
2334
  }
2125
2335
  return scope;
2126
2336
  };
2337
+ exports.ARRAY_SEED = ARRAY_SEED;
2127
2338
  exports.ReactivePromise = ReactivePromise;
2128
2339
  exports.SignalScope = SignalScope;
2129
2340
  exports.Tracer = Tracer;
2130
2341
  exports.VisualizerNode = VisualizerNode;
2131
2342
  exports.callback = callback;
2343
+ exports.checkSignal = checkSignal;
2132
2344
  exports.clearGlobalContexts = clearGlobalContexts;
2133
2345
  exports.context = context;
2134
2346
  exports.createReactiveDefinition = createReactiveDefinition;
@@ -2137,24 +2349,32 @@ exports.createRelay = createRelay;
2137
2349
  exports.createTask = createTask;
2138
2350
  exports.createTracer = createTracer;
2139
2351
  exports.createTracerFromId = createTracerFromId;
2352
+ exports.finalizeHash = finalizeHash;
2140
2353
  exports.generatorResultToPromiseWithConsumer = generatorResultToPromiseWithConsumer;
2141
2354
  exports.getContext = getContext;
2142
2355
  exports.getCurrentConsumer = getCurrentConsumer;
2143
2356
  exports.getCurrentScope = getCurrentScope;
2144
2357
  exports.getGlobalScope = getGlobalScope;
2358
+ exports.getObjectHash = getObjectHash;
2359
+ exports.getRenderLeaseCount = getRenderLeaseCount;
2145
2360
  exports.getScopeOwner = getScopeOwner;
2146
2361
  exports.getSignal = getSignal;
2147
2362
  exports.getTracerProxy = getTracerProxy;
2363
+ exports.hashObjectKeys = hashObjectKeys;
2148
2364
  exports.hashValue = hashValue;
2365
+ exports.holdLeaseUntilSettled = holdLeaseUntilSettled;
2366
+ exports.holdSuspendedLease = holdSuspendedLease;
2149
2367
  exports.isPromise = isPromise;
2150
2368
  exports.isReactivePromise = isReactivePromise;
2151
2369
  exports.isSignal = isSignal;
2152
2370
  exports.isThennable = isThennable;
2371
+ exports.mixHash = mixHash;
2153
2372
  exports.notifier = notifier;
2154
2373
  exports.registerCustomHash = registerCustomHash;
2374
+ exports.releaseAbandonedAttempt = releaseAbandonedAttempt;
2375
+ exports.releaseRenderLeases = releaseRenderLeases;
2155
2376
  exports.removeTracer = removeTracer;
2156
2377
  exports.runSignal = runSignal;
2157
- exports.schedulePull = schedulePull;
2158
2378
  exports.scheduleTracer = scheduleTracer;
2159
2379
  exports.setCurrentConsumer = setCurrentConsumer;
2160
2380
  exports.setGlobalContexts = setGlobalContexts;
@@ -2167,4 +2387,4 @@ exports.signal = signal;
2167
2387
  exports.unwatchSignal = unwatchSignal;
2168
2388
  exports.watchSignal = watchSignal;
2169
2389
  exports.withContexts = withContexts;
2170
- //# sourceMappingURL=debug-CDy1L3Id.js.map
2390
+ //# sourceMappingURL=debug-BS6RdX4D.js.map