aws / aws/aws-lambda-roadmap

Feature- Node.js including .ts files when searching for handler

Ouverte
#63 1 commentaire 16 réactions 1 personne assignée Réclamée par @jtuliani Voir sur GitHub
Langage dominant
Aucune donnée de langage
Étoiles
196
Forks
5
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

**Note**
> * Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
> * Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do * not help prioritize the request
> If you are interested in providing additional feedback, please leave a comment

**Description**
Since Node v22.18.0 the node.js loader can load .ts files by default (and since V22.6.0 with the feature flag), that can already be utilized within lambdas.

The only issue is that file including handler still needs to be .{m,c}js file. So to harvest value from running TypeScript natively we need to do workarounds like having index.js file with following:
```javascript
import { handler } from 'actualIndexFile.ts';

export const handler = async (event, context) => await handler(event, context);
```

**Additional context**
* Since underlying Node.js loader is capable of handling the .ts files (from versions mentioned) it should hopefully be small change to also look for .{m,,c}ts files along .{m,c}js when looking for handler from Lambda command.
* Unless bundling is needed, running TypeScript natively provides values like no longer needing source-maps, moving compilation to validation stage of release, unifying tech-stack.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.