Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

I was sick of InversifyJS after 3 years in production, so I built a better DI container

DEV Community·Ayoub Chrigui·22 days ago
#Okhr7AjN
#comment#no#ioc#fullscreen#class#userservice
Reading 0:00
15s threshold

Three years. That's how long we ran InversifyJS in production at a medium-sized Typescript SaaS. It worked. But working and being good are two different things, and over time the frustration became impossible to ignore. Here's what that cost looked like for us, and what I built to get rid of it. The pain Manual registration, in a file nobody wants to touch InversifyJS requires you to bind every dependency manually in a central container file. In small projects this is fine. In a production SaaS with years of development behind it, it looks like this: That is line 1114. The file does not end there. Every new service, repository, or handler means opening this file, adding a line, and hoping nobody else is doing the same thing in a parallel branch. Because if they are, you have a merge conflict — and not a meaningful one. Not a conflict about logic or behavior. A conflict about a list of names. We dealt with conflicts on this file almost every merge.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More