-
Notifications
You must be signed in to change notification settings - Fork 79
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
feat: use teeny-request
instead of deprecated request
dependency
#1590
base: main
Are you sure you want to change the base?
Conversation
@@ -20,6 +20,7 @@ | |||
"object-hash": "^3.0.0", | |||
"proto3-json-serializer": "^2.0.0", | |||
"retry-request": "^7.0.0", | |||
"teeny-request": "^9.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retry-request
since 7.0.0 itself already has a dependency on teeny-request
. So, we're not even introducing a new dependency here.
The documentation of retry-request
itself now also suggests to use teeny-request
and no longer rely on the deprecated request
@@ -22,6 +22,7 @@ const DEFAULTS = { | |||
Max # of retries | |||
*/ | |||
maxRetries: 2, | |||
request: require('teeny-request'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to keep the require
statement conditional, I could revert to doing this around line 44 in if (opts.request === undefined)
// eslint-disable-next-line node/no-unpublished-require | ||
opts.request = require('request'); | ||
} catch (e) { | ||
throw new Error('A request library must be provided to retry-request.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error will be thrown by retry-request
itself if opts.request is empty
Is anyone available to review the PR? @leahecole 🙏. It's blocking us for a while, Thanks! |
thanks for the ping! I want @sofisl to take a look at this first but Sofia, ping me if you want to chat about it |
Just had a brain blast, wasn't @danielbankhead doing work to migrate us from teeny-request to gaxios? Wondering if we may want to use that instead here. |
@leahecole yep! We will want to migrate away from both |
Since gaxios is used in auth, it won't make the package any bigger :) I think this is in the next phase of @danielbankhead's project so we should be working on it soon. As an FYI, I am planning on deprecating teeny and retry within the next few months, will put up a deprecation notice on the README to alert users long before we deprecate so that they can start preparing. |
Putting a do not merge on this given all of the shifting that's going on with |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #1584
This is my suggested fix to #1584. Having a dependency on
request
is not wise as it is deprecated and has security issues. But it also poses an issue with bundlers (such as webpack) that will try to includerequest
that is not installed in node_modules. Hence this solution with an explicit dependency toteeny-request