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

decouple from inversify #64

Closed
moltar opened this issue Apr 18, 2020 · 6 comments
Closed

decouple from inversify #64

moltar opened this issue Apr 18, 2020 · 6 comments

Comments

@moltar
Copy link

moltar commented Apr 18, 2020

It would be great if the library was decoupled from a specific IoC implementation.

Do you think something like that would be possible to refactor with the current setup?

Thanks!

@adenhertog
Copy link
Contributor

Hey @moltar sorry for the late reply! I agree and would like to tone down some of the opinions the library forces on consumers - especially around consumption of the internals.

Do you have any suggestions on a preferred approach? Personally I don't mind keeping inversify internally and offer consumers a generic set of IoC functions to interact with it (eg get, rebind etc). Is this what you had in mind?

@enko
Copy link

enko commented Jul 20, 2020

@adenhertog I'm currently in a similiar camp, as I am currently using typedi. I realy would want to use this package, but can't (or better not want to) introduce another DI framework to the stack.

routing-controllers allows you to introduce your own ioc container into the system. Maybe something like this would be possible for bus?

@manarhusrieh
Copy link
Contributor

I think this could be decoupled by exposing the following APIs to allow developer overriding functions for:

  • Adding new injection rule.
  • Getting new instance.
    And it can keep the default inversify implementation in the library as default implementation following this concept

@rkingon
Copy link

rkingon commented Aug 7, 2021

+1 would be great to be able to use within NestJS

@adenhertog
Copy link
Contributor

Just an update for anyone following this, removal of inversify is mostly done in https://github.com/node-ts/bus/tree/remove-inversify.

This is obviously a breaking change, and the following is being worked on prior to merge to master:

  • full test coverage
  • update all the documentation
  • integrate the alpha with a larger app to find any remaining issues

I can't commit to any timelines but hope to have this done in the next few weeks.

@adenhertog
Copy link
Contributor

This is now released in alpha and available at master. docs are at https://node-ts.gitbook.io/bus/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants