@apollo/client 3.11.0 → 3.11.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 3.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#11969](https://github.com/apollographql/apollo-client/pull/11969) [`061cab6`](https://github.com/apollographql/apollo-client/commit/061cab6627abd4ec81f83c40c1d281c418627c93) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove check for `window.__APOLLO_CLIENT__` when determining whether to connect to Apollo Client Devtools when `connectToDevtools` or `devtools.enabled` is not specified. This now simply checks to see if the application is in development mode.
8
+
9
+ - [#11971](https://github.com/apollographql/apollo-client/pull/11971) [`ecf77f6`](https://github.com/apollographql/apollo-client/commit/ecf77f6f5b5ccf64cfba51e838e96549fb6c92fe) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Prevent the `setTimeout` for suggesting devtools from running in non-browser environments.
10
+
3
11
  ## 3.11.0
4
12
 
5
13
  ### Potentially Breaking Fixes
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.11.0";
34
+ var version = "3.11.1";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -6977,10 +6977,7 @@ var ApolloClient = (function () {
6977
6977
  this.typeDefs = typeDefs;
6978
6978
  this.devtoolsConfig = tslib.__assign(tslib.__assign({}, devtools), { enabled: (devtools === null || devtools === void 0 ? void 0 : devtools.enabled) || connectToDevTools });
6979
6979
  if (this.devtoolsConfig.enabled === undefined) {
6980
- this.devtoolsConfig.enabled =
6981
- typeof window === "object" &&
6982
- window.__APOLLO_CLIENT__ &&
6983
- globalThis.__DEV__ !== false;
6980
+ this.devtoolsConfig.enabled = globalThis.__DEV__ !== false;
6984
6981
  }
6985
6982
  if (ssrForceFetchDelay) {
6986
6983
  setTimeout(function () { return (_this.disableNetworkFetches = false); }, ssrForceFetchDelay);
@@ -7031,41 +7028,42 @@ var ApolloClient = (function () {
7031
7028
  this.connectToDevTools();
7032
7029
  }
7033
7030
  ApolloClient.prototype.connectToDevTools = function () {
7034
- if (typeof window === "object") {
7035
- var windowWithDevTools = window;
7036
- var devtoolsSymbol = Symbol.for("apollo.devtools");
7037
- (windowWithDevTools[devtoolsSymbol] =
7038
- windowWithDevTools[devtoolsSymbol] || []).push(this);
7039
- windowWithDevTools.__APOLLO_CLIENT__ = this;
7031
+ if (typeof window === "undefined") {
7032
+ return;
7040
7033
  }
7034
+ var windowWithDevTools = window;
7035
+ var devtoolsSymbol = Symbol.for("apollo.devtools");
7036
+ (windowWithDevTools[devtoolsSymbol] =
7037
+ windowWithDevTools[devtoolsSymbol] || []).push(this);
7038
+ windowWithDevTools.__APOLLO_CLIENT__ = this;
7041
7039
  if (!hasSuggestedDevtools && globalThis.__DEV__ !== false) {
7042
7040
  hasSuggestedDevtools = true;
7043
- setTimeout(function () {
7044
- if (typeof window !== "undefined" &&
7045
- window.document &&
7046
- window.top === window.self &&
7047
- !window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__ &&
7048
- /^(https?|file):$/.test(window.location.protocol)) {
7049
- var nav = window.navigator;
7050
- var ua = nav && nav.userAgent;
7051
- var url = void 0;
7052
- if (typeof ua === "string") {
7053
- if (ua.indexOf("Chrome/") > -1) {
7054
- url =
7055
- "https://chrome.google.com/webstore/detail/" +
7056
- "apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
7041
+ if (window.document &&
7042
+ window.top === window.self &&
7043
+ /^(https?|file):$/.test(window.location.protocol)) {
7044
+ setTimeout(function () {
7045
+ if (!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {
7046
+ var nav = window.navigator;
7047
+ var ua = nav && nav.userAgent;
7048
+ var url = void 0;
7049
+ if (typeof ua === "string") {
7050
+ if (ua.indexOf("Chrome/") > -1) {
7051
+ url =
7052
+ "https://chrome.google.com/webstore/detail/" +
7053
+ "apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
7054
+ }
7055
+ else if (ua.indexOf("Firefox/") > -1) {
7056
+ url =
7057
+ "https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
7058
+ }
7057
7059
  }
7058
- else if (ua.indexOf("Firefox/") > -1) {
7059
- url =
7060
- "https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
7060
+ if (url) {
7061
+ globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
7062
+ "experience: %s", url);
7061
7063
  }
7062
7064
  }
7063
- if (url) {
7064
- globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
7065
- "experience: %s", url);
7066
- }
7067
- }
7068
- }, 10000);
7065
+ }, 10000);
7066
+ }
7069
7067
  }
7070
7068
  };
7071
7069
  Object.defineProperty(ApolloClient.prototype, "documentTransform", {