Skip to content

v3.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 24 Oct 11:15
· 103 commits to main since this release
ee13f13

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.