Skip to content
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

Merged
merged 6 commits into from
Nov 11, 2024
Merged

Conversation

mgmolisani
Copy link
Contributor

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

@apollo-cla
Copy link

@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/

Copy link

netlify bot commented Oct 10, 2024

👷 Deploy request for apollo-client-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit b7d000d

@svc-apollo-docs
Copy link

svc-apollo-docs commented Oct 10, 2024

✅ Docs Preview Ready

No new or changed pages found.

Copy link

changeset-bot bot commented Oct 10, 2024

🦋 Changeset detected

Latest commit: b7d000d

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

@jerelmiller
Copy link
Member

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.

@mgmolisani
Copy link
Contributor Author

Added changeset

Copy link

pkg-pr-new bot commented Nov 11, 2024

npm i https://pkg.pr.new/@apollo/client@12093

commit: e8251d6

@jerelmiller jerelmiller merged commit 1765668 into apollographql:main Nov 11, 2024
30 of 32 checks passed
@github-actions github-actions bot mentioned this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants