Skip to content

question: Stage 3 decorator support (available since TS 5.0) #1178

Description

@intellix

I was trying to...

Use esbuild/swc to speed up compilation/build times and improve developer productivity and general experience

The problem:

typedi as far as I know currently uses and depends on reflect-metadata which was used for stage 2 decorator support. Since TypeScript 5.0 we've had stage 3 decorator support and as far as I know, that means you no longer need to rely on these two properties which esbuild states it does not support (https://esbuild.github.io/content-types/#no-type-system):

"emitDecoratorMetadata": true,
"experimentalDecorators": true,

I can see that trying to use the @Inject decorator in a constructor argument gives off a Decorators are not valid here.ts(1206) error:

constructor(@Inject(APP_CONFIG) appConfig) { ...}

Forgive my ignorance if I'm getting it all wrong and if it's supported today. If that's the case it would be helpful to display a notice explaining the support and how to achieve it (if so).

Potentially related: #783

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questionQuestions about the usage of the library.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions