Dependency injection in Kotlin just got much more precise and powerful.
𝗞𝗼𝗶𝗻 𝟰.𝟭 introduces major internal refactors, multiplatform upgrades and integrations tailored for real-world Kotlin projects — from Android to Ktor to Compose Multiplatform.
🧩 𝗪𝗵𝗮𝘁’𝘀 𝗶𝗻 𝘁𝗵𝗲 𝗿𝗲𝗹𝗲𝗮𝘀𝗲?
• 𝗖𝗼𝗻𝗳𝗶𝗴𝘂𝗿𝗮𝘁𝗶𝗼𝗻 𝗲𝘅𝘁𝗲𝗻𝘀𝗶𝗼𝗻: Reuse DI configs across environments with includes()
• 𝗥𝗲𝘀𝗼𝗹𝘃𝗲𝗿 𝗿𝗲𝗳𝗮𝗰𝘁𝗼𝗿𝗲𝗱: Now pluggable and extensible, enabling tighter integration with systems like Ktor
• 𝗦𝗰𝗼𝗽𝗲 𝗮𝗿𝗰𝗵𝗲𝘁𝘆𝗽𝗲𝘀: Simplified and safer scoping with built-in helpers for Activity, Fragment, ViewModel
• 𝘃𝗶𝗲𝘄𝗠𝗼𝗱𝗲𝗹𝗦𝗰𝗼𝗽𝗲(): Now handles lifecycle automatically using AutoCloseable
• 𝗖𝗼𝗻𝘀𝘁𝗿𝘂𝗰𝘁𝗼𝗿 𝗶𝗻𝗷𝗲𝗰𝘁𝗶𝗼𝗻: ViewModels now support scoped constructor injection via viewModelScopeFactory()
• 𝗩𝗲𝗿𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻 𝗮𝗽𝗶𝘀: Test and validate lazy modules and annotations with config.verify()
• 𝗔𝗻𝗻𝗼𝘁𝗮𝘁𝗶𝗼𝗻𝘀: Use @InjectedParam
and @Provided
to make contracts explicit
• 𝗖𝗼𝗺𝗽𝗼𝘀𝗲 𝟭.𝟴 support: Automatic context setup, no more KoinContext required
• 𝗣𝗿𝗲𝘃𝗶𝗲𝘄𝘀: Use KoinApplicationPreview
to mock and render DI-backed Composables
• 𝗞𝘁𝗼𝗿 𝟯.𝟮 𝗶𝗻𝘁𝗲𝗴𝗿𝗮𝘁𝗶𝗼𝗻: requestScope {}
and Ktor DI extension for resolution
• 𝗪𝗔𝗦𝗠 support: UUID and DI compatibility extended to Kotlin/WASM environments
🔮 𝗢𝗻 𝘁𝗵𝗲 𝗵𝗼𝗿𝗶𝘇𝗼𝗻: coroutine support, iOS shared components, and deeper Jetpack Navigation 3 integration.
Koin 4.1 brings safer defaults, broader multiplatform compatibility, and a cleaner mental model for how to structure your DI across app layers.
👉 Click here for more information about Koin 4.1.