stroid 0.1.2 → 0.1.4-beta.0

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 (118) hide show
  1. package/CHANGELOG.md +57 -10
  2. package/README.md +12 -10
  3. package/dist/async.d.ts +1 -1
  4. package/dist/async.js +22 -22
  5. package/dist/computed-types.d.ts +42 -0
  6. package/dist/computed-types.js +2 -0
  7. package/dist/computed.d.ts +15 -2
  8. package/dist/computed.js +11 -11
  9. package/dist/core.js +14 -14
  10. package/dist/devtools.d.ts +1 -1
  11. package/dist/devtools.js +1 -1
  12. package/dist/helpers.js +13 -13
  13. package/dist/index-internal.d.ts +1 -1
  14. package/dist/index.d.cts +4 -1
  15. package/dist/index.d.ts +4 -1
  16. package/dist/index.js +24 -24
  17. package/dist/install.js +1 -1
  18. package/dist/persist.js +1 -1
  19. package/dist/psr.d.ts +38 -0
  20. package/dist/psr.js +19 -0
  21. package/dist/react/index.d.ts +3 -1
  22. package/dist/react/index.js +25 -25
  23. package/dist/runtime-admin.js +1 -1
  24. package/dist/runtime-patch.d.ts +29 -0
  25. package/dist/runtime-tools.d.ts +6 -1
  26. package/dist/runtime-tools.js +2 -2
  27. package/dist/selectors.js +1 -1
  28. package/dist/server.d.ts +3 -1
  29. package/dist/server.js +11 -11
  30. package/dist/store-registry.d.ts +5 -0
  31. package/dist/sync.js +1 -1
  32. package/dist/testing.js +17 -17
  33. package/dist/types.d.ts +1 -1
  34. package/package.json +40 -39
  35. package/dist/async.js.map +0 -1
  36. package/dist/computed.js.map +0 -1
  37. package/dist/core.js.map +0 -1
  38. package/dist/devtools.js.map +0 -1
  39. package/dist/feature.js.map +0 -1
  40. package/dist/helpers.js.map +0 -1
  41. package/dist/index.js.map +0 -1
  42. package/dist/install.js.map +0 -1
  43. package/dist/persist.js.map +0 -1
  44. package/dist/react/index.js.map +0 -1
  45. package/dist/runtime-admin.js.map +0 -1
  46. package/dist/runtime-tools.js.map +0 -1
  47. package/dist/selectors.js.map +0 -1
  48. package/dist/server.js.map +0 -1
  49. package/dist/sync.js.map +0 -1
  50. package/dist/testing.js.map +0 -1
  51. package/dist/types/adapters/options.d.ts +0 -335
  52. package/dist/types/async/cache.d.ts +0 -39
  53. package/dist/types/async/clone.d.ts +0 -10
  54. package/dist/types/async/errors.d.ts +0 -3
  55. package/dist/types/async/fetch.d.ts +0 -37
  56. package/dist/types/async/inflight.d.ts +0 -13
  57. package/dist/types/async/rate.d.ts +0 -5
  58. package/dist/types/async/registry.d.ts +0 -116
  59. package/dist/types/async/request.d.ts +0 -11
  60. package/dist/types/async/retry.d.ts +0 -10
  61. package/dist/types/async.d.ts +0 -10
  62. package/dist/types/computed/computed-graph.d.ts +0 -29
  63. package/dist/types/computed/index.d.ts +0 -16
  64. package/dist/types/config.d.ts +0 -10
  65. package/dist/types/core/index.d.ts +0 -11
  66. package/dist/types/core/lifecycle-hooks.d.ts +0 -16
  67. package/dist/types/core/store-admin-impl.d.ts +0 -9
  68. package/dist/types/core/store-admin.d.ts +0 -9
  69. package/dist/types/core/store-core.d.ts +0 -13
  70. package/dist/types/core/store-create.d.ts +0 -16
  71. package/dist/types/core/store-hydrate-impl.d.ts +0 -35
  72. package/dist/types/core/store-hydrate.d.ts +0 -9
  73. package/dist/types/core/store-lifecycle/hooks.d.ts +0 -19
  74. package/dist/types/core/store-lifecycle/identity.d.ts +0 -23
  75. package/dist/types/core/store-lifecycle/registry.d.ts +0 -53
  76. package/dist/types/core/store-lifecycle/types.d.ts +0 -67
  77. package/dist/types/core/store-lifecycle/validation.d.ts +0 -53
  78. package/dist/types/core/store-name.d.ts +0 -28
  79. package/dist/types/core/store-notify.d.ts +0 -12
  80. package/dist/types/core/store-read.d.ts +0 -18
  81. package/dist/types/core/store-registry.d.ts +0 -108
  82. package/dist/types/core/store-replace-impl.d.ts +0 -11
  83. package/dist/types/core/store-replace.d.ts +0 -9
  84. package/dist/types/core/store-set-impl.d.ts +0 -13
  85. package/dist/types/core/store-set.d.ts +0 -9
  86. package/dist/types/core/store-shared/core.d.ts +0 -13
  87. package/dist/types/core/store-shared/notify.d.ts +0 -12
  88. package/dist/types/core/store-transaction.d.ts +0 -26
  89. package/dist/types/core/store-write-shared.d.ts +0 -19
  90. package/dist/types/core/store-write.d.ts +0 -13
  91. package/dist/types/features/feature-registry.d.ts +0 -91
  92. package/dist/types/features/lifecycle.d.ts +0 -40
  93. package/dist/types/index.d.ts +0 -17
  94. package/dist/types/integrations/query.d.ts +0 -8
  95. package/dist/types/internals/computed-order.d.ts +0 -3
  96. package/dist/types/internals/config.d.ts +0 -116
  97. package/dist/types/internals/diagnostics.d.ts +0 -21
  98. package/dist/types/internals/reporting.d.ts +0 -9
  99. package/dist/types/internals/store-admin.d.ts +0 -7
  100. package/dist/types/internals/store-ops.d.ts +0 -13
  101. package/dist/types/internals/test-reset.d.ts +0 -2
  102. package/dist/types/internals/write-context.d.ts +0 -15
  103. package/dist/types/notification/delivery.d.ts +0 -3
  104. package/dist/types/notification/index.d.ts +0 -10
  105. package/dist/types/notification/metrics.d.ts +0 -12
  106. package/dist/types/notification/priority.d.ts +0 -9
  107. package/dist/types/notification/scheduler.d.ts +0 -11
  108. package/dist/types/notification/snapshot.d.ts +0 -8
  109. package/dist/types/runtime-admin/index.d.ts +0 -2
  110. package/dist/types/runtime-tools/index.d.ts +0 -58
  111. package/dist/types/store.d.ts +0 -16
  112. package/dist/types/types/utility.d.ts +0 -17
  113. package/dist/types/utils/clone.d.ts +0 -4
  114. package/dist/types/utils/devfreeze.d.ts +0 -2
  115. package/dist/types/utils/hash.d.ts +0 -8
  116. package/dist/types/utils/path.d.ts +0 -5
  117. package/dist/types/utils/validation.d.ts +0 -14
  118. package/dist/types/utils.d.ts +0 -13
package/CHANGELOG.md CHANGED
@@ -5,9 +5,56 @@ Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
5
  Versioning: [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ---
8
- <details open>
9
- <summary><strong>Unreleased Changes</strong></summary>
10
- >
8
+ <details open>
9
+ <summary><strong>Unreleased</strong></summary>
10
+
11
+ - No unreleased changes yet.
12
+
13
+ </details>
14
+
15
+ ---
16
+
17
+ <details>
18
+ <summary><strong>0.1.4-beta.0 --> 2026-03-23</strong></summary>
19
+
20
+ - Added `stroid/psr` as a dedicated native PSR contract entrypoint with committed-only no-track snapshot reads, observation helpers, and explicit timing-contract reporting.
21
+ - Added a canonical `RuntimePatch` model under the PSR surface and lowered `setStore`, `replaceStore`, `resetStore`, and `hydrateStores` into serializable runtime patch records internally.
22
+ - Added public PSR patch-write APIs via `applyStorePatch()` and `applyStorePatchesAtomic()` for canonical `set` and root-level `merge` patches.
23
+ - Hardened transaction commit semantics so failed batched commits roll back staged store state, reset metrics, and queued notifications, while commit-phase feature hook errors no longer break atomic batches.
24
+ - Added computed classification descriptors plus snapshot evaluation APIs for Phase 5 PSR-native integration, defaulting unclassified computeds to `opaque` so only explicitly deterministic nodes are simulated.
25
+ - Hardened Phase 6 graph identity with stable runtime node IDs, store-granularity runtime graphs, typed dependency edges, and PSR graph reads that accept both stable node IDs and legacy computed store names.
26
+ - Hardened Phase 7 timing semantics with explicit governance modes, mutation authority, causality-boundary reporting, and concrete contract reasons for async persistence, sync authority sharing, and async-boundary computed propagation.
27
+ - Added a Phase 8 faithfulness suite that locks preview-vs-commit equivalence for deterministic public PSR flows, verifies public atomic rollback visibility rules, exercises async-boundary stop conditions, and smoke-tests production usage from only public entrypoints.
28
+ - Hardened production SSR computed registration so computed stores inherit explicit global SSR opt-in from already-global dependencies and fail cleanly without leaving stray computed registrations when global creation is unsupported.
29
+ - Added a 250K unique-subscriber benchmark, a 250K concurrent subscriber benchmark with real-world multi-store fanout scenarios, and lean performance-suite coverage for concurrent subscriber and sync broadcast timing; refreshed benchmark harnesses to use explicit feature installers and truly unique subscriber callbacks.
30
+ - Breaking: changed `stroid/persist`, `stroid/sync`, and `stroid/devtools` to side-effect-free modules that export explicit installers (`installPersist`, `installSync`, `installDevtools`) instead of auto-registering on import.
31
+ - Updated package exports, docs, and feature-install guidance to make optional feature registration explicit and more tree-shakeable.
32
+ - Stopped publishing `.map` source maps in the npm tarball to reduce package weight while keeping local build/debug output unchanged.
33
+ - Removed dead `./vue` and `./svelte` package exports that did not have built output behind them.
34
+
35
+ </details>
36
+
37
+ ---
38
+
39
+ <details>
40
+ <summary><strong>0.1.3 --> 2026-03-22</strong></summary>
41
+
42
+ - Fixed async rate limiting so `fetchStore(..., { cacheKey })` is throttled per `cacheSlot` instead of incorrectly sharing one counter across the whole store name.
43
+ - Fixed `createSelector` dependency tracking for object-valued reads so cached selector results no longer go stale when object references change without primitive leaf access.
44
+ - Fixed `setStoreBatch` teardown so a later commit-phase feature error does not discard notifications that were already queued by earlier successful commits.
45
+ - Fixed persist unload listeners so deleting and recreating a persisted store no longer accumulates stale `pagehide` / `beforeunload` flush handlers.
46
+ - Fixed sync-applied remote state so feature write hooks still run, allowing `persist` and other write-driven features to observe synced updates.
47
+ - Fixed `clearAllStores()` under `assertRuntime: true` so a successful clear logs normally instead of throwing from the success path.
48
+ - Fixed sync checksum handling so incoming sync payloads are now verified before remote state is accepted.
49
+ - Fixed async request defaults so bodyless `GET` / `HEAD` / `DELETE` requests no longer send `Content-Type: application/json`.
50
+ - Fixed `createComputed(..., { autoDispose: true })` so computed stores are removed after their last dependency is deleted.
51
+ - Fixed `resetStore()` for falsy initial values (`false`, `0`, `""`, `null`) so registered stores no longer report `not-found` during reset.
52
+ - Replaced the default registry scope's `import.meta.url`-based identifier with a stable bundler-safe string to avoid webpack / Next.js resolution failures.
53
+ - Hardened SSR write-context isolation by routing `runWithWriteContext(...)` through the server AsyncLocalStorage runner instead of relying only on a module-level fallback context.
54
+ - Hardened inline notification delivery to snapshot the subscriber list per flush instead of reusing a shared registry buffer.
55
+ - Tightened React hook type coverage for ambient `StoreStateMap` usage, including `useStore`, `useStoreField`, `useStoreStatic`, `useSelector`, `useFormStore`, `useAsyncStore`, and `useAsyncStoreSuspense`.
56
+ - Clarified React selector recreation warnings and docs so they describe selector churn and cache reuse accurately instead of implying repeated re-subscriptions.
57
+ - Upgraded the transitive `flatted` resolution to `3.4.2` via `npm overrides` to address the Dependabot alert in the eslint / flat-cache toolchain path.
11
58
 
12
59
  </details>
13
60
 
@@ -15,7 +62,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
15
62
 
16
63
 
17
64
  <details>
18
- <summary><strong>v0.1.2 2026-03-19</strong></summary>
65
+ <summary><strong>0.1.2 --> 2026-03-19</strong></summary>
19
66
  > **Note:** This release contains breaking changes to the `stroid/core` export surface and hydration defaults to improve bundle size and security.
20
67
 
21
68
  - `hydrateStores` now requires an explicit trust argument at the TypeScript level (compile-time enforcement).
@@ -113,7 +160,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
113
160
  ---
114
161
 
115
162
  <details>
116
- <summary><strong>0.1.1 2026-03-15</strong></summary>
163
+ <summary><strong>0.1.1 --> 2026-03-15</strong></summary>
117
164
 
118
165
  ### Breaking
119
166
 
@@ -150,7 +197,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
150
197
  ---
151
198
 
152
199
  <details>
153
- <summary><strong>0.1.0 2026-03-14</strong></summary>
200
+ <summary><strong>0.1.0 --> 2026-03-14</strong></summary>
154
201
 
155
202
  ### Added
156
203
 
@@ -184,7 +231,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
184
231
  ---
185
232
 
186
233
  <details>
187
- <summary><strong>0.0.4 2026-03-06</strong></summary>
234
+ <summary><strong>0.0.4 --> 2026-03-06</strong></summary>
188
235
 
189
236
  ### Added
190
237
 
@@ -207,7 +254,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
207
254
  ---
208
255
 
209
256
  <details>
210
- <summary><strong>0.0.3 2026-03-04</strong></summary>
257
+ <summary><strong>0.0.3 --> 2026-03-04</strong></summary>
211
258
 
212
259
  ### Fixed
213
260
 
@@ -224,7 +271,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
224
271
  ---
225
272
 
226
273
  <details>
227
- <summary><strong>0.0.2 2026-03-03</strong></summary>
274
+ <summary><strong>0.0.2 --> 2026-03-03</strong></summary>
228
275
 
229
276
  ### Added
230
277
 
@@ -242,7 +289,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
242
289
  ---
243
290
 
244
291
  <details>
245
- <summary><strong>0.0.1 Initial Release</strong></summary>
292
+ <summary><strong>0.0.1 --> Initial Release</strong></summary>
246
293
 
247
294
  - tsup-minified ESM bundles with subpath outputs.
248
295
  - `useStore` selector overload with dev warning on broad subscriptions.
package/README.md CHANGED
@@ -62,9 +62,9 @@ Each row is independent. Use only what you need.
62
62
  - `stroid/async`: `fetchStore`, cache, retry, revalidate helpers.
63
63
  - `stroid/selectors`: `createSelector`, `subscribeWithSelector`.
64
64
  - `stroid/computed`: `createComputed`, `invalidateComputed`, `deleteComputed`, `isComputedStore`.
65
- - `stroid/persist`: Side-effect registration for persistence (localStorage/sessionStorage). Not tree-shakeable.
66
- - `stroid/sync`: Side-effect registration for BroadcastChannel sync. Not tree-shakeable.
67
- - `stroid/devtools`: Side-effect registration for Redux DevTools bridge. Not tree-shakeable.
65
+ - `stroid/persist`: Explicit persistence installer (`installPersist`) and related types. Side-effect free.
66
+ - `stroid/sync`: Explicit sync installer (`installSync`) and related types. Side-effect free.
67
+ - `stroid/devtools`: Explicit devtools installer (`installDevtools`) plus history helpers. Side-effect free.
68
68
  - `stroid/server`: SSR registry helpers (`createStoreForRequest`).
69
69
  - `stroid/helpers`: Entity/list/counter store helpers.
70
70
  - `stroid/runtime-tools`: Observability and diagnostics.
@@ -121,13 +121,15 @@ import { createSelector, subscribeWithSelector } from "stroid/selectors"
121
121
  import { createComputed, invalidateComputed,
122
122
  deleteComputed, isComputedStore } from "stroid/computed"
123
123
 
124
- // Features (side-effect importsregister once at app entry)
125
- import "stroid/persist"
126
- import "stroid/sync"
127
- import "stroid/devtools"
124
+ // Features (explicit installcall once at app entry)
125
+ import { installPersist } from "stroid/persist"
126
+ import { installSync } from "stroid/sync"
127
+ import { installDevtools } from "stroid/devtools"
128
+
129
+ installPersist()
130
+ installSync()
131
+ installDevtools()
128
132
 
129
- // Note: stroid/persist and stroid/sync are side-effect entrypoints only.
130
- // All types live on the main "stroid" entry.
131
133
 
132
134
  // Server / SSR
133
135
  import { createStoreForRequest } from "stroid/server"
@@ -144,7 +146,7 @@ import { listStores, getStoreMeta, getMetrics,
144
146
  getPersistQueueDepth } from "stroid/runtime-tools"
145
147
  import { clearAllStores, clearStores } from "stroid/runtime-admin"
146
148
 
147
- // Devtools API (after `import "stroid/devtools"`)
149
+ // Devtools API (after installDevtools())
148
150
  import { getHistory, clearHistory } from "stroid/devtools"
149
151
 
150
152
  // Config
package/dist/async.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { F as FetchInput } from './cache.js';
2
- import { a as StoreDefinition, b as StoreKey, c as StoreName } from './types.js';
2
+ import { a as StoreDefinition, b as StoreKey, d as StoreName } from './types.js';
3
3
  import { F as FetchOptions } from './registry.js';
4
4
  export { a as AsyncStateAdapter, b as AsyncStateSnapshot } from './registry.js';
5
5
  import './utility.js';