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

Wasteful Package Size #2132

Closed
fishcharlie opened this issue Mar 13, 2021 · 8 comments
Closed

Wasteful Package Size #2132

fishcharlie opened this issue Mar 13, 2021 · 8 comments
Labels
feature-request New feature or enhancement. May require GitHub community feedback.

Comments

@fishcharlie
Copy link

Currently there is a lot of wasted package size. As an example the client-dynamodb package, includes files like tsconfig.json, DynamoDB.ts, etc.

Suggestions:

  • Add files property to package.json files
    • This will allow for TypeScript files to be omitted from downloads
  • Enable removeComments property for tsconfig.json files
    • This will remove source code comments and documentation from being included in compiled JavaScript files. Although a lot of these comments are documentation, and an argument could be made for keeping them because of that, the vast majority of users will be going to AWS specific documentation as opposed to the JavaScript source files.
  • Publish different versions for cjs & es
  • exclude package.json from tsconfig.json
  • Ideally the CHANGELOG could be reduced in size (or omitted from the package), but not sure how that would work exactly

These are just a few ideas.

I have the goal of getting dynamoose package size down as part of v3. Upgrading to v3 of the AWS-SDK helped a ton, but when I investigate further, I noticed these issues with the client-dynamodb package.

Ideally client-dynamodb wouldn't take up 53% of the package install: https://bundlephobia.com/result?p=dynamoose@3.0.0-alpha.1.

I think even just the files property would cut the client-dynamodb package size in half (about).

@trivikr
Copy link
Member

trivikr commented Mar 13, 2021

Related #1594

@ajredniwja ajredniwja added the feature-request New feature or enhancement. May require GitHub community feedback. label May 19, 2021
@trivikr
Copy link
Member

trivikr commented Sep 17, 2021

Tagging @fishcharlie as you had pointed out about install size of v3.

The AWS SDK for JavaScript team is working on reducing the install size of v3 further.
Please test or create issues on our experimental repo if you have questions/suggestions https://github.com/trivikr/temp-client-s3

@fishcharlie
Copy link
Author

@trivikr Sorry for the delay here. Haven't actually tried to install it, but looked through the code and changes and everything looks great!!

@trivikr
Copy link
Member

trivikr commented Oct 6, 2021

@trivikr Sorry for the delay here. Haven't actually tried to install it, but looked through the code and changes and everything looks great!!

Thank you @fishcharlie

We removed comments last week, and they were published in v3.35.0 which reduced npm publish sizes of all modular SDK packages from ~800 MB to ~750 MB:

This week, we'll release two new changes in v3.36.0 which will reduce npm publish sizes of all modular SDK packages to ~450 MB

@trivikr
Copy link
Member

trivikr commented Oct 6, 2021

  • Publish different versions for cjs & es

@fishcharlie Can you provide more info on how this can be done?

It would be awesome if we can retain the package names (say @aws-sdk/client-s3), and provide CJS/ES versions in some different way.

We're not considering publishing packages with different names (say @aws-sdk/client-s3-es and @aws-sdk/client-s3-cjs) right now.

@fishcharlie
Copy link
Author

Can you provide more info on how this can be done?

@trivikr

Other than the idea of publishing different package names, I'm honestly not sure. I haven't looked into it much, just seemed like a lot of duplication there that could be streamlined. But didn't look into it very much at all.

@trivikr
Copy link
Member

trivikr commented Oct 11, 2021

Closing this issue as we've implemented most suggestions.

Summary of 35% reduction in install size in tweet https://twitter.com/trivikram/status/1446596564969930753
We're writing a blog post on this work.

Ideally the CHANGELOG could be reduced in size (or omitted from the package), but not sure how that would work exactly

Created a separate feature request at #2888

  • Publish different versions for cjs & es

Created a separate feature request at #2889

@trivikr trivikr closed this as completed Oct 11, 2021
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request New feature or enhancement. May require GitHub community feedback.
Projects
None yet
Development

No branches or pull requests

3 participants