Releases: epicweb-dev/cachified
Releases · epicweb-dev/cachified
v3.3.0
3.3.0 (2023-04-15)
Features
- support zod schemas on checkValue (06f99aa)
- also attach cause on thrown validation errors
- deprecate CheckFreshValueErrorEvent in favor of CheckFreshValueErrorObjEvent
- deprecate CheckCachedValueErrorEvent in favor of CheckCachedValueErrorObjEvent
- support on-the-fly migrations where the cached value will not be updated with
migrate(newValue, false)
- take type from schema instead of getFreshValue when using zod transformer (18aba3b)
v3.2.0
v3.1.0
v3.0.2
v3.0.1
v3.0.0
3.0.0 (2022-10-24)
Bug Fixes
BREAKING CHANGES
-
CacheMetadata.swv has been renamed to CacheMetadata.swr
for the most part this will be handled by the library
(existing cache entries withswv
will continue to work, only new ones will useswr
)Migration:
When you worked withCacheMetadata
(for example in a custom cache adapter)
you need to adapt your code to:- write
swr
instead ofswv
👍 new:const metadata: CacheMetadata = { swr: 1000, /* ... */ }
⛔️ old:const metadata: CacheMetadata = { swv: 1000, /* ... */ }
- read using the
staleWhileRevalidate
helper
👍 new:const staleMs = staleWhileRevalidate(metadata)
⛔️ old:const staleMs = metadata.swv
- write
-
The
Cache
type is not generic anymore and always usesunknown
for values
You might need to adjust your cache implementations and caches to now work on
unknown data types. Typescript should inform you where.
Nothing to be done when you only used the build-in cache adapters.