@apollo/client 3.8.2 → 3.8.4

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 (67) hide show
  1. package/README.md +8 -6
  2. package/apollo-client.cjs +46 -37
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/config/jest/setup.js +10 -0
  6. package/config/jest/setup.js.map +1 -1
  7. package/core/ApolloClient.d.ts +1 -0
  8. package/core/ApolloClient.d.ts.map +1 -1
  9. package/core/ApolloClient.js +39 -35
  10. package/core/ApolloClient.js.map +1 -1
  11. package/core/QueryManager.d.ts +1 -1
  12. package/core/QueryManager.d.ts.map +1 -1
  13. package/core/QueryManager.js.map +1 -1
  14. package/core/core.cjs +40 -36
  15. package/core/core.cjs.map +1 -1
  16. package/core/core.cjs.native.js +40 -36
  17. package/dev/dev.cjs +7 -2
  18. package/dev/dev.cjs.map +1 -1
  19. package/dev/dev.cjs.native.js +7 -2
  20. package/package.json +30 -23
  21. package/testing/core/withConsoleSpy.d.ts.map +1 -1
  22. package/testing/core/withConsoleSpy.js.map +1 -1
  23. package/testing/internal/disposables/index.d.ts +3 -0
  24. package/testing/internal/disposables/index.d.ts.map +1 -0
  25. package/testing/internal/disposables/index.js +3 -0
  26. package/testing/internal/disposables/index.js.map +1 -0
  27. package/testing/internal/disposables/spyOnConsole.d.ts +10 -0
  28. package/testing/internal/disposables/spyOnConsole.d.ts.map +1 -0
  29. package/testing/internal/disposables/spyOnConsole.js +33 -0
  30. package/testing/internal/disposables/spyOnConsole.js.map +1 -0
  31. package/testing/internal/disposables/withCleanup.d.ts +3 -0
  32. package/testing/internal/disposables/withCleanup.d.ts.map +1 -0
  33. package/testing/internal/disposables/withCleanup.js +11 -0
  34. package/testing/internal/disposables/withCleanup.js.map +1 -0
  35. package/testing/internal/index.d.ts +3 -0
  36. package/testing/internal/index.d.ts.map +1 -0
  37. package/testing/internal/index.js +3 -0
  38. package/testing/internal/index.js.map +1 -0
  39. package/testing/internal/profile/Render.d.ts +140 -0
  40. package/testing/internal/profile/Render.d.ts.map +1 -0
  41. package/testing/internal/profile/Render.js +132 -0
  42. package/testing/internal/profile/Render.js.map +1 -0
  43. package/testing/internal/profile/index.d.ts +4 -0
  44. package/testing/internal/profile/index.d.ts.map +1 -0
  45. package/testing/internal/profile/index.js +2 -0
  46. package/testing/internal/profile/index.js.map +1 -0
  47. package/testing/internal/profile/profile.d.ts +55 -0
  48. package/testing/internal/profile/profile.d.ts.map +1 -0
  49. package/testing/internal/profile/profile.js +222 -0
  50. package/testing/internal/profile/profile.js.map +1 -0
  51. package/testing/internal/profile/traces.d.ts +3 -0
  52. package/testing/internal/profile/traces.d.ts.map +1 -0
  53. package/testing/internal/profile/traces.js +26 -0
  54. package/testing/internal/profile/traces.js.map +1 -0
  55. package/testing/matchers/ProfiledComponent.d.ts +8 -0
  56. package/testing/matchers/ProfiledComponent.d.ts.map +1 -0
  57. package/testing/matchers/ProfiledComponent.js +107 -0
  58. package/testing/matchers/ProfiledComponent.js.map +1 -0
  59. package/testing/matchers/index.js +3 -0
  60. package/testing/matchers/index.js.map +1 -1
  61. package/utilities/globals/globals.cjs +7 -2
  62. package/utilities/globals/globals.cjs.map +1 -1
  63. package/utilities/globals/globals.cjs.native.js +7 -2
  64. package/utilities/globals/invariantWrappers.d.ts.map +1 -1
  65. package/utilities/globals/invariantWrappers.js +6 -1
  66. package/utilities/globals/invariantWrappers.js.map +1 -1
  67. package/version.js +1 -1
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
- # <a href="https://www.apollographql.com/"><img src="https://user-images.githubusercontent.com/841294/53402609-b97a2180-39ba-11e9-8100-812bab86357c.png" height="100" alt="Apollo Client"></a>
1
+ <div align="center">
2
2
 
3
- ## Apollo Client
3
+ <p>
4
+ <a href="https://www.apollographql.com/"><img src="https://raw.githubusercontent.com/apollographql/apollo-client-devtools/main/assets/apollo-wordmark.svg" height="100" alt="Apollo Client"></a>
5
+ </p>
6
+ <h1>Apollo Client</h1>
4
7
 
5
- [![npm version](https://badge.fury.io/js/%40apollo%2Fclient.svg)](https://badge.fury.io/js/%40apollo%2Fclient)
6
- [![Build Status](https://circleci.com/gh/apollographql/apollo-client.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-client)
7
- [![Join the community](https://img.shields.io/discourse/status?label=Join%20the%20community&server=https%3A%2F%2Fcommunity.apollographql.com)](https://community.apollographql.com)
8
- [![Join our Discord server](https://img.shields.io/discord/1022972389463687228.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square)](https://discord.gg/graphos)
8
+ [![npm version](https://badge.fury.io/js/%40apollo%2Fclient.svg)](https://badge.fury.io/js/%40apollo%2Fclient) [![Build Status](https://circleci.com/gh/apollographql/apollo-client.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-client) [![Join the community](https://img.shields.io/discourse/status?label=Join%20the%20community&server=https%3A%2F%2Fcommunity.apollographql.com)](https://community.apollographql.com) [![Join our Discord server](https://img.shields.io/discord/1022972389463687228.svg?color=7389D8&labelColor=6A7EC2&logo=discord&logoColor=ffffff&style=flat-square)](https://discord.gg/graphos)
9
+
10
+ </div>
9
11
 
10
12
  Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components that fetch data via GraphQL.
11
13
 
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.8.2";
34
+ var version = "3.8.4";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -70,7 +70,12 @@ function wrap(fn) {
70
70
  for (var _i = 1; _i < arguments.length; _i++) {
71
71
  args[_i - 1] = arguments[_i];
72
72
  }
73
- fn.apply(void 0, tslib.__spreadArray([typeof message === "number" ? getErrorMsg(message) : message], args, false));
73
+ if (typeof message === "number") {
74
+ fn(getErrorMsg(message, args));
75
+ }
76
+ else {
77
+ fn.apply(void 0, tslib.__spreadArray([message], args, false));
78
+ }
74
79
  };
75
80
  }
76
81
  var invariant = Object.assign(function invariant(condition, message) {
@@ -6724,41 +6729,6 @@ var ApolloClient = (function () {
6724
6729
  this.mutate = this.mutate.bind(this);
6725
6730
  this.resetStore = this.resetStore.bind(this);
6726
6731
  this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);
6727
- if (connectToDevTools && typeof window === "object") {
6728
- var windowWithDevTools = window;
6729
- var devtoolsSymbol = Symbol.for("apollo.devtools");
6730
- (windowWithDevTools[devtoolsSymbol] =
6731
- windowWithDevTools[devtoolsSymbol] || []).push(this);
6732
- windowWithDevTools.__APOLLO_CLIENT__ = this;
6733
- }
6734
- if (!hasSuggestedDevtools && connectToDevTools && globalThis.__DEV__ !== false) {
6735
- hasSuggestedDevtools = true;
6736
- setTimeout(function () {
6737
- if (typeof window !== "undefined" &&
6738
- window.document &&
6739
- window.top === window.self &&
6740
- !window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {
6741
- var nav = window.navigator;
6742
- var ua = nav && nav.userAgent;
6743
- var url = void 0;
6744
- if (typeof ua === "string") {
6745
- if (ua.indexOf("Chrome/") > -1) {
6746
- url =
6747
- "https://chrome.google.com/webstore/detail/" +
6748
- "apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
6749
- }
6750
- else if (ua.indexOf("Firefox/") > -1) {
6751
- url =
6752
- "https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
6753
- }
6754
- }
6755
- if (url) {
6756
- globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
6757
- "experience: %s", url);
6758
- }
6759
- }
6760
- }, 10000);
6761
- }
6762
6732
  this.version = version;
6763
6733
  this.localState = new LocalState({
6764
6734
  cache: cache,
@@ -6794,7 +6764,46 @@ var ApolloClient = (function () {
6794
6764
  }
6795
6765
  : void 0,
6796
6766
  });
6767
+ if (connectToDevTools)
6768
+ this.connectToDevTools();
6797
6769
  }
6770
+ ApolloClient.prototype.connectToDevTools = function () {
6771
+ if (typeof window === "object") {
6772
+ var windowWithDevTools = window;
6773
+ var devtoolsSymbol = Symbol.for("apollo.devtools");
6774
+ (windowWithDevTools[devtoolsSymbol] =
6775
+ windowWithDevTools[devtoolsSymbol] || []).push(this);
6776
+ windowWithDevTools.__APOLLO_CLIENT__ = this;
6777
+ }
6778
+ if (!hasSuggestedDevtools && globalThis.__DEV__ !== false) {
6779
+ hasSuggestedDevtools = true;
6780
+ setTimeout(function () {
6781
+ if (typeof window !== "undefined" &&
6782
+ window.document &&
6783
+ window.top === window.self &&
6784
+ !window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {
6785
+ var nav = window.navigator;
6786
+ var ua = nav && nav.userAgent;
6787
+ var url = void 0;
6788
+ if (typeof ua === "string") {
6789
+ if (ua.indexOf("Chrome/") > -1) {
6790
+ url =
6791
+ "https://chrome.google.com/webstore/detail/" +
6792
+ "apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
6793
+ }
6794
+ else if (ua.indexOf("Firefox/") > -1) {
6795
+ url =
6796
+ "https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
6797
+ }
6798
+ }
6799
+ if (url) {
6800
+ globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
6801
+ "experience: %s", url);
6802
+ }
6803
+ }
6804
+ }, 10000);
6805
+ }
6806
+ };
6798
6807
  Object.defineProperty(ApolloClient.prototype, "documentTransform", {
6799
6808
  get: function () {
6800
6809
  return this.queryManager.documentTransform;