-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nullish check devtools.enabled #12093
Conversation
@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
|
✅ Docs Preview ReadyNo new or changed pages found. |
🦋 Changeset detectedLatest commit: b7d000d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Co-authored-by: Jerel Miller <[email protected]>
commit: |
Dev tools has a new syntax and deprecated the old
connectToDevTools
. However, the deprecation was implemented with|| connectToDevTools
instead of?? connectToDevTools
which results indevtools?.enabled
to be overwritten byconnectToDevTools
for any falsy value. IfconnectToDevTools
ends up beingundefined
, it overwritesfalse
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
andglobalThis.__DEV__
isundefined
so this effectively forces dev tools on even though we haddevtools.enabled = false