diff --git a/.changeset/early-spoons-attack.md b/.changeset/early-spoons-attack.md new file mode 100644 index 00000000000..fd674e2637b --- /dev/null +++ b/.changeset/early-spoons-attack.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": patch +--- + +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. diff --git a/.size-limits.json b/.size-limits.json index 3b2a83ce94c..25219697037 100644 --- a/.size-limits.json +++ b/.size-limits.json @@ -1,4 +1,4 @@ { - "dist/apollo-client.min.cjs": 40179, - "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32990 + "dist/apollo-client.min.cjs": 40164, + "import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32977 } diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index b9c5c7883fc..6070591ffd9 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -258,10 +258,7 @@ export class ApolloClient implements DataProxy { }; if (this.devtoolsConfig.enabled === undefined) { - this.devtoolsConfig.enabled = - typeof window === "object" && - (window as any).__APOLLO_CLIENT__ && - __DEV__; + this.devtoolsConfig.enabled = __DEV__; } if (ssrForceFetchDelay) {