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

Fix AWS dependencies - shrinks this package by 60% #576

Merged
merged 1 commit into from Jul 15, 2019

Conversation

Projects
None yet
3 participants
@pimterry
Copy link
Contributor

commented Jul 2, 2019

This package currently depends on aws-lambda, which depends on aws-sdk, which is a massive package (41MB, before dependencies).

This is only used in types.ts, which uses it only for type definitions. These don't exist at runtime (check out the empty compiled version in types.js), and aws-lambda is never actually used directly.

Unfortunately, aws-lambda is a production dependency of this package, and @types/aws-lambda is a development dependency, which means:

  • Every user of this package has to download aws-lambda & aws-sdk, and deploy it as part of their codebase (discussed in #436, but never fixed).
  • Every TypeScript user of this package has to manually install @types/aws-lambda for themselves to make it usable (see #485).

This PR fixes both together by swapping the dependencies around. Doing a quick local test, for me locally this reduces the installed size of this package from 72MB to 29MB, and fixes this TypeScript issue.

Fix AWS dependencies
@types/aws-lambda is actually required for TS usage of this
library, as those types are referenced. Since aws-lambda
isn't actually required at runtime though, the real dep
can be moved into dev dependencies, significantly shrinking
this package for all users.
@pimterry

This comment has been minimized.

Copy link
Contributor Author

commented Jul 5, 2019

Hey @maticzav, anything I can do to help get this merged? I'm using GraphQL-Yoga in a CLI application, and this is doubling the size of my distributable for my end users, and causing me all sorts of trouble.

@maticzav maticzav merged commit 844bdfd into prisma:master Jul 15, 2019

0 of 5 checks passed

Header rules Deploy failed
Details
Mixed content Deploy failed
Details
Pages changed Deploy failed
Details
Redirect rules Deploy failed
Details
deploy/netlify Deploy preview failed.
Details
@timsuchanek

This comment has been minimized.

Copy link
Member

commented Jul 15, 2019

🎉 This PR is included in version 1.18.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@pimterry

This comment has been minimized.

Copy link
Contributor Author

commented Jul 15, 2019

Amazing, that's super helpful, thank you @timsuchanek! 👍

@maticzav

This comment has been minimized.

Copy link
Collaborator

commented Jul 15, 2019

@pimterry thank you for creating the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.