You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It installs 145 packages and the node_modules directory is 36MB – so more than 10MB worth of deps for each client. Add a few more clients and you already have a pretty chunky Lambda function. This is getting close to the same size as the entire aws-sdk v2, with far fewer clients.
Looking into why it's so large, it seems that each module has a cjs and an es directory – presumably to cover both CommonJS and ESM modules in the one package. Each of these is quite large (eg, 3.4MB each for ssm) and includes a lot of duplicated code (eg a 1MB Aws_json1_1.js file)
Describe the solution you'd like
It would be great if the packages should be spilt into CJS and ESM modules. ESM support is native to Node.js from v12 onwards – so when v10 becomes EOL, this project could just stop adding features to the CJS modules without needing to bump to a new major version. People bundling their Lambdas using a bundler will likely be using the ESM versions too.
If that's too much of a burden, then it would be great to share configuration (eg JSON files) between implementations – it seems overkill to have completely separate implementations of purely configuration data – especially if this makes up the bulk of the size.
Describe alternatives you've considered
Another alternative is to remove Node.js v10 support altogether and only support ESM modules.
The text was updated successfully, but these errors were encountered:
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.
Is your feature request related to a problem? Please describe.
Related to #1536 – each module is twice the size than it needs to be because it bundles near-identical
cjs
andes
implementations.If I do a basic install of 3 clients, pretty typical for a small Lambda function:
It installs 145 packages and the node_modules directory is 36MB – so more than 10MB worth of deps for each client. Add a few more clients and you already have a pretty chunky Lambda function. This is getting close to the same size as the entire aws-sdk v2, with far fewer clients.
Looking into why it's so large, it seems that each module has a
cjs
and anes
directory – presumably to cover both CommonJS and ESM modules in the one package. Each of these is quite large (eg, 3.4MB each for ssm) and includes a lot of duplicated code (eg a 1MB Aws_json1_1.js file)Describe the solution you'd like
It would be great if the packages should be spilt into CJS and ESM modules. ESM support is native to Node.js from v12 onwards – so when v10 becomes EOL, this project could just stop adding features to the CJS modules without needing to bump to a new major version. People bundling their Lambdas using a bundler will likely be using the ESM versions too.
If that's too much of a burden, then it would be great to share configuration (eg JSON files) between implementations – it seems overkill to have completely separate implementations of purely configuration data – especially if this makes up the bulk of the size.
Describe alternatives you've considered
Another alternative is to remove Node.js v10 support altogether and only support ESM modules.
The text was updated successfully, but these errors were encountered: