Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Releases: urql-graphql/urql-exchange-graphcache

v2.1.0

10 Jan 16:29
136f210
Compare
Choose a tag to compare

This release adds support for cache persistence which is bringing us one step closer to
full offline-support, which we hope to bring you soon.

It also allows wonka@^4.0.0 as a dependency to be compatible with [email protected]. It also fixes a couple of issues in our
new populateExchange.

  • Refactor internal store code and simplify Store (see #134)
  • ✨ Implement store persistence support (see #137)
  • ✨ Apply GC to store persistence (see #138)
  • Remove unused case where scalars are written from an API when links are expected (see #142)
  • ⚠️ Add support for resolvers causing cache misses (see #143)
  • ⚠️ Fix nested types (e.g. [Item!]!) in populateExchange (see #150)
  • Fix duplicate fragments in populateExchange output (see #151)
  • Allow wonka@^3.2.1||^4.0.0 to be used (see #153)

v2.0.0

12 Dec 16:42
f25882a
Compare
Choose a tag to compare

Note: The minimum required version of urql for this release is now 1.7.0!

Christmas came early! This version improves performance again by about 25% over 1.2.2. It also now ships with two new features: The populateExchange and automatic garbage collection.

Including the populateExchange is optional. It records all fragments in any active queries, and populates mutation selection sets when the @populate directive is used based on typenames. If your
schema includes viewer fields on mutations, which resolve back to your Query type, you can use this to automatically update your app's data when a mutation is made. (More documentation on this
is coming soon!)

The garbage collection works by utilising an automatic reference counting algorithm rather than a mark & sweep algorithm. We feel this is the best tradeoff to maintain good performance during runtime while minimising the data that is unnecessarily retained in-memory. You don't have to do anything! Graphcache will do its newly added magic in the background.

There are some breaking changes, if you're using cache.resolveConnections or resolveValueOrLink then you now need to use inspectFields and resolveFieldByKey instead. You may also now make use of cache.keyOfField. (More info on #128)

  • ✨ Implement populateExchange (eee #120)
  • Improve type safety of invariant and warning (see #121)
  • Reduce size of populateExchange (see #122)
  • Move more code to KVMap (see #125)
  • Move deletion to setting undefined instead (see #126)
  • Fix multiple edge cases in the relayPagination helper, by @rafeca (see #127)
  • ⚠️ Reimplement data structure and add garbage collection (see #128)
  • Use Closure Compiler (see #131)
  • Switch to using urql/core on 1.7.0 (see #132)

v1.2.2

21 Nov 11:01
bc5f75a
Compare
Choose a tag to compare

This patch replaces pessimism (our former underlying data structure) with a smaller implementation
that just uses Maps, since we weren't relying on any immutability internally. This cuts down
on bundlesize and massively on GC-pressure, which provides a large speedup on low-end devices.

  • Replace Pessimism with mutable store to prevent excessive GC work (see #117)

v1.2.1

19 Nov 17:03
30b6743
Compare
Choose a tag to compare
  • Fix viewer fields (which return Query types) not being written or read correctl (see #116)

v1.2.0

19 Nov 14:41
6411f3d
Compare
Choose a tag to compare
  • ⚠️ Fix unions not being checked supported by schema predicates, by @StevenLangbroek (see #113)
  • ✨ Add simplePagination helper for resolving simple, paginated lists (see #115)

v1.1.2

05 Nov 18:00
8831381
Compare
Choose a tag to compare
  • Fix relayPagination helper causing cache-misses for empty lists, by @rafeca (see #111)

v1.1.1

11 Oct 17:08
b1e86c5
Compare
Choose a tag to compare

This is a minor release since it increases the peer dependency of urql to >= 1.6.0, due to the addition
of the stale flag to partial responses and cache-and-network responses. This flag is useful to check
whether more requests are being made in the background by @urql/exchange-graphcache.

Additionally, this release adds a small stack to every error and warning that indicates where an
error has occured. It lists out the query and all subsequent fragments it has been traversing
so that errors and warnings can be traced more easily.

  • Add a query/fragment stack to all errors and warnings (see #107)
  • Add stale: true to all cache-and-network and partial responses (see #108)

v1.0.3

03 Oct 16:22
abde40f
Compare
Choose a tag to compare
  • Fix relayPagination helper merging pages with different field arguments (see #104)

v1.0.2

01 Oct 11:20
00cb40b
Compare
Choose a tag to compare
  • Deduplicate connections in Store.writeConnection when possible (see #103)
  • Fix early bail-out in relayPagination helper (see #103)

v1.0.1

30 Sep 16:12
Compare
Choose a tag to compare
  • Trims down the size by 100 bytes (see #96)
  • Include the /extras build in the published version (see #97)
  • Invariant and warnings will now have an error code associated with a more elabore explanation (see #99)
  • Invariant errors will now be included in your production bundle (see #100)
  • Fixes the relayPagination helper to correctly return partial results (see #101)
  • Add special case to relayPagination for first and last during inwards merge (see #102)