Repository navigation
1.2.2
Compile safety on Kotlin/Native and wasm/JS now sees your whole graph, and multi-module projects get far fewer false errors.
✨ Added
- Hidden dependency check (opt-in):
koinCompiler { hiddenDependencyCheck = "warning" }(or"error") lists the modules that thestartKoinmodule reaches only through a transitiveimplementationdependency, so compile safety can't fully check them. JVM and Android.
🐛 Fixed
- Native, wasm and JS: definitions from another Gradle module were invisible to compile safety. You got a false
KOIN-D002, or a real missing dependency passed the build (#105, #106, #113). If you turnedcompileSafetyoff for these targets, turn it back on. - False
KOIN-D001/KOIN-D004across modules: on DSL parameters that need no provider (default value, nullable,List<T>,Lazy<T>,@InjectedParam,@Property,@Provided,@ScopeId) (#115), on qualified function providers (#96), on a@Single funprovider two modules away (#114), and on a DSL module from another Gradle module loaded bystartKoin<MyApp>(#124,singleonly for now:factoryandscopedstill need@Provided). @Single(binds = [X::class])on a class from another module lost its binding: falseKOIN-D001, andgetAll<X>()empty at runtime (#98).- False
KOIN-W001/KOIN-D002: after moving a module to another package, onincludes()chains of 3+ modules, on a module returned by a function, and on aKoinbuilt elsewhere (#58). FalseKOIN-D006onactivityViewModel<T>()(#121). - Crashes: "No classId" on local classes and anonymous objects (#101), invalid IR when a definition in another module targets an
internalclass (#74), Kotlin daemon out of memory on multi-module builds (#110). - Configuration cache is no longer thrown away on every Kotlin edit.
🔧 Changed
- More of your graph is checked: a green build can now fail on a real missing dependency.
- Explicit
bindsacross modules: the class is bound to exactly itsbinds, as within one module (#98). - strictSafety:
strictSafety = falseis honored on thestartKoinmodule, with a warning (#120), andstrictSafetyForceOffis deprecated. AGP 9 modules are now detected. WithcompileSafety = false, it no longer scans or logs (#88). - New warnings
KOIN-W008toKOIN-W011: module definitions not visible, a call on your ownKoin,activityViewModel<T>()withoutparametersOf(), a module chosen at runtime. They failallWarningsAsErrorsbuilds. - KMP libraries with
apiCheck: runapiDumponce for the neworg.koin.plugin.hintsentries. Libraries built with 1.1.0 to 1.2.1: rebuild them with 1.2.2 to get the #96 fix.
✅ Compatibility
- Koin 4.2.0+
- Kotlin 2.3.20, 2.4.0, 2.4.10, 2.4.20
📦 Install
plugins {
id("io.insert-koin.compiler.plugin") version "1.2.2"
}Thanks
@PhBogdanov traced the KLIB root cause down to the Kotlin serializer across four Kotlin versions (#106), and found and fixed the daemon memory leak (#111). @shreknitin89 (#116), @cpaleop (#90) and @paulnunezm (#128) sent fixes this release builds on.
Thanks to everyone who reported, reproduced and retested: @acmpo6ou, @af-jul, @ahmedhappa, @alexandru-calinoiu, @andrew-turner-control4, @aoreshkov, @axiel7, @brueggenthies-adesso, @dakatso, @dmitry-stakhov, @emartynov, @exoego, @Faltenreich, @GoodSir42, @hmy65, @ikurek, @imcmib, @JajaComp, @jamesarich, @kfaraj, @Komdosh, @MattSkala, @nabiu256, @nagatsuka-shuuya, @oscardavison, @PhilippNowak96, @renaudmathieu, @sanders9, @smartine-ledger, @stzouvaras, @tylerwilson, @VladimirPupavaESET, @xephosbot, @yaroslav-v and @zjarlin.
Your feedback is welcome 🙏
Full changelog: 1.2.1...1.2.2