@apollo/client 3.10.5 → 3.10.7

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 (76) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/apollo-client.cjs +16 -5
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.d.cts +1 -0
  6. package/cache/inmemory/writeToStore.d.ts +2 -2
  7. package/core/QueryManager.d.ts +1 -1
  8. package/core/core.cjs +1 -1
  9. package/core/core.cjs.map +1 -1
  10. package/core/core.cjs.native.js +1 -1
  11. package/core/core.d.cts +1 -0
  12. package/dev/dev.cjs +10 -2
  13. package/dev/dev.cjs.map +1 -1
  14. package/dev/dev.cjs.native.js +10 -2
  15. package/dev/dev.d.cts +1 -0
  16. package/errors/errors.d.cts +1 -0
  17. package/link/batch/batch.d.cts +1 -0
  18. package/link/batch-http/batch-http.d.cts +1 -0
  19. package/link/context/context.d.cts +1 -0
  20. package/link/core/core.d.cts +1 -0
  21. package/link/error/error.d.cts +1 -0
  22. package/link/http/http.d.cts +1 -0
  23. package/link/http/iterators/nodeStream.d.ts +0 -1
  24. package/link/persisted-queries/persisted-queries.d.cts +1 -0
  25. package/link/remove-typename/remove-typename.d.cts +1 -0
  26. package/link/retry/retry.d.cts +1 -0
  27. package/link/schema/schema.d.cts +1 -0
  28. package/link/subscriptions/subscriptions.d.cts +1 -0
  29. package/link/utils/utils.d.cts +1 -0
  30. package/link/ws/ws.d.cts +1 -0
  31. package/package.json +5 -3
  32. package/react/components/components.d.cts +1 -0
  33. package/react/context/context.d.cts +1 -0
  34. package/react/hoc/hoc-utils.d.ts +0 -1
  35. package/react/hoc/hoc.d.cts +1 -0
  36. package/react/hooks/hooks.cjs +3 -1
  37. package/react/hooks/hooks.cjs.map +1 -1
  38. package/react/hooks/hooks.cjs.native.js +3 -1
  39. package/react/hooks/hooks.d.cts +1 -0
  40. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +0 -1
  41. package/react/hooks/internal/useLazyRef.d.ts +0 -1
  42. package/react/hooks/useMutation.js +2 -1
  43. package/react/hooks/useMutation.js.map +1 -1
  44. package/react/internal/internal.cjs +10 -2
  45. package/react/internal/internal.cjs.map +1 -1
  46. package/react/internal/internal.cjs.native.js +10 -2
  47. package/react/internal/internal.d.cts +1 -0
  48. package/react/parser/parser.d.cts +1 -0
  49. package/react/react.d.cts +1 -0
  50. package/react/ssr/ssr.d.cts +1 -0
  51. package/testing/core/core.d.cts +1 -0
  52. package/testing/experimental/createSchemaFetch.d.ts +0 -1
  53. package/testing/experimental/experimental.d.cts +1 -0
  54. package/testing/internal/disposables/disableActWarnings.d.ts +0 -1
  55. package/testing/internal/disposables/spyOnConsole.d.ts +0 -2
  56. package/testing/internal/disposables/withCleanup.d.ts +0 -1
  57. package/testing/internal/profile/Render.d.ts +0 -1
  58. package/testing/internal/profile/Render.js +2 -2
  59. package/testing/internal/profile/Render.js.map +1 -1
  60. package/testing/testing.d.cts +1 -0
  61. package/utilities/common/canUse.js +3 -2
  62. package/utilities/common/canUse.js.map +1 -1
  63. package/utilities/globals/globals.cjs +10 -2
  64. package/utilities/globals/globals.cjs.map +1 -1
  65. package/utilities/globals/globals.cjs.native.js +10 -2
  66. package/utilities/globals/globals.d.cts +1 -0
  67. package/utilities/globals/invariantWrappers.js +9 -1
  68. package/utilities/globals/invariantWrappers.js.map +1 -1
  69. package/utilities/subscriptions/relay/relay.d.cts +1 -0
  70. package/utilities/subscriptions/shared.d.ts +1 -1
  71. package/utilities/subscriptions/urql/urql.d.cts +1 -0
  72. package/utilities/utilities.cjs +3 -2
  73. package/utilities/utilities.cjs.map +1 -1
  74. package/utilities/utilities.cjs.native.js +3 -2
  75. package/utilities/utilities.d.cts +1 -0
  76. package/version.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.10.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#11901](https://github.com/apollographql/apollo-client/pull/11901) [`10a8c0a`](https://github.com/apollographql/apollo-client/commit/10a8c0a8f6f3e13ec3c67bf53cc11a948b60e6d9) Thanks [@phryneas](https://github.com/phryneas)! - update `canUseLayoutEffect` check to also allow for layout effects in React Native
8
+
9
+ - [#11861](https://github.com/apollographql/apollo-client/pull/11861) [`1aed0e8`](https://github.com/apollographql/apollo-client/commit/1aed0e82fcc432380a56d4a446f414ce8b1a7a90) Thanks [@henryqdineen](https://github.com/henryqdineen)! - Defend against non-serializable params in `invariantWrappers`
10
+
11
+ - [#11905](https://github.com/apollographql/apollo-client/pull/11905) [`29755da`](https://github.com/apollographql/apollo-client/commit/29755da8797dc94613a23fe050ddd6ef9ffab607) Thanks [@phryneas](https://github.com/phryneas)! - Add `.d.cts` files for cjs bundles
12
+
13
+ - [#11906](https://github.com/apollographql/apollo-client/pull/11906) [`d104759`](https://github.com/apollographql/apollo-client/commit/d104759cfb4be31e2ffbe166531a9b11861ade99) Thanks [@phryneas](https://github.com/phryneas)! - chore: update TypeScript to 5.5
14
+
15
+ ## 3.10.6
16
+
17
+ ### Patch Changes
18
+
19
+ - [#11900](https://github.com/apollographql/apollo-client/pull/11900) [`f745558`](https://github.com/apollographql/apollo-client/commit/f74555826995009a6bb9d824506cecb3508e3365) Thanks [@phryneas](https://github.com/phryneas)! - `useMutation`: use `useIsomorphicLayoutEffect` instead of `useLayoutEffect`
20
+
3
21
  ## 3.10.5
4
22
 
5
23
  ### Patch 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.5";
34
+ var version = "3.10.7";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -106,7 +106,15 @@ function newInvariantError(message) {
106
106
  }
107
107
  var ApolloErrorMessageHandler = Symbol.for("ApolloErrorMessageHandler_" + version);
108
108
  function stringify(arg) {
109
- return typeof arg == "string" ? arg : (stringifyForDisplay(arg, 2).slice(0, 1000));
109
+ if (typeof arg == "string") {
110
+ return arg;
111
+ }
112
+ try {
113
+ return stringifyForDisplay(arg, 2).slice(0, 1000);
114
+ }
115
+ catch (_a) {
116
+ return "<non-serializable>";
117
+ }
110
118
  }
111
119
  function getHandledErrorMsg(message, messageArgs) {
112
120
  if (messageArgs === void 0) { messageArgs = []; }
@@ -184,15 +192,16 @@ function getInclusionDirectives(directives) {
184
192
  return result;
185
193
  }
186
194
 
195
+ var isReactNative = maybe(function () { return navigator.product; }) == "ReactNative";
187
196
  var canUseWeakMap = typeof WeakMap === "function" &&
188
- !maybe(function () { return navigator.product == "ReactNative" && !global.HermesInternal; });
197
+ !(isReactNative && !global.HermesInternal);
189
198
  var canUseWeakSet = typeof WeakSet === "function";
190
199
  var canUseSymbol = typeof Symbol === "function" && typeof Symbol.for === "function";
191
200
  var canUseAsyncIteratorSymbol = canUseSymbol && Symbol.asyncIterator;
192
201
  var canUseDOM = typeof maybe(function () { return window.document.createElement; }) === "function";
193
202
  var usingJSDOM =
194
203
  maybe(function () { return navigator.userAgent.indexOf("jsdom") >= 0; }) || false;
195
- var canUseLayoutEffect = canUseDOM && !usingJSDOM;
204
+ var canUseLayoutEffect = (canUseDOM || isReactNative) && !usingJSDOM;
196
205
 
197
206
  function isNonNullObject(obj) {
198
207
  return obj !== null && typeof obj === "object";
@@ -7421,6 +7430,8 @@ function useDeepMemo(memoFn, deps) {
7421
7430
  return ref.current.value;
7422
7431
  }
7423
7432
 
7433
+ var useIsomorphicLayoutEffect = canUseDOM ? React__namespace.useLayoutEffect : React__namespace.useEffect;
7434
+
7424
7435
  var Ctx;
7425
7436
  function noop() { }
7426
7437
  function useRenderGuard() {
@@ -7845,7 +7856,7 @@ function useMutation(mutation, options) {
7845
7856
  mutation: mutation,
7846
7857
  options: options,
7847
7858
  });
7848
- React__namespace.useLayoutEffect(function () {
7859
+ useIsomorphicLayoutEffect(function () {
7849
7860
  Object.assign(ref.current, { client: client, options: options, mutation: mutation });
7850
7861
  });
7851
7862
  var execute = React__namespace.useCallback(function (executeOptions) {