Skip to content

Conversation

khaledosman
Copy link
Contributor

@khaledosman khaledosman commented Oct 30, 2019

What did you implement

Better defaults and performance improvements for the aws-nodejs-typescript template.
Including:

  1. smaller bundle size in order to reduce the coldstart penalty as well as deployment times
  2. Improve overall developer experience with a faster typescript config
  3. Faster and smaller webpack build
  4. Enable Gzip compression for API responses by default for a faster API
  5. set AWS_NODEJS_CONNECTION_REUSE_ENABLED to 1 by default as a performance improvement to reuse http connections
  6. Add a vscode launch.json file for offline debugging through vscode with serverless-offline plugin

I left out the eslint setup as I didn't want to enforce a specific opinion and also to keep consistent with the other aws-nodejs template

Here are the build comparisons for the typical created app via the template, before this change and after.. The gains are even much more significant in a real world projects with more dependencies and files.

Before:
image (1)

After:
image (2)

aws-nodejs-typescript template
Closes #6874

How can we verify it

use sls create -t aws-nodejs-typescript
or manually go to the template, run npm install, then run sls webpack

Is this ready for review?: YES
Is it a breaking change?: NO

@pmuens pmuens added this to the 1.57.0 milestone Oct 31, 2019
@pmuens pmuens changed the title feat: aws-nodejs-typescript template improvements Feat: aws-nodejs-typescript template improvements Oct 31, 2019
Copy link
Contributor

@pmuens pmuens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @khaledosman 👍

I just tested it and it works as expected. LGTM :shipit:

@pmuens pmuens merged commit 6d57e04 into serverless:master Oct 31, 2019
@medikoo medikoo removed this from the 1.57.0 milestone Nov 6, 2019
@sapher
Copy link

sapher commented Nov 26, 2019

Just tried it on a fairly big project, it run very AMAZINGLY well

Capture d’écran 2019-11-27 à 10 55 31

Capture d’écran 2019-11-27 à 10 54 18

37 000% file size difference for the first file.

3410 % build speed increase

All of this come from a very little change. Amazing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update aws-nodejs-typescript template with better defaults

4 participants