Nullish check devtools.enabled
Dev tools has a new syntax and deprecated the old connectToDevTools. However, the deprecation was implemented with || connectToDevTools instead of ?? connectToDevTools which results in devtools?.enabled to be overwritten by connectToDevTools for any falsy value. If connectToDevTools ends up being undefined, it overwrites false which then passes the guard on the next line erroneously and replaces the flag with __DEV__.
In our environment this transpiles down to globalThis.__DEV__ !== false and globalThis.__DEV__ is undefined so this effectively forces dev tools on even though we had devtools.enabled = false
@mgmolisani: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/
Deploy request for apollo-client-docs pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | b7d000d794d2f1444c45cb65dd81c0c3458e7eef |
✅ Docs Preview Ready
No new or changed pages found.
🦋 Changeset detected
Latest commit: b7d000d794d2f1444c45cb65dd81c0c3458e7eef
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @apollo/client | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Hey @mgmolisani 👋
Good catch! Would you mind adding a changeset to this PR? I'd be happy to merge and deploy this once that is in place.
Added changeset