node-ts / bus

A typescript based enterprise service bus framework based on enterprise integration patterns
https://bus.node-ts.com/
MIT License
270 stars 26 forks source link

decouple from inversify #64

Closed moltar closed 2 years ago

moltar commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 commented 3 years ago

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

rkingon commented 3 years ago

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

adenhertog commented 3 years ago

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:

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

adenhertog commented 2 years ago

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