typebridge icon indicating copy to clipboard operation
typebridge copied to clipboard

chore: standardize the aws-sdk v2 module import syntax

Open Eikix opened this issue 3 years ago • 0 comments

Resolves #16

Hi @fredericbarthelet ! As you mentioned, this PR will not affect lambdas cold start duration nor have any impact on performance. Its purpose is to spread awareness about the aws-sdk v2's unexpected behavior on imports.

To anyone wondering: when using the v2 of aws-sdk, one should not use imports at the root (e.g. import {EventBridge} from 'aws-sdk' but rather import EventBridge from 'aws-sdk/clients/eventbridge' ), as it does not perform tree-shaking and will therefore increase your bundle size by a lot.

Eikix avatar Apr 29 '22 14:04 Eikix