Open
Description
Use case
We use Tracers functionality to capture class methods using decorators as described in the docs.
Typescript 5.0+ has official (non experimental) support for decorators.
However as soon as we remove the tsconfig.json flag experimentalDecorators
(or set it to false) we get compile errors:
error TS1241: Unable to resolve signature of method decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 3.
34 @tracer.captureMethod()
~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@aws-lambda-powertools/tracer/lib/esm/types/Tracer.d.ts:100:100
100 type MethodDecorator<T extends AnyClass> = (target: InstanceType<T>, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<AnyClassMethod>) => void;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An argument for 'descriptor' was not provided.
Solution/User Experience
It would be great if we have support for non experimental decorators so we can remove outdated decorators functionality.
Alternative solutions
No response
Acknowledgment
- This feature request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
On hold