Migrate dependency injection from Kodein to Koin#33
Closed
AlexGladkov wants to merge 2 commits into
Closed
Conversation
Replace Kodein DI framework with Koin 4.0.1 across the entire codebase.
This migration modernizes the DI approach and aligns with current Kotlin
Multiplatform best practices.
Changes:
- Update gradle dependencies: Replace kodein-di with koin-core, koin-compose,
koin-compose-viewmodel, and koin-android
- Migrate all DI modules to Koin syntax:
- Replace DI.Module() with module {}
- Replace bind<T>() with singleton with single<T> {}
- Replace bind<T>() with provider with factory<T> {}
- Replace instance() with get()
- Replace importAll() with includes()
- Update PlatformSDK to use Koin API:
- Replace DirectDI with Koin
- Replace DI.direct with startKoin().koin
- Update platform-specific providers for Android, iOS, and JVM
- Maintain backward compatibility with existing injection points through
the Inject helper object
All existing ViewModels and use cases continue to work without changes
through the maintained Inject.instance() API.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Update ProGuard rules to use Koin instead of Kodein - Update README.md tech stack to reference Koin - Update IMPLEMENTATION_STATUS.md documentation - Remove unused import in DatabaseModule - Add safety check to prevent multiple Koin initialization Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
gradle/libs.versions.tomlandcomposeApp/build.gradle.ktsDI.Moduledefinitions to Koin'smodule {}syntaxbind<T>()withprovider/singleton/factory {}calls to Koin's DSLTesting
All modules have been migrated and the codebase compiles successfully with the new Koin framework.
🤖 Generated with Claude Code