SoulCache v1.1.0 — Security Hardening, Correctness Fixes, and Performance
SoulCache v1.1.0
High-performance data fetching and caching runtime for TypeScript. Zero runtime dependencies. Framework-agnostic.
This release ships security hardening, correctness fixes, packaging improvements, and documentation accuracy updates. The public API is fully compatible with v1.0.0.
Highlights
- Memory-bounded caching —
MemoryAdapternow acceptsmaxEntriesto cap stored entries. - Hardened serialization —
deepEqualguards recursion depth;deserializevalidates dehydrated-state shape before hydrating, rejecting malformed or hostile payloads. - Correct cache eviction — LRU eviction score formula corrected so recently and frequently accessed entries are evicted last.
- Robust mutation callbacks —
onSuccess/onError/onSettledare isolated per callback; a throwing callback no longer corrupts mutation state or skipsonSettled. - Smaller, cleaner packages — minification enabled for
@soulcache/coreand@soulcache/react; DevTools packages no longer bundle the core source tree. - Bounded infinite queries — default
maxPageschanged from unbounded to50; navigation flags are recomputed after page-window eviction.
What's Changed
Security
MemoryAdapternow accepts amaxEntriesoption to cap stored entries and bound memory use.deepEqualnow guards recursion depth to prevent stack-overflow attacks on pathological input.deserializenow validates the dehydrated-state shape before hydrating, rejecting malformed or hostile payloads.EventBusnow enforces a per-type handler limit (maxHandlersPerType) to prevent unbounded listener growth.
Correctness
- LRU eviction score formula corrected so recently/frequently accessed entries are evicted last.
- Mutation
onSuccess/onError/onSettledcallbacks are now isolated per callback; a throwing callback no longer corrupts mutation state or skipsonSettled. - Retry-engine event listeners are individually isolated;
toError()preservesname/messagefor non-Errorthrown values (e.g.DOMException). InfiniteQuerydefaultmaxPageschanged fromInfinityto50; navigation flags are recomputed after page-window eviction.- Hydration
mergeStrategy: 'merge'now preserves existing data and hydrates only entries without data. EventBusadds monotonic sequence numbers and opt-in coalesced delivery.
Performance & Packaging
- Build minification enabled for
@soulcache/coreand@soulcache/react. - DevTools packages no longer bundle the core source tree (devtools 319 -> 19 files; devtools-core 319 -> 35 files).
- No benchmark regressions;
@soulcache/corebundle remains approximately 16 KB (gzip).
Documentation
- Corrected bundle-size, retry, background-refetch, and plugin-system claims across the docs site.
- New DevTools guide; corrected infinite-query, hydration, mutation, and query-client API references.
- Roadmap and release notes updated with verified test counts.
Testing
- 1312/1312 tests passing in the root suite (core + devtools + devtools-core); 199/199 React bindings tests passing.
- New regression suites: EventBus handler caps, InfiniteQuery maxPages window, mutation callback isolation, retry listener isolation, hydration merge.
- Public API verified compatible with the v1.0.0 baseline.
Breaking Changes
None. The public API surface is fully compatible with v1.0.0 (verified against the API baseline).
Upgrade Notes
No code changes are required to upgrade. Review the following behavioral changes:
InfiniteQuerynow defaults to amaxPageswindow of50. ConfiguremaxPagesexplicitly if you relied on unbounded page retention.- Mutation callbacks are now isolated. If your
onSuccess/onErrorthrows, wrap the body intry/catch— other callbacks andonSettledwill still run. - Eviction order may differ for caches near their capacity because of the corrected LRU scoring. With
MemoryAdapter.maxEntries, verify eviction behavior in tests.
Known Limitations
- Retry engine and background refetching remain internal modules; integration is targeted for a future milestone.
- The plugin system is internal and not yet part of the public API.
Credits
Maintained by Kasih Agustinus and the SoulCache contributors.