Skip to content

Conversation

@Frank1234
Copy link
Collaborator

Since Hilt doesn’t support KMP, we’d like to migrate to Koin instead.

As a bonus, Koin also provides a simpler experience for developers.
As a con, you don't have compile time safety, but do have test-time safety.

I decided not to use Koin annotations, as they tend to decentralize the dependency logic and introduce various workarounds to make things function correctly. In practice, Koin annotations makes the setup more complex and scattered rather than streamlined.

Please also note the unit test that validates the dependency injection graph at test-time.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the dependency injection framework from Hilt to Koin to support Kotlin Multiplatform (KMP). The migration removes Hilt annotations and modules while introducing Koin modules with a cleaner, more centralized configuration approach.

  • Replaces Hilt ViewModels and @Inject constructors with Koin equivalents
  • Introduces value classes for configuration parameters to replace Hilt qualifiers
  • Adds comprehensive Koin module verification tests

Reviewed Changes

Copilot reviewed 43 out of 44 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
gradle/libs.versions.toml Updates dependencies, removes Hilt, adds Koin libraries
feature//ui/.kt Replaces hiltViewModel() calls with koinViewModel()
feature//presentation/.kt Removes @hiltviewmodel and @Inject annotations from ViewModels
**/di/*.kt Replaces Hilt modules with Koin modules using DSL syntax
core/utils/config/ConfigModels.kt Introduces value classes to replace Hilt qualifier annotations
app/src/test/kotlin/.../KoinCheckModulesTest.kt Adds test to verify Koin dependency graph integrity
app/MainActivity.kt Replaces @androidentrypoint and @Inject with Koin's inject()

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Frank1234 Frank1234 changed the base branch from develop to dependency-updates October 13, 2025 12:38
Base automatically changed from dependency-updates to develop October 14, 2025 08:02
@Frank1234 Frank1234 requested a review from sebaslogen October 29, 2025 13:53
@Frank1234
Copy link
Collaborator Author

Thanks for the very sharp review @sebaslogen . I've made some changes.

Copy link
Collaborator

@sebaslogen sebaslogen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems complete for me, only one tricky koin question still open

@Frank1234 Frank1234 merged commit f6f98fb into develop Nov 21, 2025
3 checks passed
@Frank1234 Frank1234 deleted the feature/hilt-to-koin branch November 21, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants