From ed64640ce8ba61136add0bdeb4094593e43535c5 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Mon, 22 Jul 2024 19:54:20 -0600 Subject: [PATCH 1/5] Ensure default devtools config does not rely on global client object --- src/core/ApolloClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index b9c5c7883fc..8691fc3fa9b 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -260,7 +260,7 @@ export class ApolloClient implements DataProxy { if (this.devtoolsConfig.enabled === undefined) { this.devtoolsConfig.enabled = typeof window === "object" && - (window as any).__APOLLO_CLIENT__ && + !(window as any).__APOLLO_CLIENT__ && __DEV__; } From 03d481ed28fd2f0d5f00b19ed40ea453bd92a0cc Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Mon, 22 Jul 2024 19:55:42 -0600 Subject: [PATCH 2/5] Add changeset --- .changeset/early-spoons-attack.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/early-spoons-attack.md diff --git a/.changeset/early-spoons-attack.md b/.changeset/early-spoons-attack.md new file mode 100644 index 00000000000..3a712f7dfa1 --- /dev/null +++ b/.changeset/early-spoons-attack.md @@ -0,0 +1,5 @@ +--- +"@apollo/client": patch +--- + +Fix issue with default devtools config that did not connect to devtools in development. From 7c86fd4ca714bdfacec273b6ad5875546fcf4690 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Tue, 23 Jul 2024 08:03:06 -0600 Subject: [PATCH 3/5] Simplify default devtools enabled by only checking __DEV__ --- src/core/ApolloClient.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index 8691fc3fa9b..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) { From 70edeaee974e5ea6fc5131ba5bbec670eea4fbbd Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Tue, 23 Jul 2024 08:05:25 -0600 Subject: [PATCH 4/5] Update changeset --- .changeset/early-spoons-attack.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/early-spoons-attack.md b/.changeset/early-spoons-attack.md index 3a712f7dfa1..fd674e2637b 100644 --- a/.changeset/early-spoons-attack.md +++ b/.changeset/early-spoons-attack.md @@ -2,4 +2,4 @@ "@apollo/client": patch --- -Fix issue with default devtools config that did not connect to devtools in development. +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. From f7d7b53721ed6bc0d8bbd390766ce9d72608968f Mon Sep 17 00:00:00 2001 From: jerelmiller Date: Tue, 23 Jul 2024 14:09:03 +0000 Subject: [PATCH 5/5] Clean up Prettier, Size-limit, and Api-Extractor --- .size-limits.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }