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

[Bug] [2h Timebox] Lambdas are including aws-cdk-lib in the bundle #260

Open
mattzcarey opened this issue Sep 7, 2023 · 1 comment
Open
Assignees

Comments

@mattzcarey
Copy link
Owner

mattzcarey commented Sep 7, 2023

Description:
Lambdas are pretty huge. They are obviously including lots of stuff which we shouldnt package in them. aws-cdk-lib is the obvious one. It is normally down to module resolution in commonjs.

Expected Outcomes:
Know what the issue is and the most pragmatic way to fix it.

@mattzcarey mattzcarey changed the title [Bug] Lambdas are including aws-cdk-lib in the bundle [Bug] [2h Timebox] Lambdas are including aws-cdk-lib in the bundle Sep 7, 2023
@mattzcarey mattzcarey added this to the v3 - SaaS enhancements milestone Sep 7, 2023
@April-Bates-Dev April-Bates-Dev self-assigned this Sep 13, 2023
@April-Bates-Dev
Copy link
Collaborator

April-Bates-Dev commented Sep 14, 2023

Actual outcomes:

These are the current sizes of our staging lambdas:
staging-get-user-lambda
9.8 MB
staging-update-user-lambda
9.9 MB
staging-demo-review-lambda
10.4 MB
staging-review-lambda
1.2 MB

This is big but not enormous. Options were explored for resolving this issue.

We are building the code in services/core using tsc. After an andon with Ryan, he suggested that if we built the code with esbuild, we can use this site to analyse which packages are making it into our production build. esbuild should also create a better build than tsc.

The follow up suggestion is therefore to use esbuild rather than tsc as our bundler, for both bundle size and observability.

Follow up ticket: https://github.com/users/mattzcarey/projects/1/views/1?pane=issue&itemId=38625966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Functional Review
Development

No branches or pull requests

2 participants