Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix incorrect default devtools config #11969

Merged
merged 5 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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