Upgrading io.insert-koin:koin-core 3 to 4
Breaking3.5.6 → 4.2.2Breaking9Platform2Deprecated2New63Changed96Fixed92Other73
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 previous default sorting.
- If you used koin-fu, switch to the Koin Annotations plugin instead.
- Changes the BeanDef constructor, updating its API signature.
Must act Top 5 of 12 that need code or config changes
Installs 5 packages in all (was 6).
What you must change
Breaking8
Renames module to lazyModule in some contexts.
modulelazyModulegetAll() now returns instances in declaration order, removing the previous default sorting.
getAll()Removes the koin-fu module, which moved to the Koin Annotations plugin.
koin-fuChanges the BeanDef constructor, updating its API signature.
BeanDefRequires ViewModel declarations that need scope injection to 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.
KoinApplicationFixes Compose scope resolution with proper context handling and introduces ComposeContextWrapper to manage internal scope state.
ComposeContextWrapperPlatform2
Raises minSdk to 23 for Android.
Requires the Ktor EAP repository to be added to settings.gradle.kts.
Deprecations to plan for
Deprecated2
Deprecates CheckModules.
CheckModulesRestores CheckModules as deprecated code.
CheckModules