You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
Reduce the number of transitive dependencies #1711
api: firestoreIssues related to the googleapis/nodejs-firestore API.needs more infoThis issue needs more information from the customer to proceed.priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
The package contains 79 direct/transitive dependencies, it would be nice if this number could be reduced!
While Firestore itself does not contain lots of dependencies GRPC/Protobuf and google-gax do pull in a few of those, which in itself contributes lots of transitive dependencies to this package and the firebase-admin package.
And especially when integrated into bigger projects this adds quite a bit of baggage to the project and more risk for security vulnerabilities (like longer chains to update vulnerable dependency versions).
Hi @IchordeDionysos. Thanks for pointing out this issue. Those dependencies you mention are hard dependencies and the Firestore SDK cannot function without them. If you have any suggestions then maybe we could discuss. But dropping those dependencies is not feasible.
Hey @dconeybe,
I understand the hard dependency on the libraries :) I'm a bit also trying to challenge the additional transitive libraries that are included in them!
For e.g. why use a package like arrify for such a simple task, when upstream it leads to yet another dependency to manage/install and potentially with security issues or a longer time until a critical security flaw is fixed in all downstream dependencies.
But one of the bigger questions I have is regarding transitive dependencies, why do I have to install yargs which is a tool that parses command-line arguments, when in reality this feature is NEVER used.
yargs is used by @grpc/proto-loader which is used by google-gax.
And the runScript function is only run when executed directly, so there is no reason to be pulled in when used with Firestore.
So I want to bring up this bigger question when a library is such a low-level Google library, all dependencies should be really carefully chosen as they lead up to a lot bigger dependency tree when composed into bigger end-user dependencies!
There are a ton of libraries there all owned and maintained by Google that I did not know where to start and file the issue, so I started here in the user-facing library, I would be happy if you could elevate and escalate the issue to other teams responsible for those packages.
You are right that the dependency on yargs looks to be unnecessary; however, that is a transitive dependency over which we, the maintainers of this repository, do not have control. Unfortunately, we cannot prioritize pruning transitive dependencies against our current priorities. If there is a direct dependency of this repository that you believe could be pruned or replaced with a lighter alternative then we can consider that; however, performing this optimization on our transitive dependencies is something we don't have bandwidth or sufficient demand to prioritize. Your motivation to undergo this exercise definitely makes sense and I apologize that we cannot help you. The specific example of yargs is something that you could bring up with the maintainers of @grpc/proto-loader directly and that improvement would be picked up when this repository upgrades its dependencies. I'm going to close this issue for now; however, if you have suggested/requested direct dependency changes of this repository then please open a new issue and, optionally, mention this issue in the new issue's description. Thank you for your time and feedback.
api: firestoreIssues related to the googleapis/nodejs-firestore API.needs more infoThis issue needs more information from the customer to proceed.priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
Activity
dconeybe commentedon Apr 26, 2022
Hi @IchordeDionysos. Thanks for pointing out this issue. Those dependencies you mention are hard dependencies and the Firestore SDK cannot function without them. If you have any suggestions then maybe we could discuss. But dropping those dependencies is not feasible.
IchordeDionysos commentedon Apr 28, 2022
Hey @dconeybe,
I understand the hard dependency on the libraries :) I'm a bit also trying to challenge the additional transitive libraries that are included in them!
For e.g. why use a package like
arrifyfor such a simple task, when upstream it leads to yet another dependency to manage/install and potentially with security issues or a longer time until a critical security flaw is fixed in all downstream dependencies.But one of the bigger questions I have is regarding transitive dependencies, why do I have to install
yargswhich is a tool that parses command-line arguments, when in reality this feature is NEVER used.yargsis used by@grpc/proto-loaderwhich is used bygoogle-gax.And looking at the usage of
yargsin the proto-loader you can see that it's only used in one spot in therunScriptfunction:https://github.com/grpc/grpc-node/blob/6847664da22dcaefb4cd0b93674c43e904d6b639/packages/proto-loader/bin/proto-loader-gen-types.ts
https://github.com/grpc/grpc-node/blob/6847664da22dcaefb4cd0b93674c43e904d6b639/packages/proto-loader/bin/proto-loader-gen-types.ts#L771
And the
runScriptfunction is only run when executed directly, so there is no reason to be pulled in when used with Firestore.So I want to bring up this bigger question when a library is such a low-level Google library, all dependencies should be really carefully chosen as they lead up to a lot bigger dependency tree when composed into bigger end-user dependencies!
There are a ton of libraries there all owned and maintained by Google that I did not know where to start and file the issue, so I started here in the user-facing library, I would be happy if you could elevate and escalate the issue to other teams responsible for those packages.
And
@google-cloud/storagehas again super different dependencies than Firestore it usesgaxiosvs.google-gax.http://npm.anvaka.com/#/view/2d/%2540google-cloud%252Fstorage
dconeybe commentedon May 17, 2022
You are right that the dependency on yargs looks to be unnecessary; however, that is a transitive dependency over which we, the maintainers of this repository, do not have control. Unfortunately, we cannot prioritize pruning transitive dependencies against our current priorities. If there is a direct dependency of this repository that you believe could be pruned or replaced with a lighter alternative then we can consider that; however, performing this optimization on our transitive dependencies is something we don't have bandwidth or sufficient demand to prioritize. Your motivation to undergo this exercise definitely makes sense and I apologize that we cannot help you. The specific example of yargs is something that you could bring up with the maintainers of
@grpc/proto-loaderdirectly and that improvement would be picked up when this repository upgrades its dependencies. I'm going to close this issue for now; however, if you have suggested/requested direct dependency changes of this repository then please open a new issue and, optionally, mention this issue in the new issue's description. Thank you for your time and feedback.