Hi all, figured here might be a good place to ask....
# functional
n
Hi all, figured here might be a good place to ask. I'm looking for a DI framework that satisfies the following constraints: 1. Doesn't use reflection (Don't want to deal with proguard nonsense more than nesecsary). 2. Compile-time validation of inject statements (I want to know before me code compiles if I try to inject something I haven't provided in a module). 3. Doesn't force you into using OO constructs (I want to be able to use injection in standalone functions and extension methods). Anything like this out there? Koin I think is the closest so far, satisfying 3 but not the others. Heck, I'd even take just 2 & 3 as long as the proguard config isn't too bad to set up and works well in practice without a lot of headaches. And of course context receivers probably solves all three, but they're not ready for production. Ditto for manual parameter passing, but my code-base is getting to the size where I am trying to ease the manual parameter passing burden a bit.
m
s
There is also this one, https://github.com/IVIanuu/injekt Which I think come pretty close to context receivers, or implicits in Scala. So requires less boilerplate than Dagger or kotlin-injekt. Disclaimer, I've not used this myself. I pretty much rely on custom wiring for now with Arrow's Resource for dependencies with lifecycle. https://github.com/nomisRev/ktor-arrow-example/blob/main/src/main/kotlin/io/github/nomisrev/env/Dependencies.kt