stroid 0.1.3 → 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 (50) hide show
  1. package/CHANGELOG.md +37 -15
  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 +9 -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 +14 -14
  13. package/dist/index-internal.d.ts +1 -1
  14. package/dist/index.d.cts +3 -1
  15. package/dist/index.d.ts +3 -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 +6 -0
  31. package/dist/sync.js +1 -1
  32. package/dist/testing.js +16 -16
  33. package/dist/types.d.ts +1 -1
  34. package/package.json +37 -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
package/CHANGELOG.md CHANGED
@@ -5,17 +5,39 @@ 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</strong></summary>
10
-
11
- - No unreleased changes yet.
12
-
13
- </details>
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>
14
36
 
15
37
  ---
16
38
 
17
- <details open>
18
- <summary><strong>v0.1.3 — 2026-03-22</strong></summary>
39
+ <details>
40
+ <summary><strong>0.1.3 --> 2026-03-22</strong></summary>
19
41
 
20
42
  - Fixed async rate limiting so `fetchStore(..., { cacheKey })` is throttled per `cacheSlot` instead of incorrectly sharing one counter across the whole store name.
21
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.
@@ -40,7 +62,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
40
62
 
41
63
 
42
64
  <details>
43
- <summary><strong>v0.1.2 2026-03-19</strong></summary>
65
+ <summary><strong>0.1.2 --> 2026-03-19</strong></summary>
44
66
  > **Note:** This release contains breaking changes to the `stroid/core` export surface and hydration defaults to improve bundle size and security.
45
67
 
46
68
  - `hydrateStores` now requires an explicit trust argument at the TypeScript level (compile-time enforcement).
@@ -138,7 +160,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
138
160
  ---
139
161
 
140
162
  <details>
141
- <summary><strong>0.1.1 2026-03-15</strong></summary>
163
+ <summary><strong>0.1.1 --> 2026-03-15</strong></summary>
142
164
 
143
165
  ### Breaking
144
166
 
@@ -175,7 +197,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
175
197
  ---
176
198
 
177
199
  <details>
178
- <summary><strong>0.1.0 2026-03-14</strong></summary>
200
+ <summary><strong>0.1.0 --> 2026-03-14</strong></summary>
179
201
 
180
202
  ### Added
181
203
 
@@ -209,7 +231,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
209
231
  ---
210
232
 
211
233
  <details>
212
- <summary><strong>0.0.4 2026-03-06</strong></summary>
234
+ <summary><strong>0.0.4 --> 2026-03-06</strong></summary>
213
235
 
214
236
  ### Added
215
237
 
@@ -232,7 +254,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
232
254
  ---
233
255
 
234
256
  <details>
235
- <summary><strong>0.0.3 2026-03-04</strong></summary>
257
+ <summary><strong>0.0.3 --> 2026-03-04</strong></summary>
236
258
 
237
259
  ### Fixed
238
260
 
@@ -249,7 +271,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
249
271
  ---
250
272
 
251
273
  <details>
252
- <summary><strong>0.0.2 2026-03-03</strong></summary>
274
+ <summary><strong>0.0.2 --> 2026-03-03</strong></summary>
253
275
 
254
276
  ### Added
255
277
 
@@ -267,7 +289,7 @@ Versioning: [Semantic Versioning](https://semver.org/).
267
289
  ---
268
290
 
269
291
  <details>
270
- <summary><strong>0.0.1 Initial Release</strong></summary>
292
+ <summary><strong>0.0.1 --> Initial Release</strong></summary>
271
293
 
272
294
  - tsup-minified ESM bundles with subpath outputs.
273
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';