Upgrading io.insert-koin:koin-compose 1 to 4
Breaking1.1.5 → 4.2.2Breaking9Platform2Deprecated2New65Changed87Fixed82Other63
BreakingUpgrade verdict
8 breaking changes and 2 platform requirement changes.
In plain terms
- Renames module to lazyModule in some contexts.
- getAll() now returns instances in declaration order, removing the default sorting.
- The koin-fu module is gone; its functionality now lives in the Koin Annotations plugin.
- Changes the BeanDef constructor, updating its API signature.
Must act Top 5 of 12 that need code or config changes
What you must change
Breaking8
Renames module to lazyModule in some contexts.
modulelazyModulegetAll() now returns instances in declaration order, removing the default sorting.
getAll()Removes the koin-fu module, which moved to the Koin Annotations plugin.
koin-fuChanges the BeanDef constructor, updating its API signature.
BeanDefViewModel declarations requiring scope injection must now be inside a viewModelScope { } block.
viewModelScopeAutomatic ViewModel scope creation now requires ViewModel declarations inside the viewModelScope section; declarations outside resolve against the root scope.
viewModelviewModelScopeKoinApplication is reworked to start and stop on the Compose lifecycle cycle.
KoinApplicationFixes Compose scope resolution with proper context handling and introduces ComposeContextWrapper to manage internal scope state.
ComposeContextWrapperPlatform2
Raises minSdk to 23 for Android.
minSdkRequires the Ktor EAP repository to be added to settings.gradle.kts.
settings.gradle.ktsmaven()Deprecations to plan for
Deprecated2
Deprecates CheckModules.
CheckModulesRestores CheckModules as deprecated code.
CheckModules