Skip to content

Increased esbuild bundle size on latest versions (v3.930.0+) due to tree-shaking & expression in object initializer key #7607

@vovkiv94

Description

@vovkiv94

Checkboxes for prior research

Describe the bug

While upgrading aws-sdk v3 clients from 3.806.0 to 3.957.0 in my project, I notices significant increase in bundle size. For example, in our case client-ec2 grew from 30kbs to 492kbs (all we use is EC2Client and 3 commands)

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/client-ec2@3.957.0,@aws-sdk/client-@3.957.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.19.6

Reproduction Steps

package.json
index.js

  1. Create a folder with these 2 files
  2. npm install & npm test
  3. Note client-ec2 size in the bundle (should be 25kbs)
  4. In package.json update: "@aws-sdk/client-ec2": "3.806.0" =>"@aws-sdk/client-ec2": "3.957.0"
  5. npm install & npm test
  6. Note client-ec2 size increase in the bundle (should be 485kbs)

Observed Behavior

Bundle sized significantly increased

Expected Behavior

Bundle sized should remain the same

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issueperformanceperformance regressionpotential-regressionMarking this issue as a potential regression to be checked by team memberthird-partyThis issue is related to third-party libraries or applications.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions