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

Create a flatter dependency tree #1590

Closed
callmehiphop opened this issue Sep 12, 2016 · 7 comments
Closed

Create a flatter dependency tree #1590

callmehiphop opened this issue Sep 12, 2016 · 7 comments
Assignees
Labels

Comments

@callmehiphop
Copy link
Contributor

Relates to #1535

We recently received some feedback that our dependency tree is getting pretty large. Generally our advice has always been to either npm dedupe or upgrade to npm3, which does help a great deal. One thing I've noticed about deduping with npm2 is that we run into a lot of unavoidable conflicts around @google-cloud/common.

This leads me to believe that there are a few things we could probably do to create a flatter dependency tree. Here are a couple of ideas:

  • Moving parts of @google-cloud/common that don't change very often to a separate module. I'm mostly thinking of grpc related items. If common gets an unavoidable duplication error, then we might have multiple grpc installs, each of which contains roughly 4600 files.
  • Be more aggressive about keeping @google-cloud/common up to date in all packages. In this theory this would eliminate the unavoidable duplications we see.
@callmehiphop callmehiphop changed the title Create a smaller dependency tree Create a flatter dependency tree Sep 12, 2016
@stephenplusplus
Copy link
Contributor

Does 4600 files per gRPC release sound normal @murgatroid99?

@callmehiphop
Copy link
Contributor Author

That includes all files, package.json, .gitignore, markdown, etc.

@murgatroid99
Copy link

Yes, that sounds about right. That doesn't include most of the repository, but it does include the source files needed to build the module, including BoringSSL, which is about 1500 files.

That count also includes the dependencies, and node-pre-gyp (which we use to distribute precompiled binaries) has a surprisingly large dependency tree.

@micaww
Copy link

micaww commented Sep 13, 2016

I've also had issues with my containers not deploying on App Engine due to timeouts from npm install taking too long with google-cloud. Downgrading to gcloud works fine. I've had to switch to locally building the Docker image and uploading that way.

@micaww
Copy link

micaww commented Sep 13, 2016

@stephenplusplus thanks for the response. That was the issue. Unfortunately, deploying on App Engine using the runtime nodejs does not work because it installs an old npm/Node combination. I fixed this by creating my own Dockerfile deriving off of the Google base image and installing v5.10.1.

@stephenplusplus
Copy link
Contributor

We'll be releasing all of our sub-modules today, followed by the google-cloud umbrella package. Each sub-module will require the same version of grpc and, where applicable, google-gax. In general, we should try to use compatible version ranges across all of the sub-modules.

This should help improve the issues we've been seeing, however, it will still be required for users on npm < 3 to run npm dedupe to see the benefits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants