Choice of Javascript dependency injection library

Hello all,

Given the modularity and configurability we aim to achieve, we need to have a good library to define component interfaces, component implementations, and a way to bind them together.
And additional constraint, as we want to use typescript (see the type script proposal) as our language of choice, we want a dependency injection library compatible with that choice.

You can see the choice matrix on the design pages.

In addition, @ludovic used successfully Inversify on the prototype.
I also performed some small proof of concept on, Awilix, Injectionjs, and Tsyringe.

  • Awilix seems to be only working in a node environment (i.e., does not work on the browser)
  • Injectionjs and Tsyringe proved to be working as well as Inversify, but were not tried on the prototype

Inversify is by far the most popular alternative (10k stars on github vs between 1k and 4k stars for the others), but does not seems to be really active (latest release 2 years ago).
On the other hand, Tsyringe is still minimally active (small bugfixes and dependency upgrades) and is released regularly (last release 4 months ago).

In conclusion, while Inversify could be a good choice, but I suggest to perform a last test by using Tsyringe on the prototype before taking a final conclusion.

WDYT?

Thanks

Sounds good to do a test to look at Tsyringe and see if there would be something really better that would make us move from inversify. I’m +1 on inversify if there is nothing expectionnal for Tsyringe

I had a closer look at Tsyringe and couldn’t find any feature that would make us move.
Therefore, I suggest to finalize our choice to inversify