New serverless TypeScript tools I’m excited about

I’m a big fan of TypeScript and I think event-driven serverless apps in particular are an ideal candidate for type definitions. Being able to define and enforce a schema for an event which is published in one place and consumed (sync or async) in multiple other locations is a great benefit, making it much easier to refactor event flows without risking breaking something. Yes, infrastructure deployment frameworks such as the AWS CDK already use TypeScript, and while that’s nice, I’m more bullish about using TypeScript for runtime application code.

However, one area where type definitions currently fall down is with functionless integrations (which I recently wrote about here). Think VTL templates for AppSync/API Gateway or StepFunctions state machine definitions (using ASL) which directly connect two AWS services without an intermediate Lambda functions. I stated in my article that these domain-specific languages have poor tooling, putting off many developers and making it more difficult to quality check. Which was why I was very excited when I seen the announcement yesterday of a functionless TypeScript plugin from Sam Goodwin. This tool generates VTL and Step Functions ASL (coming soon) from a strongly-typed TypeScript function that you write. I know VTL is a deal-breaker for some folks considering using AppSync (I hate it too, but put up with it), so this may help increase adoption (at least until AWS decides to implement JavaScript resolvers for AppSync). I’m particularly interested in the StepFunctions ASL integration (which isn’t implemented yet), as I’ve talked to several folks who are apprehensive about even using Step Functions because they’re unfamiliar with ASL.

Sam (who is fast becoming the Serverless TypeScript Guy btw) also recently released another AWS TypeScript library, typesafe-dynamodb . It’s a type-only library that hooks into the AWS DynamoDB SDK and allows for strongly typed parameter and return payloads for the core DynamoDB operations based on the structure of your DynamoDB table items (which you specify as a TypeScript interface). I particularly like the Single Table Design feature which enforces specific prefixes on composite fields such as pk and sk. The library currently supports the DynamoDBClient (as of 2022-03-01) but has an open issue to add support for DocumentClient.

I’ve started maintaining a list of Typescript tools for serverless apps in my notes vault. If you have any suggestions, please let me know and I’ll add it in. And if you like these tools and have further suggestions, please let Sam know.

Join daily email list

I publish short emails like this on building software with serverless on a daily-ish basis. They’re casual, easy to digest, and sometimes thought-provoking. If daily is too much, you can also join my less frequent newsletter to get updates on new longer-form articles.

    View Emails Archive

    🩺
    Architecture & Process Review

    Built a serverless app on AWS, but struggling with performance, maintainability, scalability or DevOps practices?

    I can help by reviewing your codebase, architecture and delivery processes to identify risk areas and their causes. I will then recommend solutions and help you with their implementation.

    Learn more >>

    🪲 Testing Audit

    Are bugs in production slowing you down and killing confidence in your product?

    Get a tailored plan of action for overhauling your AWS serverless app’s tests and empower your team to ship faster with confidence.

    Learn more >>