4.2.0-beta3
⚠️ ViewModelScope Declaration Requirement Updated
Experimental Feature: The automatic scope creation for ViewModel constructor injection now requires ViewModel declarations to be part of the viewModelScope section. If declared outside, injection will look in the root scope instead of the ViewModel scope, causing resolution failures.
// Injection against root scope
viewModel { MyViewModel(get()) }
// Injection against viewModel scope
viewModelScope {
viewModel { MyViewModel(get()) }
}Koin Compiler Plugin Support API
New Plugin Support API for Koin Annotations compiler plugin integration:
- ModuleExt - Module extensions for plugin-generated code
- CreateDSL - DSL for plugin code generation
- BaseDSLExt - Base DSL extensions
- ApplicationDSLExt - Application-level DSL extensions
- ViewModelDSLExt / ViewModelModuleExt - ViewModel support for plugin
- WorkerDSLExt / WorkerModuleExt - Android Worker support for plugin
Bug Fixes
- Fix CoreResolution with Child Scopes / ViewModelScope - #2325 by @arnaudgiuliani in #2340
- Fix CoreResolverV2.kt to handle injected params first - #2337 by @arnaudgiuliani in #2341
- Fix WASM qualified name resolution - #2312 by @arnaudgiuliani in #2344
- Fix sharedKoinViewModel fails with type-safe navigation routes by @nazaburo in #2293
- Fix CoreResolverV2 stack params propagation by @arnaudgiuliani (9d6cf10)
- Fix worker/viewModel builder API - qualifier now properly passed to worker by @arnaudgiuliani (43ecac9)
- Fix Scope Archetypes Qualifier in plugin support functions by @arnaudgiuliani (f972c52)
- Fix scope resolution in plugin by @arnaudgiuliani (01cff0d)
- Revert appcompat transitive dependency removal - #2272 by @arnaudgiuliani (7bbf98c)
Features & Improvements
- Add koinActivityInject function - Helper to retrieve dependency against Activity scope by @arnaudgiuliani (f946362)
- Make nav3 EntryProvider generic by @xephosbot in #2314
- Improve Parameter Stack Threading - Optimize ThreadLocal loading to avoid cost per Scope - #2306 by @arnaudgiuliani in #2345
- Optimize Params stack access by @arnaudgiuliani (5ac0e8b)
- Archetype DSL duplication removal by @arnaudgiuliani (7dab332)
- Adjust check & error messages by @arnaudgiuliani (3acd78e)
Libraries & Dependencies
- Kotlin 2.3.20-Beta1
- Coroutines 1.10.2
- Compose Multiplatform 1.10.0
- AndroidX Lifecycle 2.10.0 / JetBrains Lifecycle 2.9.6
- AndroidX Navigation 2.9.6 / JetBrains Navigation 2.9.1
- AndroidX Navigation3 1.0.0
- Ktor 3.3.3
Other
- Clean up koin-fu + koin-annotations beta3 plugin by @arnaudgiuliani (932c154)
- Moved koin-fu lib to Koin beta3 plugin by @arnaudgiuliani (a9daf9b)
- KDoc update for EntryProvider by @arnaudgiuliani (0539c48)
- Delete CHANGELOG.md by @jvanderwee in #2308
New Contributors
- @jvanderwee made their first contribution in #2308
- @xephosbot made their first contribution in #2314
- @nazaburo made their first contribution in #2293
Full Changelog: 4.2.0-beta2...4.2.0-beta3