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
Guidance on using InversifyJS with bundlers and build tools that don't support emitDecoratorMetadata
#1493
Comments
Can someone from the core team or maintainers answer this? Im interested too. |
I'm not sure what is to say here. From my personal experience I haven't used |
@PodaruDragos what is odd to me is that it works with That's why we are asking what those limitations are, those features that won't work without |
I will have to look into this, but @notaphplover can probably have a good answer for this. |
I'll do my best @PodaruDragos. After having a look at the source code, this library only uses So, regarding the questions raised in the issue:
For build tools that don't support
Only https://github.com/inversify/InversifyJS/blob/master/wiki/classes_as_id.md Hope I answered to all your questions :) |
Thank you @notaphplover, I believe that does answer all my questions. It's been a little while since I looked at this project so let me see if I understand: Without Example with private _katana: Katana;
public constructor(katana: Katana) {
this._katana = katana;
} Example without private _katana: Katana;
public constructor(@inject(TYPES.Katana) katana: Katana) {
this._katana = katana;
} Along with the difference in how the dependencies are bound to their identifiers in the DI container: // with `emitDecoratorSupport`
container.bind<Katana>(Katana).to(Katana);
// versus without `emitDecoratorSupport`
container.bind<Katana>(TYPES.Katana).to(Katana); Does that sound right? Feel free to close the issue. |
Exactly @zzzachzzz, that's it |
The readme states:
It is a common scenario in web apps to use a bundler (Webpack, Rollup, ESbuild, etc.), either configured manually or through pre-configured dev environments (Vite, create-react-app), which may use a transpiler (Babel, SWC).
Most or all of these tools have limitations in what they can do with TypeScript.
ESbuild acknowledges it's lack of support for
emitDecoratorMetadata
:I know Babel is partially or fully capable of working around this limitation with various plugins.
The questions I hope to have answers to (preferably in the InversifyJS docs) are:
tsc
?The text was updated successfully, but these errors were encountered: