-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Release separate parts of the whole SDK to npm? #1093
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
Comments
Today, the bulk of the SDK is in the part that's shared among all the services. Each service increases the size by a range of about ~8KB - 40KB, which can certainly add up. Splitting up the SDK is a cool idea, and we're open to pull requests (realizing this would require the creation of multiple new packages.) I think to really take advantage of some tools' ability to perform "tree-shaking" to further reduce the footprint, the core of the SDK would need to be refactored as well, which would likely introduce breaking changes. Assuming you're using node.js, can you share your use-case for wanting to reduce the SDK's footprint? There are definitely some very valid reasons (less space on IoT devices, faster Lambda cold boots when using a custom SDK), I just want a better feel for where the demand is at in the node space. |
Our use-case is not that space-sensitive as IoTs or Lambdas, but we're counting each MB as well. We have an Electron app (with Node included) and we're uploading files to S3. |
@jakubzitny looks like this landed in |
@AdityaManohar really? Can you link related MR, commit, docs page or something? I looked into Readme and Changelog and couldn't find anything. Thanks. |
@jakubzitny Here are the relevant PRs: #1123, #1126. The CHANGELOG does seem to have an entry for @chrisradek |
@jakubzitny We didn't create new npm packages for all of the services, but we did enable importing individual services when bundling your code with a 3rd party tool. Are you using the AWS SDK from a renderer process or the main process? We're working on improving our docs around this now, but are happy to answer questions here in the meantime. |
@chrisradek Sorry for late response, thanks for the info and for implementing this. I don't really think it matters, but if it's any help to you, we ran this from renderer and we've alse been thinking about creating a special hidden |
@chrisradek Although you said that I could Import each service singularly. I am not able to use import S3 from 'aws-sdk/clients/s3'; Interestingly this works perfectly import AWS from 'aws-sdk'; |
I really wish all the ways of importing and using this SDK were documented in one single place, including small but complete examples. |
Googles doing it right...
Ironically the aws-sdk is what put us over the 262144000 bytes limit on Lambda after replacing S3 with GCStorage. |
@cantuket The Lambda execution environment comes with the aws-sdk pre-installed, so no need to include it in your bundle. You can install it in |
Thanks for pointing that out. Also, V3 of the SDK, now in Developer Preview, has been modularized solving for the originally requested issue here. |
In my lambda function, the total size of zip is 76.48MB(created on sls deploy function --function functionname) and aws-sdk is taking 57.3MB out of 76.48MB total. This big size is unabling me to deploy that function and also to add move feature to same package. if aws is putting such limit on functionUpdate operation they should look into their package also. |
Please check out js-sdk-v3 which has modular packages. Closing this issue now. |
Hey there.
Have you ever thought about / do you think you could / would it be possible to release separate working parts of the whole SDK, possibly configurable, e.g. separate AWS.S3, to NPM?
Similarly as it is possible to Build your own version of the AWS SDK for JavaScript at amazonaws.com, it would be cool to have it on NPM and programatically just connect the separate parts of the whole SDK. The whole SDK is quite large and most of the programmers are not using most of it anyway.
Would you be interested in collaboration on this?
The text was updated successfully, but these errors were encountered: