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

Update ts-invariant and export setLogVerbosity from @apollo/client/core. #7226

Merged
merged 2 commits into from
Oct 26, 2020

Conversation

benjamn
Copy link
Member

@benjamn benjamn commented Oct 23, 2020

Now that our ts-invariant package allows configuration of logging verbosity for invariant.log, invariant.warn, and invariant.error, this PR re-exports that API from @apollo/client/core, so you can (for example) silence all warnings with the following code:

import { setLogVerbosity } from "@apollo/client";
setLogVerbosity("error");

If you want to silence errors as well, setLogVerbosity("silent") will do that. We don't currently use invariant.log anywhere, but we now have the freedom to be even more verbose with our logging, since invariant.log messages are hidden by default.

@benjamn benjamn added this to the Post 3.0 milestone Oct 23, 2020
@benjamn benjamn self-assigned this Oct 23, 2020
Comment on lines +2825 to +2830
"dependencies": {
"ts-invariant": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz",
"integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==",
"dev": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These outdated ts-invariant dependencies are all coming from graphql-tools, and all of them are "dev": true, so I don't think it will be a problem that the setLogVerbosity function has no effect on them.

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @benjamn - thanks!

@benjamn benjamn merged commit 1ec6bca into release-3.3 Oct 26, 2020
@benjamn benjamn deleted the export-setLogVerbosity-from-ts-invariant branch October 26, 2020 15:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants