@apollo/client 3.10.0-rc.1 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/apollo-client.cjs +8 -3
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/core/core.cjs +1 -1
  6. package/core/core.cjs.map +1 -1
  7. package/core/core.cjs.native.js +1 -1
  8. package/dev/dev.cjs +1 -1
  9. package/dev/dev.cjs.map +1 -1
  10. package/dev/dev.cjs.native.js +1 -1
  11. package/link/core/types.d.ts +4 -1
  12. package/link/core/types.js.map +1 -1
  13. package/link/utils/createOperation.js.map +1 -1
  14. package/package.json +2 -2
  15. package/react/ssr/RenderPromises.js +10 -15
  16. package/react/ssr/RenderPromises.js.map +1 -1
  17. package/react/ssr/ssr.cjs +8 -15
  18. package/react/ssr/ssr.cjs.map +1 -1
  19. package/react/ssr/ssr.cjs.native.js +8 -15
  20. package/testing/internal/profile/Render.d.ts +1 -102
  21. package/testing/internal/profile/Render.js.map +1 -1
  22. package/utilities/caching/caches.d.ts +2 -2
  23. package/utilities/caching/caches.js +9 -4
  24. package/utilities/caching/caches.js.map +1 -1
  25. package/utilities/globals/globals.cjs +1 -1
  26. package/utilities/globals/globals.cjs.map +1 -1
  27. package/utilities/globals/globals.cjs.native.js +1 -1
  28. package/utilities/utilities.cjs +7 -2
  29. package/utilities/utilities.cjs.map +1 -1
  30. package/utilities/utilities.cjs.native.js +7 -2
  31. package/version.js +1 -1
  32. package/.changeset/chatty-llamas-switch.md +0 -5
  33. package/.changeset/cold-dancers-call.md +0 -5
  34. package/.changeset/green-garlics-protect.md +0 -5
  35. package/.changeset/hungry-bobcats-battle.md +0 -5
  36. package/.changeset/kind-foxes-float.md +0 -5
  37. package/.changeset/old-onions-sleep.md +0 -5
  38. package/.changeset/pre.json +0 -22
  39. package/.changeset/spotty-garlics-knock.md +0 -5
  40. package/.changeset/strong-paws-kneel.md +0 -5
  41. package/.changeset/stupid-bears-cheat.md +0 -5
  42. package/.changeset/tasty-pillows-ring.md +0 -5
  43. package/.changeset/tiny-bugs-tap.md +0 -5
  44. package/.changeset/twelve-apples-vanish.md +0 -5
  45. package/.changeset/wet-plants-admire.md +0 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#11792](https://github.com/apollographql/apollo-client/pull/11792) [`5876c35`](https://github.com/apollographql/apollo-client/commit/5876c35530a21473207954d1f0c2b7dd00c0b9ea) Thanks [@phryneas](https://github.com/phryneas)! - AutoCleanedCache: only schedule batched cache cleanup if the cache is full (fixes #11790)
8
+
9
+ - [#11799](https://github.com/apollographql/apollo-client/pull/11799) [`1aca7ed`](https://github.com/apollographql/apollo-client/commit/1aca7ed5a3accf2303ccdf9b3dece7278f03ad62) Thanks [@phryneas](https://github.com/phryneas)! - `RenderPromises`: use `canonicalStringify` to serialize `variables` to ensure query deduplication is properly applied even when `variables` are specified in a different order.
10
+
11
+ - [#11803](https://github.com/apollographql/apollo-client/pull/11803) [`bf9dd17`](https://github.com/apollographql/apollo-client/commit/bf9dd17b288f33901e9421bcc0eacb3894c087af) Thanks [@phryneas](https://github.com/phryneas)! - Update the `rehackt` dependency to `^0.1.0`
12
+
13
+ - [#11756](https://github.com/apollographql/apollo-client/pull/11756) [`60592e9`](https://github.com/apollographql/apollo-client/commit/60592e95399c3695d1d49a4c39ad29f00d4059fd) Thanks [@henryqdineen](https://github.com/henryqdineen)! - Fix operation.setContext() type
14
+
15
+ ## 3.10.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#11605](https://github.com/apollographql/apollo-client/pull/11605) [`e2dd4c9`](https://github.com/apollographql/apollo-client/commit/e2dd4c95290cea604b548cc446826d89aafe8e11) Thanks [@alessbell](https://github.com/alessbell)! - Adds `createMockFetch` utility for integration testing that includes the link chain
20
+
21
+ - [#11760](https://github.com/apollographql/apollo-client/pull/11760) [`acd1982`](https://github.com/apollographql/apollo-client/commit/acd1982a59ed66fc44fa9e70b08a31c69dac35a6) Thanks [@alessbell](https://github.com/alessbell)! - `createTestSchema` now uses graphql-tools `mergeResolvers` to merge resolvers instead of a shallow merge.
22
+
23
+ - [#11764](https://github.com/apollographql/apollo-client/pull/11764) [`f046aa9`](https://github.com/apollographql/apollo-client/commit/f046aa9fc24ac197a797045d280811a3bbe05806) Thanks [@alessbell](https://github.com/alessbell)! - Rename `createProxiedSchema` to `createTestSchema` and `createMockFetch` to `createSchemaFetch`.
24
+
25
+ - [#11777](https://github.com/apollographql/apollo-client/pull/11777) [`5dfc79f`](https://github.com/apollographql/apollo-client/commit/5dfc79fa6d974362f38361f7dffbe984a9546377) Thanks [@alessbell](https://github.com/alessbell)! - Call `createMockSchema` inside `createTestSchema`.
26
+
27
+ - [#11774](https://github.com/apollographql/apollo-client/pull/11774) [`2583488`](https://github.com/apollographql/apollo-client/commit/2583488677912cb4500e5fb9e3f91b5c113c4cdb) Thanks [@alessbell](https://github.com/alessbell)! - Add ability to set min and max delay in `createSchemaFetch`
28
+
29
+ - [#11605](https://github.com/apollographql/apollo-client/pull/11605) [`e2dd4c9`](https://github.com/apollographql/apollo-client/commit/e2dd4c95290cea604b548cc446826d89aafe8e11) Thanks [@alessbell](https://github.com/alessbell)! - Adds proxiedSchema and createMockSchema testing utilities
30
+
31
+ - [#11465](https://github.com/apollographql/apollo-client/pull/11465) [`7623da7`](https://github.com/apollographql/apollo-client/commit/7623da7720855b0c19e13ff9124679f426a39725) Thanks [@alessbell](https://github.com/alessbell)! - Add `watchFragment` method to the cache and expose it on ApolloClient, refactor `useFragment` using `watchFragment`.
32
+
33
+ - [#11743](https://github.com/apollographql/apollo-client/pull/11743) [`78891f9`](https://github.com/apollographql/apollo-client/commit/78891f9ec81c0b7a7e010f5550a91965fa33a958) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove alpha designation for `queryRef.toPromise()` to stabilize the API.
34
+
35
+ - [#11743](https://github.com/apollographql/apollo-client/pull/11743) [`78891f9`](https://github.com/apollographql/apollo-client/commit/78891f9ec81c0b7a7e010f5550a91965fa33a958) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove alpha designation for `createQueryPreloader` to stabilize the API.
36
+
37
+ - [#11783](https://github.com/apollographql/apollo-client/pull/11783) [`440563a`](https://github.com/apollographql/apollo-client/commit/440563ab2c47efcb9c7d08f52531ade33d753037) Thanks [@alessbell](https://github.com/alessbell)! - Moves new testing utilities to their own entrypoint, `testing/experimental`
38
+
39
+ ### Patch Changes
40
+
41
+ - [#11757](https://github.com/apollographql/apollo-client/pull/11757) [`9825295`](https://github.com/apollographql/apollo-client/commit/982529530893f66a1d236f0fff53862e513fc9a8) Thanks [@phryneas](https://github.com/phryneas)! - Adjust `useReadQuery` wrapper logic to work with transported objects.
42
+
43
+ - [#11771](https://github.com/apollographql/apollo-client/pull/11771) [`e72cbba`](https://github.com/apollographql/apollo-client/commit/e72cbba07e5caa6d75b44ca8c766846e855a6c93) Thanks [@phryneas](https://github.com/phryneas)! - Wrap `useQueryRefHandlers` in `wrapHook`.
44
+
45
+ - [#11754](https://github.com/apollographql/apollo-client/pull/11754) [`80d2ba5`](https://github.com/apollographql/apollo-client/commit/80d2ba579fe6d2a2d102d1fe79d7d503f31cd931) Thanks [@alessbell](https://github.com/alessbell)! - Export `WatchFragmentOptions` and `WatchFragmentResult` from main entrypoint and fix bug where `this` wasn't bound to the `watchFragment` method on `ApolloClient`.
46
+
3
47
  ## 3.10.0-rc.1
4
48
 
5
49
  ### Minor Changes
package/apollo-client.cjs CHANGED
@@ -31,7 +31,7 @@ function _interopNamespace(e) {
31
31
  var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
32
32
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
33
 
34
- var version = "3.10.0-rc.1";
34
+ var version = "3.10.1";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -265,6 +265,9 @@ function getFragmentFromSelection(selection, fragmentMap) {
265
265
 
266
266
  var scheduledCleanup = new WeakSet();
267
267
  function schedule(cache) {
268
+ if (cache.size <= (cache.max || -1)) {
269
+ return;
270
+ }
268
271
  if (!scheduledCleanup.has(cache)) {
269
272
  scheduledCleanup.add(cache);
270
273
  setTimeout(function () {
@@ -276,16 +279,18 @@ function schedule(cache) {
276
279
  var AutoCleanedWeakCache = function (max, dispose) {
277
280
  var cache = new caches.WeakCache(max, dispose);
278
281
  cache.set = function (key, value) {
282
+ var ret = caches.WeakCache.prototype.set.call(this, key, value);
279
283
  schedule(this);
280
- return caches.WeakCache.prototype.set.call(this, key, value);
284
+ return ret;
281
285
  };
282
286
  return cache;
283
287
  };
284
288
  var AutoCleanedStrongCache = function (max, dispose) {
285
289
  var cache = new caches.StrongCache(max, dispose);
286
290
  cache.set = function (key, value) {
291
+ var ret = caches.StrongCache.prototype.set.call(this, key, value);
287
292
  schedule(this);
288
- return caches.StrongCache.prototype.set.call(this, key, value);
293
+ return ret;
289
294
  };
290
295
  return cache;
291
296
  };