Releases: kasihagustinusT/soulcache
Release list
SoulCache v1.1.1
SoulCache v1.1.1
High-performance data fetching and caching runtime for TypeScript. Zero runtime dependencies. Framework-agnostic.
This is a security patch release following an independent security review. All four
packages (@soulcache/core, @soulcache/react, @soulcache/devtools,
@soulcache/devtools-core) are bumped to 1.1.1. The public API is fully compatible
with v1.1.0 / v1.0.0.
Highlights
- Honest checksum algorithms —
checksum: 'sha-256'now writes a real FIPS 180-4
SHA-256 digest (64-hex) instead of silently reusing the non-cryptographic 32-bit
djb2 hash that every label produced before. Deprecated labels that were never
implemented (sha-384,sha-512,md5) are rejected on write; payloads persisted
by earlier versions under any label remain readable. - No
error.stackin dehydrated state by default — internal file paths no longer
leak to clients in SSR flows. Opt back in withincludeStack: truefor
server-side debugging. - Hardened
hydrate()— malformed entries (non-arrayqueryKey, non-object
query) are rejected before they can corrupt the cache. - CSPRNG-generated ids —
generateId()usescrypto.randomUUID()when available.
What's Changed
Security
- Checksum integrity (SLC-INTEGRITY-001).
JsonSerializer/JsonDeserializer
now honor the configuredChecksumAlgorithm:sha-256computes a real, synchronous, zero-dependency SHA-256 digest (FIPS
180-4) — previously the label silently produced the same 32-bit djb2 value as
every other label.- Writes under
sha-384,sha-512, ormd5throwSerializationError(these
labels were never implemented and are deprecated; migrate tosha-256or the
defaultfast-32). - Reads under
sha-256verify against both the real digest and the legacy djb2
value, so 1.0.0/1.1.0 payloads keep validating; legacy labels remain readable.
- Stack disclosure (SLC-HYDRATE-003).
dehydrate()no longer includes
error.stackby default; passincludeStack: trueto preserve it for server-side
debugging. - Hydrate tampering (SLC-HYDRATE-001).
hydrate()structurally validates every
entry before writing; malformed entries are skipped. The defaultoverwrite
merge strategy is unchanged. - Weak ids (SLC-RNG-001).
generateId()preferscrypto.randomUUID(), with the
legacy scheme retained as a fallback.
Documentation
SECURITY.mdadds secure-usage guidance (query-key scoping, trusted hydrate
sources, checksum = corruption detection not tamper-proofing, stack opt-in).- New consumer security page
docs/content/docs/security.mdx. - Release notes and migration guide updated for v1.1.1.
Testing
- New SHA-256 test suite with FIPS 180-4 vectors (empty, "abc", two-block, padding
boundary) plus serializer/deserializer dual-mode, hydration validation, and
CSPRNG id tests. - Root suite green on the release commit; public API verified compatible with the
v1.0.0 baseline.
Breaking Changes
None. No public API signature changed. Two opt-in/opt-out behavior changes to
review (see Upgrade Notes).
Upgrade Notes
- Dehydrated error entries no longer include
error.stackby default. If you used
stacks from dehydrated state (e.g. SSR debugging), pass
dehydrate(engine, { includeStack: true })— and keep stacks server-side. - If you configured
checksum: 'sha-384' | 'sha-512' | 'md5', serialization now
throws. Switch tosha-256(real) or drop the option (defaultfast-32).
Persisted payloads never need migration; they restore correctly.
Known Limitations
- Checksums are unkeyed: both
fast-32andsha-256detect accidental corruption,
not an attacker who can rewrite both payload and checksum. Use authenticated
storage (HMAC/encryption) where adversarial persistence is in scope. - Retry engine and the plugin system remain internal modules.
Credits
Maintained by Kasih Agustinus and the SoulCache contributors.
Full Changelog
@soulcache/react@1.1.1
Changelog
All notable changes to this project will be documented in this file.
[1.1.1] - 2026-08-07
Changed
- Version aligned with
@soulcache/core@1.1.1security patch (honest checksum
algorithms, hydrate entry validation,error.stackopt-in, CSPRNG ids). No
React-binding API changes.
@soulcache/devtools@1.1.1
Changelog
All notable changes to this project will be documented in this file.
[1.1.1] - 2026-08-07
Changed
- Version aligned with
@soulcache/core@1.1.1security patch. No DevTools API
changes.
@soulcache/devtools-core@1.1.1
Changelog
All notable changes to this project will be documented in this file.
[1.1.1] - 2026-08-07
Changed
- Version aligned with
@soulcache/core@1.1.1security patch. No DevTools-core API
changes.
@soulcache/core@1.1.1
Changelog
All notable changes to this project will be documented in this file.
[1.1.1] - 2026-08-07
Security
- Honest checksum algorithms (SLC-INTEGRITY-001).
sha-256now computes a real
FIPS 180-4 SHA-256 digest (64-hex). Previously every configured label
(sha-256,sha-384,sha-512,md5,fast-32) silently computed the same
32-bit djb2 value. Writes undersha-384/sha-512/md5now throw
SerializationError(never implemented, deprecated); payloads persisted by
1.0.0/1.1.0 under any label (including legacy djb2 values labeledsha-256)
remain readable via dual-mode verification. dehydrate()no longer includeserror.stackby default (SLC-HYDRATE-003).
Dehydrated error entries expose onlymessageandname; pass
includeStack: trueto opt back in for server-side debugging.hydrate()validates entry structure (SLC-HYDRATE-001). Malformed entries
(non-arrayqueryKey, non-object query) are rejected before they can corrupt the
cache; defaultoverwritemerge strategy is unchanged.generateId()uses a CSPRNG (SLC-RNG-001). IDs usecrypto.randomUUID()when
available, with the legacy scheme retained as a fallback.
Changed
JsonSerializer/JsonDeserializerchecksum selection is now honored; the
ChecksumAlgorithmdocumentation describes the semantics of each label.
[1.1.0] - 2026-08-06
Changed
- LRU eviction score formula corrected so recently/frequently accessed entries are evicted last.
- Mutation
onSuccess/onError/onSettledcallbacks are 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. InfiniteQuerydefaultmaxPageschanged fromInfinityto50; navigation flags are recomputed after page-window eviction.EventBusadds monotonic sequence numbers and opt-in coalesced delivery.
Security
MemoryAdapteraccepts amaxEntriesoption to cap stored entries and bound memory use.deepEqualguards recursion depth to prevent stack-overflow attacks on pathological input.deserializevalidates the dehydrated-state shape before hydrating.EventBusenforces a per-type handler limit.
[1.0.0] - 2026-07-23
Added
Core Runtime
- Query client with request deduplication
- Cache engine with configurable TTL, garbage collection, and dependency tracking
- Mutation system with optimistic updates and rollback
- Observer system with structured snapshots and real-time subscriptions
- Scheduler with priority-based task scheduling (immediate, high, normal, low, idle)
- Infinite query support with cursor-based and page-based pagination
- Retry engine (internal module) with exponential, linear, and constant backoff strategies
- Plugin system (internal module) with lifecycle hooks for query, mutation, cache, and error events
Storage
- Pluggable storage adapters (Memory)
- Automatic persistence with configurable serialization
- Migration manager for schema versioning
- Restore manager for cache recovery
- Diagnostics and health monitoring
- Persistence coordinator for unified storage management
Hydration
- Server-side prefetching with
dehydrateandhydrate - Structural sharing for efficient re-renders
- Streaming-compatible hydration for Next.js App Router
Error Handling
- Typed error hierarchy (SoulCacheError, ConfigurationError, QueryError, CacheError, RuntimeError)
- Error classification and recovery
Utilities
generateIdfor unique query and mutation identifiersEventBusfor internal event communicationSubscriptionManagerfor query subscriptionsQuerySnapshotManagerfor snapshot management
[0.1.0] - 2026-07-18
Added
- Initial package scaffold
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.
Full Changelog
SoulCache v1.0.0
SoulCache v1.0.0
Universal Data Fetching & Caching Runtime for TypeScript
SoulCache is a framework-agnostic data fetching and caching runtime for TypeScript applications. It handles deduplication, background refetching, retry logic, and cache invalidation with zero runtime dependencies.
Highlights
Core Runtime
- Stale-while-revalidate caching with configurable TTL
- Request deduplication across concurrent observers
- Automatic garbage collection and cache eviction
- O(1) cache lookups with hash-based key resolution
React Adapter
useQuery,useMutation,useInfiniteQueryhooksSoulCacheProvidercontext wrapperHydrationBoundaryfor SSR streaming- Built on
useSyncExternalStorefor React 18+ compatibility
DevTools
- Floating inspection panel with
Ctrl/Cmd+Shift+Dshortcut - Query, Mutation, and Cache state inspection
- Timeline recording with event filtering
- p50/p95/p99 performance metrics
- Session recording and replay
Storage Layer
- MemoryAdapter with pluggable custom adapter support
- Automatic persistence with migration support
- Lifecycle management and diagnostics
- Checksum validation and corruption recovery
Hydration
- Server-side prefetching with
dehydrate/hydrate - Streaming-compatible partial hydration
- Next.js App Router support
Infinite Query
- Cursor-based pagination
- Automatic page deduplication
- Background refetching of stale pages
Plugin System
- Lifecycle hooks for query, mutation, and cache events
- Error isolation per hook
- Automatic dependency resolution
Scheduler
- Task prioritization with configurable queues
- Batch scheduling for performance
- Microtask and macrotask support
Retry Engine
- Exponential, linear, and constant backoff strategies
- Error classification with automatic retry decisions
- Configurable retry policies per query
Documentation
- Full documentation at soulcache.vercel.app
- API reference, migration guides, and examples
- Fumadocs-powered with MDX content
Developer Experience
- Strict TypeScript with minimal
anyusage - Full declaration maps and source maps
- ESLint and Prettier configured
- Changesets for version management
Testing
- 756/756 tests passing
- Stress tests for cache and observer performance
- Memory leak detection tests
- Integration tests for storage layer
CI/CD
- GitHub Actions with Node 20 and Node 22 matrix
- Automated release workflow via Changesets
- CodeQL security analysis
- Nightly dependency audits
Quality Summary
| Metric | Status |
|---|---|
| Tests | 756/756 passing |
| TypeCheck | Pass |
| Build | Pass |
| Documentation | Pass |
| CI | Pass (Node 20, Node 22) |
| CodeQL | Pass |
| Runtime Dependencies | Zero (core) |
Installation
# npm
npm install @soulcache/core
# pnpm
pnpm add @soulcache/core
# yarn
yarn add @soulcache/coreFor React applications:
npm install @soulcache/react @soulcache/corePackages
| Package | Description |
|---|---|
@soulcache/core |
Core runtime with cache, query engine, retry, scheduler, storage, and plugins |
@soulcache/react |
React hooks and components via useSyncExternalStore |
@soulcache/devtools-core |
Framework-agnostic inspection and diagnostics |
@soulcache/devtools |
React DevTools panel with timeline, metrics, and session recording |
Documentation
License
MIT — Copyright (c) 2026 Kasih Agustinus