How to Use Source Maps in TypeScript Lambda Functions (with Benchmarks)

This page summarizes the projects mentioned and recommended in the original post on dev.to

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • node-source-map-support

    Adds source map support to node.js (for stack traces)

  • If we needed to enable Source Maps in a runtime that doesn't support the native version, we could always use Source Map Support.

  • serverless-graphql

    Serverless GraphQL Examples for AWS AppSync and Apollo

  • The Serverless Framework is known for its plugin system. serverless-esbuild brings bundling and all the options we need to support Source Maps in TypeScript into the sls package and sls deploy commands.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • lambda-sourcemaps

  • All example code is available on GitHub.

  • sst

    Build modern full-stack applications on AWS

  • Serverless Stack is a very cool value add that builds on top of AWS CDK delivering an awesome developer experience and dashboard. Unfortunately SST's own version of NodejsFunction, Function, doesn't support Source Maps or allow the passing of custom config options to esbuild. Hopefully this can be supported soon.

  • aws-lambda-builders

    Python library to compile, build & package AWS Lambda functions for several runtimes & framework

  • SAM support for TypeScript has been lagging for some time, but a pull request was just merged that should change that. It looks like we'll be able to add an aws_sam key in the package.json file to enable building within the SAM engine as part of sam build. Although this PR has been merged to aws-lambda-builders, the engine behind sam build, it will still need to be added to aws-sam-cli and released (to much fanfare, one expects) before it can be used with SAM.

  • esbuild

    An extremely fast bundler for the web

  • Emitting Source Maps is very easy with esbuild. We simply set the boolean property in our configuration. Now when we run the build, we'll get an index.js.map file as well as our index.js. This file must be uploaded to the Lambda service. We'll see how to do that with AWS CDK, AWS SAM and the Serverless Framework a bit later in this article.

  • aws-sam-cli

    CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM

  • SAM support for TypeScript has been lagging for some time, but a pull request was just merged that should change that. It looks like we'll be able to add an aws_sam key in the package.json file to enable building within the SAM engine as part of sam build. Although this PR has been merged to aws-lambda-builders, the engine behind sam build, it will still need to be added to aws-sam-cli and released (to much fanfare, one expects) before it can be used with SAM.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • architect

    The simplest, most powerful way to build a functional web app (fwa)

  • Alternately, use Architect. Architect is a 3rd party developer experience that builds on top of AWS SAM. Architect includes a TypeScript plugin.

  • plugin-typescript

    TypeScript custom runtime + workflow integration for Architect

  • Alternately, use Architect. Architect is a 3rd party developer experience that builds on top of AWS SAM. Architect includes a TypeScript plugin.

  • autocannon

    fast HTTP/1.1 benchmarking tool written in Node.js

  • I used autocannon to test the function at 100 concurrent executions for 30 seconds. I also used Lambda Power Tuning to find the ideal memory configuration, which proved to be 512MB. All the results are available.

  • aws-lambda-power-tuning

    AWS Lambda Power Tuning is an open-source tool that can help you visualize and fine-tune the memory/power configuration of Lambda functions. It runs in your own AWS account - powered by AWS Step Functions - and it supports three optimization strategies: cost, speed, and balanced.

  • I used autocannon to test the function at 100 concurrent executions for 30 seconds. I also used Lambda Power Tuning to find the ideal memory configuration, which proved to be 512MB. All the results are available.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • First Look at Lambda Powertools TypeScript

    11 projects | dev.to | 10 Jan 2022
  • Superpower REST API DX with Serverless ⚡ and DevOps Best Practices on AWS (🐍 Python Version)

    5 projects | dev.to | 30 Apr 2024
  • Turbocharge your Lambda Functions with AWS Lambda Powertools for Python

    1 project | dev.to | 25 Apr 2024
  • Billing for SaaS with EMF and CloudWatch Metric Streams

    1 project | dev.to | 8 Mar 2024
  • My first Experience with Powertools for AWS Lambda (TypeScript)

    2 projects | dev.to | 24 Dec 2023