question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support TypeScript for backend functions

See original GitHub issue

Is your feature request related to a problem? Please describe.

I use the TypeScript generation features for my front-end client, but am frustrated that any of the Lambda functions I create via amplify add api or amplify add function must be written in vanilla JavaScript. This also makes it very difficult to share code between the backend and frontend (note that many of the auto-generated files created by amplify cli use syntax like export default blah that is invalid for use in the backend files).

Describe the solution you’d like

Switch to using tsc to compile the files found in amplify/backend/function/*/src/ so that we can opt-in to type-safety by changing our file extension from .js to .ts or .tsx, similar to how Create React App has handled this in version 2.0.0+.

Describe alternatives you’ve considered

Alternatively, add (or document) how we can hook into the build process for amplify/backend/function/* so we can inject a TypeScript transpilation step ourselves.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:138
  • Comments:36 (8 by maintainers)

github_iconTop GitHub Comments

10reactions
awjreynoldscommented, Jan 10, 2019

Really want this feature. I know I’m not adding much to the conversation but there needs to be options within the cli to scaffold typescript outputs for all aspects of an amplify solution.

5reactions
r0zarcommented, Nov 13, 2020

I’m actually against adding this functionality until Typescript is supported natively by AWS Lambda- hear me out…

The ideal scenario would be that typescript would be pushed up as is.

We’d then get type support directly inside the Lambda editor on the AWS Console.

It would also really suck to have Amplify spend time on this to then see Typescript support pop up in AWS Lambda.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use TypeScript on backend ? - GeeksforGeeks
How to use TypeScript on backend ? ; Prerequisites · Project Setup and Module Installation: ; Step 1: Run the following command in...
Read more >
How to build a backend app with TypeScript, Node.js, and ...
Hi there! At the end of this article you'll know how to create a simple and reliable back-end application you can use as...
Read more >
Is backend development in TypeScript a good idea? - Medium
One very popular use case for TypeScript on the backend is Serverless functions. These functions are usually fairly small and hence, don't require...
Read more >
An Introduction to TypeScript - INNOQ
TypeScript and Node seem to have a bad reputation amongst some backend developers although the language can be a perfect fit for many ......
Read more >
How to use TypeScript with Node.js - Section.io
Typescript supports these modern coding styles, such as static typing and type checking. It is made to build extensive and high-level ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found