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
feat(Templates): Package lambdas individually in aws-nodejs-typescript
#10106
feat(Templates): Package lambdas individually in aws-nodejs-typescript
#10106
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10106 +/- ##
=======================================
Coverage 85.26% 85.26%
=======================================
Files 334 334
Lines 13638 13638
=======================================
Hits 11628 11628
Misses 2010 2010 Continue to review full report at Codecov.
|
Thanks! I'm wondering if this is something we want to have by default in the templates? Splitting the artifacts is usually a more advanced use case (not the one we want to use when getting started with serverless), right? |
@adriencaccia did some fact checking on this to make sure it is a good default to offer. Smaller lambda artifact has benefits on performance, wether your project includes a single lambda or a 1000. Multiple factors impact lambda artefact size: bundler, minifying the code, tree shaking dependencies, individual packaging, exclude specific dependencies from your build (like Individual packaging has impact as soon as your project includes at least 2 lambdas (so even simple use cases are affected). Packaging individually mainly impact build time on your machine before shipping artefacts. In order to ensure individual packaging does not impact badly packaging experience before deployment, and considering a project with 100 lambdas on average weighting in 3M, we have the following results: The key to have a good packaging experience when using individual packaging is to ensure I'd be in favor of having such configuration from the beginning, but maybe I'm missing something here. Do you know of any particular issue that might arise from individual packaging ? |
What I meant is that templates are meant to kickstart new users with serverless, so they should cover simpler use cases (and they should be simple to understand). I don't see a reason to make that specific template different from the others. And I understand the benchmark with 100 functions, but this isn't what new projects created from templates contain :p More generally, I think we could have the same discussion about any advanced feature (should it be part of the template or not). And I think the question boils down to:
I'd say packaging individually makes sense in some scenarios (users have many functions), it's not a universal feature (else I'd even argue it should be the Framework's default). |
After discussing it live with @fredericbarthelet, he managed to convince me 😄 To sum up: this change is a net improvement in all cases for that template specifically. More details:
As such, I'm 👍 with merging this, it's only an improvement for users. The only downside is a slight inconsistency with other templates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @adriencaccia 🙇
aws-nodejs-typescript
@adriencaccia One downer with this new template is that |
Opt for individual lambda packaging, resulting in: