1.2.0
Compile-time safety now covers the whole Koin DSL, and cross-module includes no longer hides definitions.
On Kotlin 2.4.20? Use 1.2.1. That Kotlin patch removed compiler APIs 1.2.0 depends on.
✨ Added
- Constructor-shorthand DSL is validated:
singleOf(::T),factoryOf(::T),scopedOf(::T),viewModelOf(::T)andScope.new(::T)get the same missing-dependency and qualifier checks assingle<T>(). Code that relied on an unchecked missing dependency here will now fail to compile. That is the gap closing, not a regression. - Two more entry points recognized:
KoinApplication.withConfiguration<T>()and Ktor'sinstall(Koin) { modules(...) }. startKoin { modules(myList) }resolves plain list compositions (listOf,+,.toList(), a function returningList<Module>). Runtime-branching lists (if/when, vararg) stay unresolved, andKOIN-W003now points at the call.fun myModule(): Module = module { ... }is tracked like a top-levelval.
🐛 Fixed
Cross-module visibility. Definitions two or more implementation dependency hops away were invisible and produced false KOIN-D001 errors:
@Module(includes = [...])(#82)@Configurationauto-discovery (default label)- DSL
module { includes(...) }, including through empty aggregator modules - Koin's plural
binds(...)was not recognized at all, onlybind
DSL validation:
@Module(includes)ignored qualifiers when merging definitions: two providers of one type under different@Namedcollapsed into one (#94)- Reified
bind<I>()insidewithOptions { }was silently dropped create(::function)never validated the function's parameters- Hand-written lambdas (
single { X(get()) }) could report a falseKOIN-D004cycle. Requirements are no longer guessed from the constructor; the lambda's ownget()calls are validated instead - A qualified requirement was read as unqualified across a module boundary
- Validation now defers instead of erroring when the module set is known to be incomplete
Also: a module including an incomplete submodule was wrongly marked complete, two DSL definitions of the same shape could crash class loading with a duplicate JVM signature, and lookups of module()/includes() are now cached (faster builds).
🔧 Changed
The Kotlin version warning fires per minor line instead of per patch, so 2.4.10 no longer warns. 1.2.1 reverts this, see its notes.
✅ Compatibility
- Koin 4.2.0+
- Kotlin 2.3.20 to 2.4.10 (2.4.20 needs 1.2.1)
📦 Install
plugins {
id("io.insert-koin.compiler.plugin") version "1.2.0"
}Thanks to @javichaques for #94 and to everyone who reported cross-module cases from real apps 🙏
Full changelog: 1.1.0...1.2.0