fix: export types independent of @types/request #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm not 100% if this is the right answer, but here we go. This change drops the dependency on
@types/request
, and exports its own set of types to be used by consuming clients.The primary reason for doing this comes from here:
googleapis/nodejs-common#392
@types/request
request
interfaces are directly exposed in public methods. As a result,@types/request
needed to be installed as adependency
instead of adevDependency
npm ls
, and see that a@types
package leaked into their production codeThe secondary reason is being explicit about which fields are supported and not supported. While the goal is compatibility with
request
, we have seen cases (like theforever
flag) where a feature was missing, but the types provided by@types/request
tell the user everything is fine. It would be nice to use the type system as a way to signal what is and isn't specifically supported.I can't really think of an alternative approach that doesn't lead to leaking these packages into production builds. Would love to hear others thoughts!
@ofrobots @benco @fhinkel @alexander-fenster @stephenplusplus @callmehiphop