Skip to content

Commit

Permalink
Fix incorrect default devtools config (#11969)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jul 23, 2024
1 parent fa3487d commit 061cab6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-spoons-attack.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions .size-limits.json
Original file line number Diff line number Diff line change
@@ -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
}
5 changes: 1 addition & 4 deletions src/core/ApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,7 @@ export class ApolloClient<TCacheShape> 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) {
Expand Down

0 comments on commit 061cab6

Please sign in to comment.