Skip to content

Releases: epicweb-dev/cachified

v3.3.0

15 Apr 23:16
fe0f6c7
Compare
Choose a tag to compare

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

14 Apr 20:21
d26a83d
Compare
Choose a tag to compare

3.2.0 (2023-04-14)

Bug Fixes

  • do not execute getValues callback of batch when all values are cached (d26a83d)

Features

  • support fine-tuning metadata in batch requests (9ee69b0) (ref #43)

v3.1.0

25 Jan 07:51
9c53976
Compare
Choose a tag to compare

3.1.0 (2023-01-25)

Features

  • introduce GetFreshValueContext (9c53976)

v3.0.2

24 Jan 09:47
e0d517f
Compare
Choose a tag to compare

3.0.2 (2023-01-24)

Bug Fixes

  • expose esm build as .mjs file (e0d517f)

v3.0.1

14 Dec 20:42
58f0602
Compare
Choose a tag to compare

3.0.1 (2022-12-14)

Bug Fixes

  • redis 4 adapter: ceil EXAT value (#18 - 58f0602)

    in order to fix ERR value is not an integer or out of range

    fixes #17

    Contributed by @TapaiBalazs

v3.0.0

24 Oct 11:15
ee13f13
Compare
Choose a tag to compare

3.0.0 (2022-10-24)

Bug Fixes

  • caches work on unknown data types (c3603b1)
  • rename swv to swr on CacheMetadata (b0558a5)

BREAKING CHANGES

  • CacheMetadata.swv has been renamed to CacheMetadata.swr
    for the most part this will be handled by the library
    (existing cache entries with swv will continue to work, only new ones will use swr)

    Migration:
    When you worked with CacheMetadata (for example in a custom cache adapter)
    you need to adapt your code to:

    1. write swr instead of swv
      👍 new: const metadata: CacheMetadata = { swr: 1000, /* ... */ }
      ⛔️ old: const metadata: CacheMetadata = { swv: 1000, /* ... */ }
    2. read using the staleWhileRevalidate helper
      👍 new: const staleMs = staleWhileRevalidate(metadata)
      ⛔️ old: const staleMs = metadata.swv
  • The Cache type is not generic anymore and always uses unknown 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.

v2.0.0

16 Oct 12:19
e7343d2
Compare
Choose a tag to compare

2.0.0 (2022-10-16)

Features

  • add adapters for redis 3 & 4 (2e78117)
  • drop official support for node@12 (e7343d2)

BREAKING CHANGES

  • the library is not anymore tested against node@12 there should not be any breaking changes now
    but might be introduced from now on

v1.3.3

02 Aug 11:34
94c3dcf
Compare
Choose a tag to compare

1.3.3 (2022-08-02)

Bug Fixes

  • allow falsy values in cache (94c3dcf)

v1.3.2

28 Jul 11:36
7261b35
Compare
Choose a tag to compare

1.3.2 (2022-07-28)

Bug Fixes

  • do not accidentally cache ttl: 0 entries forever (7261b35)
  • export assertCacheEntry and shouldRefresh (7e737ef)

v1.3.1

28 Jul 09:52
3189a40
Compare
Choose a tag to compare

1.3.1 (2022-07-28)

Bug Fixes

  • provide conditional exports (3189a40)