-
Notifications
You must be signed in to change notification settings - Fork 587
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
"Modularized packages" are still large #2765
Comments
@kyeotic The AWS SDK for JavaScript team is working on reducing the install size of v3. You can also share your additional comments/suggestions in this issue. |
@trivikr It seems you've already demonstrated the value of some of these suggestions, like not publishing source. When can we expect some of these learnings to make there way back into the AWS SDK v3? |
@trivikr I think another very valuable modularization would be to remove all the credentials detection out of these packages. If I want to use DynamoDB in a given context and already know where the credentials are and have access, 100-300kb of code designed to look in a dozen places is dead weight. For users that do want auto-detection they can of course pull in those packages in, but being able to omit them will see a significant size reduction for users that can do without. |
We are aiming to get these improvements published within a week or two. |
This is a great idea. We can experiment with dynamic import of credential providers only when credentials are not explicitly provided. We'll explore it. |
@trivikr If you're looking for install size improvements, then this would be the breaking change of making e.g. |
Closing this issue as the AWS SDK for JavaScript team has reduced install size by We've created a feature request for splitting |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
One of the goals of the SDKv3 was to provide modularized packages to reduce installation size. I believe this is currently a failed goal.
Your environment
Mac OS (should be the same on all OSes)
SDK version number
Is the issue in the browser/Node.js/ReactNative?
NodeJS
Steps to reproduce
Install the above packages for DynamoDB
Observed behavior
Install size is 24mb
Expected behavior
Install size is smaller
Screenshots
If applicable, add screenshots to help explain your problem.
Here is a disk-usage size and screenshot of all the sub-packages installed
For comparison, here is the entire AWS SDK v2
Just DynamoDB is 1/3 the size of the entire v2 SDK. You can get larger than the entire v2 SDK by including 4(!) packages if you pick the right ones.
Additional context
This problem seems to be three-fold
These problems are all recursive. Each package in
@aws-sdk
has them, so they appear in descendent dependencies. Just fixing 3️⃣ will drastically improve the bundle size as each layer will get smaller, providing an exponential decrease in total size.Fixing this will require a global approach to development across all packages. I understand that this is a tall order, but if modularized packages was the primary purpose for v3's architecture it is the only way to actually achieve meaningful results.
Recommendations:
es5
, see esm build targets es5 #2056package.json['files']
to limit published code to the compiled code (remove src code from the publish)The text was updated successfully, but these errors were encountered: