inversify / InversifyJS

A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
http://inversify.io/
MIT License
11.34k stars 719 forks source link

suggestion: use node-introspect #24

Closed remojansen closed 8 years ago

remojansen commented 9 years ago

Consider using node-introspect as suggested by @orzarchi at https://github.com/inversify/InversifyJS/issues/23#issuecomment-149048155

remojansen commented 9 years ago

Hi @orzarchi thanks for your comments. I really worry when I have to add a run-time dependency to inversify because as you may have noticed it has no dependencies at the moment.

I'm not too worry about using node-introspect in node but I'm worry about increasing the size of inversify in the browser. How heavy is node-introspect?

Also I'm working on version 2.0 and it will use decorators and there will be some significant changes. I will keep you updated so you can take a look to how things work on the upcoming 2.0 version.

orzarchi commented 9 years ago

It's just a single function, seems perfect for you actually.

On Mon, Oct 19, 2015, 00:28 Remo H. Jansen notifications@github.com wrote:

Hi @orzarchi https://github.com/orzarchi thanks for your comments. I really worry when I have to add a run-time dependency to inversify because as you may have noticed it has no dependencies at the moment.

I'm not too worry about using node-introspect in node but I'm worry about increasing the size of inversify in the browser. How heavy is node-introspect?

Also I'm working on version 2.0 and it will use decorators and there will be some significant changes. I will keep you updated so you can take a look to how things work on the upcoming 2.0 version.

— Reply to this email directly or view it on GitHub https://github.com/inversify/InversifyJS/issues/24#issuecomment-149048729 .

remojansen commented 8 years ago

I've been keeping an eye for a while on the conversations about introspection and reflection and the community seems to not been able to agree for the moment on a standard. For the moment we are going to generate the metadata manually using decorators:

@inject("someDependency", "anotherDependency")

Instead of using reflection (or manual parsing) to get that metadata. We will use reflection or introspection once we find a official proposal.

Thanks for helping us to improve InversifyJS :smile:

orzarchi commented 8 years ago

Ended up writing my own small ioc container that uses reflection :) https://github.com/orzarchi/node-microioc