Skip to content

Feature request: support for TypeScript non experimental decorators (Stage 3) #3085

Open
@WtfJoke

Description

@WtfJoke

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

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestThis item refers to a feature request for an existing or new utilitynext-major-versionon-holdThis item is on-hold and will be revisited in the future

    Type

    No type

    Projects

    Status

    On hold

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions