stroid 0.1.3 → 0.1.4
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.
- package/CHANGELOG.md +312 -265
- package/README.md +1017 -115
- package/dist/async.d.ts +1 -1
- package/dist/async.js +1 -33
- package/dist/chunk-645IESIU.js +2 -0
- package/dist/chunk-6ELWGQ4Q.js +2 -0
- package/dist/chunk-BW32TJGE.js +13 -0
- package/dist/chunk-FOQKGHPS.js +26 -0
- package/dist/chunk-KQCSFGHJ.js +2 -0
- package/dist/chunk-M2NJVI36.js +2 -0
- package/dist/chunk-PVATWAY4.js +2 -0
- package/dist/chunk-X3JR32JD.js +2 -0
- package/dist/chunk-YU5GMPCC.js +2 -0
- package/dist/computed-types.d.ts +42 -0
- package/dist/computed-types.js +2 -0
- package/dist/computed.d.ts +9 -2
- package/dist/computed.js +1 -12
- package/dist/core.js +1 -22
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +1 -1
- package/dist/feature.js +1 -1
- package/dist/helpers.js +1 -22
- package/dist/index-internal.d.ts +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -35
- package/dist/install.js +1 -1
- package/dist/options.d.ts +1 -1
- package/dist/persist.js +1 -1
- package/dist/psr.d.ts +48 -0
- package/dist/psr.js +2 -0
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.js +5 -36
- package/dist/registry.d.ts +1 -0
- package/dist/runtime-admin.js +1 -1
- package/dist/runtime-patch.d.ts +29 -0
- package/dist/runtime-tools.d.ts +6 -1
- package/dist/runtime-tools.js +1 -3
- package/dist/selectors.js +1 -1
- package/dist/server.d.ts +4 -1
- package/dist/server.js +1 -12
- package/dist/store-registry.d.ts +8 -0
- package/dist/sync.js +1 -1
- package/dist/testing.js +1 -22
- package/dist/types/adapters/options.d.ts +335 -0
- package/dist/types/async/cache.d.ts +40 -0
- package/dist/types/async/clone.d.ts +10 -0
- package/dist/types/async/errors.d.ts +3 -0
- package/dist/types/async/fetch.d.ts +37 -0
- package/dist/types/async/inflight.d.ts +30 -0
- package/dist/types/async/rate.d.ts +5 -0
- package/dist/types/async/registry.d.ts +117 -0
- package/dist/types/async/request.d.ts +11 -0
- package/dist/types/async/retry.d.ts +10 -0
- package/dist/types/async.d.ts +10 -0
- package/dist/types/computed/computed-graph.d.ts +33 -0
- package/dist/types/computed/index.d.ts +21 -0
- package/dist/types/computed/types.d.ts +40 -0
- package/dist/types/config.d.ts +10 -0
- package/dist/types/core/index.d.ts +11 -0
- package/dist/types/core/lifecycle-hooks.d.ts +16 -0
- package/dist/types/core/runtime-patch.d.ts +67 -0
- package/dist/types/core/store-admin-impl.d.ts +9 -0
- package/dist/types/core/store-admin.d.ts +9 -0
- package/dist/types/core/store-core.d.ts +13 -0
- package/dist/types/core/store-create.d.ts +16 -0
- package/dist/types/core/store-hydrate-impl.d.ts +35 -0
- package/dist/types/core/store-hydrate.d.ts +9 -0
- package/dist/types/core/store-lifecycle/hooks.d.ts +20 -0
- package/dist/types/core/store-lifecycle/identity.d.ts +23 -0
- package/dist/types/core/store-lifecycle/registry.d.ts +54 -0
- package/dist/types/core/store-lifecycle/types.d.ts +67 -0
- package/dist/types/core/store-lifecycle/validation.d.ts +53 -0
- package/dist/types/core/store-name.d.ts +28 -0
- package/dist/types/core/store-notify.d.ts +13 -0
- package/dist/types/core/store-read.d.ts +18 -0
- package/dist/types/core/store-registry.d.ts +115 -0
- package/dist/types/core/store-replace-impl.d.ts +11 -0
- package/dist/types/core/store-replace.d.ts +9 -0
- package/dist/types/core/store-set-impl.d.ts +13 -0
- package/dist/types/core/store-set.d.ts +9 -0
- package/dist/types/core/store-shared/core.d.ts +13 -0
- package/dist/types/core/store-shared/notify.d.ts +12 -0
- package/dist/types/core/store-transaction.d.ts +28 -0
- package/dist/types/core/store-write-shared.d.ts +25 -0
- package/dist/types/core/store-write.d.ts +13 -0
- package/dist/types/features/feature-registry.d.ts +91 -0
- package/dist/types/features/lifecycle.d.ts +40 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/integrations/query.d.ts +8 -0
- package/dist/types/internals/computed-order.d.ts +3 -0
- package/dist/types/internals/config.d.ts +116 -0
- package/dist/types/internals/diagnostics.d.ts +21 -0
- package/dist/types/internals/reporting.d.ts +9 -0
- package/dist/types/internals/store-admin.d.ts +7 -0
- package/dist/types/internals/store-ops.d.ts +13 -0
- package/dist/types/internals/test-reset.d.ts +2 -0
- package/dist/types/internals/write-context.d.ts +20 -0
- package/dist/types/notification/delivery.d.ts +3 -0
- package/dist/types/notification/index.d.ts +10 -0
- package/dist/types/notification/metrics.d.ts +12 -0
- package/dist/types/notification/priority.d.ts +9 -0
- package/dist/types/notification/scheduler.d.ts +11 -0
- package/dist/types/notification/snapshot.d.ts +8 -0
- package/dist/types/runtime-admin/index.d.ts +2 -0
- package/dist/types/runtime-tools/index.d.ts +63 -0
- package/dist/types/store.d.ts +16 -0
- package/dist/types/types/utility.d.ts +17 -0
- package/dist/types/utils/clone.d.ts +4 -0
- package/dist/types/utils/devfreeze.d.ts +2 -0
- package/dist/types/utils/hash.d.ts +8 -0
- package/dist/types/utils/path.d.ts +5 -0
- package/dist/types/utils/validation.d.ts +14 -0
- package/dist/types/utils.d.ts +13 -0
- package/dist/types.d.ts +2 -2
- package/package.json +31 -20
- package/dist/async.js.map +0 -1
- package/dist/computed.js.map +0 -1
- package/dist/core.js.map +0 -1
- package/dist/devtools.js.map +0 -1
- package/dist/feature.js.map +0 -1
- package/dist/helpers.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/install.js.map +0 -1
- package/dist/persist.js.map +0 -1
- package/dist/react/index.js.map +0 -1
- package/dist/runtime-admin.js.map +0 -1
- package/dist/runtime-tools.js.map +0 -1
- package/dist/selectors.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/sync.js.map +0 -1
- package/dist/testing.js.map +0 -1
- package/dist/tsdoc-metadata.json +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,279 +1,326 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project are documented in this file.
|
|
4
|
-
Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
5
|
-
Versioning: [Semantic Versioning](https://semver.org/).
|
|
2
|
+
>[!IMPORTANT]
|
|
3
|
+
>All notable changes to this project are documented in this file.
|
|
4
|
+
>Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
5
|
+
>Versioning: [Semantic Versioning](https://semver.org/).
|
|
6
|
+
>Version_Migration : [docs/STROID_VERSION_MIGRATION/INDEX.md](docs/STROID_VERSION_MIGRATION/INDEX.md)
|
|
6
7
|
|
|
7
8
|
---
|
|
8
|
-
<details open>
|
|
9
|
-
<summary><strong>Unreleased</strong></summary>
|
|
10
|
-
|
|
11
|
-
- No unreleased changes yet.
|
|
12
9
|
|
|
13
|
-
|
|
10
|
+
>[!NOTE]
|
|
11
|
+
><details open>
|
|
12
|
+
><summary><strong> Unreleased </strong></summary>
|
|
13
|
+
></details>
|
|
14
|
+
>
|
|
14
15
|
|
|
15
16
|
---
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</details>
|
|
38
|
-
|
|
17
|
+
>[!WARNING]
|
|
18
|
+
><details >
|
|
19
|
+
><summary><strong>0.1.4 --> 2026-3-30 </strong></summary>
|
|
20
|
+
|
|
21
|
+
>- Fixed async persist hydration so Promise-returning `persist.driver.getItem()` now loads stored state even when crypto hooks and checksums stay synchronous.
|
|
22
|
+
>- Fixed persist hydration payload guards so falsy serialized values (`""`, `"0"`, `"false"`) now hydrate correctly instead of being treated as missing data.
|
|
23
|
+
>- Fixed async persist clear detection so `onStorageCleared` now resolves Promise-based drivers instead of treating every pending read as "present".
|
|
24
|
+
>- Fixed focus revalidation cleanup so queued staggered and batched refetch timers are cancelled when the returned cleanup runs.
|
|
25
|
+
>- Fixed async inflight dedupe contracts so raw callers no longer inherit another caller's transformed result for the same cache slot.
|
|
26
|
+
>- Fixed computed identity checks so stable object outputs no longer trigger redundant `replaceStore()` writes during dependency >recompute or `hydrateStores()` recompute.
|
|
27
|
+
>- Fixed request-scoped selectors so `createSelector(...)` now reads carrier-backed state during `createStoreForRequest().hydrate(...)`.
|
|
28
|
+
>- Fixed `resetStore()` in request scope so `onReset(prev)` receives the live pre-reset value instead of the registry placeholder.
|
|
29
|
+
>- Fixed `deleteStore()` in request scope so `onDelete(prev)` receives the live pre-delete value.
|
|
30
|
+
>- Fixed request-scope delete cleanup so removing a store also clears its carrier-backed value instead of leaving hidden stale request state behind.
|
|
31
|
+
>- Fixed request-scope `hydrateStores()` runtime patches so canonical root `set` patches always include the committed hydrated value.
|
|
32
|
+
>- Fixed public feature hook contexts so `onStoreCreate` and `onStoreWrite` expose committed request-scoped state through `ctx.getStoreValue()` and `ctx.getAllStores()`.
|
|
33
|
+
>- Fixed public delete feature hook contexts so `beforeStoreDelete` exposes committed request-scoped state through `ctx.prev`, `ctx.getStoreValue()`, and `ctx.getAllStores()`.
|
|
34
|
+
>
|
|
35
|
+
></details>
|
|
36
|
+
>
|
|
39
37
|
---
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
>[!CAUTION]
|
|
39
|
+
><details>
|
|
40
|
+
><summary><strong>0.1.4-beta.0 --> 2026-03-23</strong></summary>
|
|
41
|
+
>
|
|
42
|
+
>- Fixed the published ESM package layout so `stroid`, `stroid/psr`, and sibling entrypoints share one runtime registry/computed graph instead of shipping isolated bundled state.
|
|
43
|
+
>- Hardened public PSR package-level contract coverage to verify built `dist` entrypoints can detect, read, subscribe to, and patch stores created through the main `stroid` entrypoint.
|
|
44
|
+
>- Tightened public PSR patch rejection semantics with stable `unsupported-op` and `unsupported-path-shape` reason codes for unsupported patch forms.
|
|
45
|
+
>- Expanded the public PSR patch surface to support nested `merge`, `delete`, and `insert`, with canonical path-array behavior and `failedPatchId` reporting for both single and atomic failures.
|
|
46
|
+
>- Added `stroid/psr` as a dedicated native PSR contract entrypoint with committed-only no-track snapshot reads, observation helpers, and explicit timing-contract reporting.
|
|
47
|
+
>- Added a canonical `RuntimePatch` model under the PSR surface and lowered `setStore`, `replaceStore`, `resetStore`, and `hydrateStores` into serializable runtime patch records internally.
|
|
48
|
+
>- Added public PSR patch-write APIs via `applyStorePatch()` and `applyStorePatchesAtomic()` for canonical `set` and root-level `merge` patches.
|
|
49
|
+
>- 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.
|
|
50
|
+
>- 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.
|
|
51
|
+
>- 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.
|
|
52
|
+
>- 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.
|
|
53
|
+
>- 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.
|
|
54
|
+
>- Expanded built-package PSR contract tests to cover committed-final subscription timing, idempotent unsubscribe behavior, computed-settle notification ordering, and timing/governance downgrade claims.
|
|
55
|
+
>- Added a dedicated public PSR guide and support matrix covering patch support, reason codes, runtime node ID treatment, subscription timing, and downgrade rules.
|
|
56
|
+
>- 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.
|
|
57
|
+
>- 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.
|
|
58
|
+
>- Fixed `createStoreForRequest` so the documented callback API now exposes `api.snapshot()`.
|
|
59
|
+
>- Fixed `createStoreForRequest().set(name, object)` so later external mutation of the caller payload no longer mutates request state.
|
|
60
|
+
>- Fixed `createStoreForRequest()` so request-scope writes made during `hydrate()` now persist into later `snapshot()` output and repeated `hydrate()` calls.
|
|
61
|
+
>- Fixed `fetchStore()` timeouts without a caller-provided signal so the internally created request is now aborted when the timeout fires.
|
|
62
|
+
>- Fixed `fetchStore()` request versioning so a timed-out request can no longer reuse a cleared version and overwrite a newer in-flight response.
|
|
63
|
+
>- 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.
|
|
64
|
+
>- Updated package exports, docs, and feature-install guidance to make optional feature registration explicit and more tree-shakeable.
|
|
65
|
+
>- Stopped publishing `.map` source maps in the npm tarball to reduce package weight while keeping local build/debug output unchanged.
|
|
66
|
+
>- Removed dead `./vue` and `./svelte` package exports that did not have built output behind them.
|
|
67
|
+
></details>
|
|
68
|
+
>
|
|
69
|
+
---
|
|
70
|
+
>[!WARNING]
|
|
71
|
+
><details>
|
|
72
|
+
><summary><strong>0.1.3 --> 2026-03-22</strong></summary>
|
|
73
|
+
>
|
|
74
|
+
>- Fixed async rate limiting so `fetchStore(..., { cacheKey })` is throttled per `cacheSlot` instead of incorrectly sharing one counter across the whole store name.
|
|
75
|
+
>- Fixed `createSelector` dependency tracking for object-valued reads so cached selector results no longer go stale when object references change without primitive leaf access.
|
|
76
|
+
>- Fixed `setStoreBatch` teardown so a later commit-phase feature error does not discard notifications that were already queued by earlier successful commits.
|
|
77
|
+
>- Fixed persist unload listeners so deleting and recreating a persisted store no longer accumulates stale `pagehide` / `beforeunload` flush handlers.
|
|
78
|
+
>- Fixed sync-applied remote state so feature write hooks still run, allowing `persist` and other write-driven features to observe synced updates.
|
|
79
|
+
>- Fixed `clearAllStores()` under `assertRuntime: true` so a successful clear logs normally instead of throwing from the success path.
|
|
80
|
+
>- Fixed sync checksum handling so incoming sync payloads are now verified before remote state is accepted.
|
|
81
|
+
>- Fixed async request defaults so bodyless `GET` / `HEAD` / `DELETE` requests no longer send `Content-Type: application/json`.
|
|
82
|
+
>- Fixed `createComputed(..., { autoDispose: true })` so computed stores are removed after their last dependency is deleted.
|
|
83
|
+
>- Fixed `resetStore()` for falsy initial values (`false`, `0`, `""`, `null`) so registered stores no longer report `not-found` during reset.
|
|
84
|
+
>- Replaced the default registry scope's `import.meta.url`-based identifier with a stable bundler-safe string to avoid webpack / Next.js resolution failures.
|
|
85
|
+
>- Hardened SSR write-context isolation by routing `runWithWriteContext(...)` through the server AsyncLocalStorage runner instead of relying only on a module-level fallback context.
|
|
86
|
+
>- Hardened inline notification delivery to snapshot the subscriber list per flush instead of reusing a shared registry buffer.
|
|
87
|
+
>- Tightened React hook type coverage for ambient `StoreStateMap` usage, including `useStore`, `useStoreField`, `useStoreStatic`, `useSelector`, `useFormStore`, `useAsyncStore`, and `useAsyncStoreSuspense`.
|
|
88
|
+
>- Clarified React selector recreation warnings and docs so they describe selector churn and cache reuse accurately instead of implying repeated re-subscriptions.
|
|
89
|
+
>- Upgraded the transitive `flatted` resolution to `3.4.2` via `npm overrides` to address the Dependabot alert in the eslint / flat-cache toolchain path.
|
|
90
|
+
></details>
|
|
91
|
+
>
|
|
92
|
+
---
|
|
93
|
+
>[!CAUTION]
|
|
94
|
+
><details>
|
|
95
|
+
><summary><strong>0.1.2 --> 2026-03-19</strong></summary>
|
|
96
|
+
>
|
|
44
97
|
> **Note:** This release contains breaking changes to the `stroid/core` export surface and hydration defaults to improve bundle size and security.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
98
|
+
>
|
|
99
|
+
>- `hydrateStores` now requires an explicit trust argument at the TypeScript level (compile-time enforcement).
|
|
100
|
+
>- Default snapshot mode changed to `"shallow"` (was `"deep"`). Override per-store with `snapshot: "deep"` or globally with `configureStroid({ defaultSnapshotMode: "deep" })`.
|
|
101
|
+
>
|
|
102
|
+
>### Migration
|
|
103
|
+
>
|
|
104
|
+
>- If you use `stroid/core` for batching, reset, or hydration — move those imports to `stroid`.
|
|
105
|
+
>- If you call `hydrateStores` without a trust argument — add `{ allowTrusted: true }` as the third argument.
|
|
106
|
+
>- If your app relies on deep-clone snapshot semantics — add `snapshot: "deep"` to affected stores or set `configureStroid({ defaultSnapshotMode: "deep" })`.
|
|
107
|
+
>
|
|
108
|
+
>### Performance
|
|
109
|
+
>
|
|
110
|
+
>- Hot-path proxy avoidance: `deliverFlush` now captures direct registry references once and reuses them during the flush loop.
|
|
111
|
+
>- `Array.from` elimination: replaced per-flush subscriber array allocations with a registry-level reusable buffer.
|
|
112
|
+
>- `buildFlushPlan` collapse: reduced passes, preserved `pendingBuffer` semantics, and removed the terminal `orderedNames.slice()` allocation.
|
|
113
|
+
>
|
|
114
|
+
>### Added
|
|
115
|
+
>
|
|
116
|
+
>- `allowTrusted` hydration flag (aliasing `allowHydration`; `allowUntrusted` deprecated).
|
|
117
|
+
>- `allowTrustedHydration` config alias.
|
|
118
|
+
>- `sync.loopGuard` option to suppress immediate rebroadcasts after an incoming sync update.
|
|
119
|
+
>- `registerMutatorProduce` helper for safely registering Immer (or other mutator engines).
|
|
120
|
+
>- `selectorCloneFrozen` config flag to control frozen-state cloning in `createSelector` (dev performance toggle).
|
|
121
|
+
>- `createStoreForRequest` now exposes the request `registry` for `RegistryScope` or advanced SSR usage.
|
|
122
|
+
>- `stroid/server` now re-exports the `StoreRegistry` type for SSR typing.
|
|
123
|
+
>- Store metrics now include reset timing (`resetCount`, `totalResetMs`, `lastResetMs`).
|
|
124
|
+
>- API Extractor configuration and `docs:api` script for generating typed API reports.
|
|
125
|
+
>- `IStoreCore` shared interface and `store-core` adapter for layer boundaries.
|
|
126
|
+
>- ESLint layer guards for async-cache and store-notify imports.
|
|
127
|
+
>- Optional TypeScript layer configs (`tsconfig.layers.json`) for build-time dependency checks.
|
|
128
|
+
>- `sync.insecure` option to explicitly allow unauthenticated sync in production.
|
|
129
|
+
>- `onValidationError` hook for hydrate trust validation failures.
|
|
130
|
+
>- `acknowledgeLooseTypes` config flag to silence the loose-type dev warning.
|
|
131
|
+
>- `pathCacheSize` config to tune per-store path validation cache limits.
|
|
132
|
+
>- `HydrateSnapshotFor<Map>` helper type for stricter hydration typing.
|
|
133
|
+
>- Internal lifecycle hook hub for decoupled cross-layer events.
|
|
134
|
+
>- Lazy store lifecycle helpers: `isLazyStore`, `isLazyPending`, `isStoreMaterialized`.
|
|
135
|
+
>- `autoCorrelationIds` config and `fetchStore` correlation/trace context propagation.
|
|
136
|
+
>- `getStoreHealth()` unified observability helper for per-store and global metrics.
|
|
137
|
+
>- `findColdStores()` to surface cold/stale/write-only stores.
|
|
138
|
+
>- Root exports for `getMetrics` and `getAsyncMetrics` for discoverability.
|
|
139
|
+
>- Reserved `stroid/vue` and `stroid/svelte` entry points (adapter placeholders, not implemented).
|
|
140
|
+
>- `onStoreLifecycle` registry hook for single-listener lifecycle events (devtools-oriented).
|
|
141
|
+
>
|
|
142
|
+
>### Changed
|
|
143
|
+
>
|
|
144
|
+
>- `createStoreForRequest` now hydrates with `{ allowTrusted: true }`.
|
|
145
|
+
>- `getStore` now respects `snapshot` mode (`deep`/`shallow`/`ref`) for both whole-store and path reads.
|
|
146
|
+
>- `setStore` TypeScript overloads consolidated to reduce IntelliSense noise.
|
|
147
|
+
>- Lazy store typings now require `lazy: true` when initial data is a function.
|
|
148
|
+
>- Sync loop guard is enabled by default (opt out with `sync: { loopGuard: false }`).
|
|
149
|
+
>- Unauthenticated sync is blocked in production unless `authToken`, `verify`, or `insecure` is provided.
|
|
150
|
+
>- `hydrateStores` throws in dev when `trust.validate` throws; routes via `onError` in production.
|
|
151
|
+
>- `hydrateStores` returns structured `failed` entries with `blocked` reasons.
|
|
152
|
+
>- `mutatorProduce: "immer"` now uses `registerMutatorProduce`.
|
|
153
|
+
>- `useStore` warns once in dev when store names are untyped.
|
|
154
|
+
>- `useStore` broad-subscription warnings now surface outside dev (once per store).
|
|
155
|
+
>- `snapshot: "shallow"` now dev-freezes the top-level snapshot.
|
|
156
|
+
>- Notification pipeline split into `notification/*` modules.
|
|
157
|
+
>- Async cache cleanup hooks now register through lifecycle hooks.
|
|
158
|
+
>- `resetStore` reports `lazy-uninitialized` when called before materialization.
|
|
159
|
+
>- `setStoreBatch` throws in production SSR on the global registry (requires request scope).
|
|
160
|
+
>- Store metadata now tracks read counts and last-read timestamps.
|
|
161
|
+
>- Middleware contexts include optional `correlationId`/`traceContext`.
|
|
162
|
+
>- React hooks live exclusively under `stroid/react`.
|
|
163
|
+
>- `deepClone` throws on non-cloneable values.
|
|
164
|
+
>- `endTransaction` now executes all pending commit callbacks, capturing the first error while allowing remaining commits to run.
|
|
165
|
+
>
|
|
166
|
+
>### Fixed
|
|
167
|
+
>
|
|
168
|
+
>- Helper store typings align with stricter `createStore` overloads.
|
|
169
|
+
>- `replaceStore` now participates in `setStoreBatch` transactions.
|
|
170
|
+
>- Removed dead `runInline` logic from the chunked notify queue.
|
|
171
|
+
>- Selector reads in request scope no longer leak through the default registry.
|
|
172
|
+
>- React hooks now resolve the active request registry when `RegistryScope` is omitted during SSR hydration.
|
|
173
|
+
>- Chunked flush now snapshots subscribers per task to avoid mid-flush corruption.
|
|
174
|
+
>- `injectTransactionRunner` ignores unsafe reinjection attempts.
|
|
175
|
+
>- `endTransaction` surfaces commit-phase errors.
|
|
176
|
+
>- Persist writes re-check the latest sequence before `setItem`.
|
|
177
|
+
>- `fetchStore` sets an error state when `transform` returns a Promise.
|
|
178
|
+
>- Async rate limiting is enforced per store (not per cache slot).
|
|
179
|
+
>- `hydrateStores` recomputes affected computed stores after hydration.
|
|
180
|
+
>- User `onError` callbacks are now isolated from core operations if they throw.
|
|
181
|
+
>
|
|
182
|
+
>### Docs
|
|
183
|
+
>
|
|
184
|
+
>- Hydration examples now reference `allowTrusted` language.
|
|
185
|
+
>- Sync options documentation now includes `loopGuard`.
|
|
186
|
+
>- README now documents `registerMutatorProduce`, `sync.insecure`, and `onValidationError`.
|
|
187
|
+
>- React SSR docs now mention `stores.registry` and the automatic request-registry fallback.
|
|
188
|
+
></details>
|
|
189
|
+
>
|
|
138
190
|
---
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
191
|
+
>[!CAUTION]
|
|
192
|
+
><details>
|
|
193
|
+
><summary><strong>0.1.1 --> 2026-03-15</strong></summary>
|
|
194
|
+
>
|
|
195
|
+
>### Breaking
|
|
196
|
+
>
|
|
197
|
+
>- `stroid/core` now exports only `createStore`, `setStore`, `getStore`, and `deleteStore` (minimal primitives).
|
|
198
|
+
>
|
|
199
|
+
>### Migration
|
|
200
|
+
>
|
|
201
|
+
>- If you used `stroid/core` for batching, reset, or hydration — import those from `stroid` instead.
|
|
202
|
+
>
|
|
203
|
+
>### Added
|
|
204
|
+
>
|
|
205
|
+
>- Public feature installer entrypoints and a `features` option bag for custom feature registration.
|
|
206
|
+
>- Optional structural sharing via `configureStroid({ mutatorProduce })` (supports a global Immer shim).
|
|
207
|
+
>- `strictAsyncUsageErrors` to throw on async usage errors when enabled.
|
|
208
|
+
>
|
|
209
|
+
>### Changed
|
|
210
|
+
>
|
|
211
|
+
>- SSR request APIs are now fully typed; `snapshotStrategy` drives the default snapshot mode.
|
|
212
|
+
>- Config is registry-scoped to avoid cross-request bleed in SSR.
|
|
213
|
+
>- Transaction snapshot caching scoped to the active batch.
|
|
214
|
+
>- Internal layering tightened; added guard against restricted lifecycle imports.
|
|
215
|
+
>
|
|
216
|
+
>### Fixed
|
|
217
|
+
>
|
|
218
|
+
>- Chunked flush delivery no longer mixes snapshots within a single notification.
|
|
219
|
+
>- Persist sequencing avoids stale writes when debounce timers overlap.
|
|
220
|
+
>- Notification queues and batch depth are registry-scoped for SSR safety.
|
|
221
|
+
>- DTS build succeeds with a type-safe internal cast for SSR options merges.
|
|
222
|
+
>- `useStore` missing-store warning moved to render time for immediate feedback.
|
|
223
|
+
>- Sync warns when authentication is missing or `sign` is configured without `verify`.
|
|
224
|
+
></details>
|
|
225
|
+
>
|
|
175
226
|
---
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
227
|
+
>[!CAUTION]
|
|
228
|
+
><details>
|
|
229
|
+
><summary><strong>0.1.0 --> 2026-03-14</strong></summary>
|
|
230
|
+
>
|
|
231
|
+
>### Added
|
|
232
|
+
>
|
|
233
|
+
>- `configureStroid({ strictMissingFeatures: true })` to hard-fail when a feature is used without its side-effect import.
|
|
234
|
+
>- `configureStroid({ allowUntrustedHydration: true })` to opt in to `hydrateStores` on untrusted snapshots.
|
|
235
|
+
>- `configureStroid({ mutatorProduce })` to plug in a structural-sharing mutator engine.
|
|
236
|
+
>- `getSubscriberCount`, `getAsyncInflightCount`, `getPersistQueueDepth` observability helpers.
|
|
237
|
+
>- `configureStroid({ assertRuntime: true })` to throw on warnings/errors.
|
|
238
|
+
>- `createComputed(...)` for reactive derived stores.
|
|
239
|
+
>- `getComputedGraph()` and `getComputedDeps()` diagnostics.
|
|
240
|
+
>- `configureStroid({ strictMutatorReturns: true })` to forbid mutator return values.
|
|
241
|
+
>- `StrictStoreMap` opt-in type mode.
|
|
242
|
+
>
|
|
243
|
+
>### Breaking Changes
|
|
244
|
+
>
|
|
245
|
+
>- Removed `mergeStore` and `chain` from the public API.
|
|
246
|
+
>- `setStoreBatch` is now transactional (staged writes, atomic commit, rollback on error).
|
|
247
|
+
>- `createStore`, `deleteStore`, `hydrateStores` are disallowed inside a batch.
|
|
248
|
+
>- `hydrateStores` requires explicit trust via third argument or config.
|
|
249
|
+
>
|
|
250
|
+
>### Fixed
|
|
251
|
+
>
|
|
252
|
+
>- `deleteStore` no longer emits an intermediate null notification.
|
|
253
|
+
>- Async fetch 60s timeout now clears on completion.
|
|
254
|
+
>- `clearAllStores` now removes stores created during delete hooks.
|
|
255
|
+
>- SSR registry isolation uses `AsyncLocalStorage`-backed registries.
|
|
256
|
+
>- Store names reject `__proto__`, `constructor`, `prototype`.
|
|
257
|
+
></details>
|
|
258
|
+
>
|
|
209
259
|
---
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
260
|
+
>[!TIP]
|
|
261
|
+
><details>
|
|
262
|
+
><summary><strong>0.0.4 --> 2026-03-06</strong></summary>
|
|
263
|
+
>
|
|
264
|
+
>### Added
|
|
265
|
+
>
|
|
266
|
+
>- Persistence recovery hooks: `persist.onMigrationFail` and `persist.onStorageCleared`.
|
|
267
|
+
>- Sync hardening: `sync.maxPayloadBytes` and snapshot requests for reconnecting tabs.
|
|
268
|
+
>
|
|
269
|
+
>### Changed
|
|
270
|
+
>
|
|
271
|
+
>- Docs: converted repo docs into chapter-based handbook; aligned README and API chapters with real package surface.
|
|
272
|
+
>- Packaging: rebuilt `dist` from current `src`; fixed `stroid/react` build entry.
|
|
273
|
+
>
|
|
274
|
+
>### Fixed
|
|
275
|
+
>
|
|
276
|
+
>- `hydrateStores` rejects invalid schema payloads without leaving broken store shells.
|
|
277
|
+
>- Middleware throws no longer poison later notifications.
|
|
278
|
+
>- Async lifecycle cleanup hardened (inflight metadata clears on store deletion).
|
|
279
|
+
></details>
|
|
280
|
+
>
|
|
232
281
|
---
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
282
|
+
>[!WARNING]
|
|
283
|
+
><details>
|
|
284
|
+
><summary><strong>0.0.3 --> 2026-03-04</strong></summary>
|
|
285
|
+
>
|
|
286
|
+
>### Fixed
|
|
287
|
+
>
|
|
288
|
+
>- Persistence catches `localStorage.setItem` errors (e.g., `QuotaExceededError`) and routes to `onError`.
|
|
289
|
+
>- Async fetch metadata cleans up when a store is deleted.
|
|
290
|
+
>- `enableRevalidateOnFocus` removes focus/online listeners when the store is deleted.
|
|
291
|
+
>- `useSelector` memoizes with shallow equality, preventing endless re-renders.
|
|
292
|
+
>- Store schemas now enforced on write (`setStore`).
|
|
293
|
+
>- `createStore` no longer overwrites an existing store name.
|
|
294
|
+
>- `setStore` path updates preserve array shapes instead of converting to objects.
|
|
295
|
+
></details>
|
|
296
|
+
>
|
|
249
297
|
---
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
298
|
+
>[!TIP]
|
|
299
|
+
><details>
|
|
300
|
+
><summary><strong>0.0.2 --> 2026-03-03</strong></summary>
|
|
301
|
+
>
|
|
302
|
+
>### Added
|
|
303
|
+
>
|
|
304
|
+
>- SSR helpers: `createStoreForRequest` and `hydrateStores`.
|
|
305
|
+
>- Store helpers: `createEntityStore`, `createListStore`, `createCounterStore`.
|
|
306
|
+
>- Observability: `getHistory`, `clearHistory`, `getMetrics`.
|
|
307
|
+
>- Sync tuning: optional `channel` and `conflictResolver`.
|
|
308
|
+
>
|
|
309
|
+
>### Fixed
|
|
310
|
+
>
|
|
311
|
+
>- Hydration safety around theme toggles.
|
|
312
|
+
></details>
|
|
313
|
+
>
|
|
267
314
|
---
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
315
|
+
>[!TIP]
|
|
316
|
+
><details>
|
|
317
|
+
><summary><strong>0.0.1 --> Initial Release</strong></summary>
|
|
318
|
+
>
|
|
319
|
+
>- tsup-minified ESM bundles with subpath outputs.
|
|
320
|
+
>- `useStore` selector overload with dev warning on broad subscriptions.
|
|
321
|
+
>- Hooks split into core/async/form modules.
|
|
322
|
+
>- Async focus/online revalidation helper.
|
|
323
|
+
>- Safety: path/type guard warnings, persist key collision warning.
|
|
324
|
+
>- CRC table lazy init.
|
|
325
|
+
></details>
|
|
326
|
+
>
|