Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
intellix opened this issue Aug 26, 2023 · 0 comments
Open

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

intellix opened this issue Aug 26, 2023 · 0 comments
Labels
type: question Questions about the usage of the library.

Comments

@intellix
Copy link

intellix commented Aug 26, 2023

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

@intellix intellix added the type: question Questions about the usage of the library. label Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Questions about the usage of the library.
Development

No branches or pull requests

1 participant