Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Dependency Injection Framework from Hilt to Koin #237

Open
wants to merge 1 commit into
base: kmp
Choose a base branch
from

Conversation

cloner93
Copy link

Description:

This Pull Request migrates the dependency injection framework used in the project from Hilt to Koin. The changes aim to simplify dependency management, improve modularity, and align with the team’s preferences or project goals.

Changes Made:

  1. Replaced all Hilt annotations with Koin DSL methods (e.g., single, viewModel, module, etc.).
  2. Updated Application class to initialize Koin with required modules:
  3. Included feature-specific modules (e.g., marketListFeatureModule, marketDetailFeatureModule).
  4. Included core modules (domainModule, repositoryModule, etc.).
  5. Refactored ViewModel injection to use Koin's viewModel DSL.
  6. Added new modules for api, data, domain, and feature layers.
  7. Removed Hilt-related dependencies from the build.gradle files.

Next Steps:

  • Ensure team members are aligned with Koin usage.
  • Document any guidelines or patterns for adding new modules and dependencies.

listOf(
mainViewModelModule,
marketListFeatureModule, marketDetailFeatureModule,
Copy link
Owner

Choose a reason for hiding this comment

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

Break it into two lines.

@@ -9,7 +9,7 @@ android {

dependencies {
projects.apply {
implementation(appWatch.ui)
api(appWatch.ui)
Copy link
Owner

Choose a reason for hiding this comment

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

Why do you make it api rather than implementation?

@@ -14,8 +15,8 @@ configurations.all {

dependencies {
projects.apply {
implementation(feature.marketlist)
implementation(feature.marketdetail)
api(feature.marketlist)
Copy link
Owner

Choose a reason for hiding this comment

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

And Why api?

@dagger.hilt.android.lifecycle.HiltViewModel *;
}
-keep,@dagger.hilt.InstallIn class * { *; }
-keep class dagger.hilt.** { *; }
-dontwarn dagger.internal.codegen.ComponentProcessor
Copy link
Owner

Choose a reason for hiding this comment

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

Can we remove this line too?


modules(
listOf(
marketListFeatureModule, marketDetailFeatureModule,
Copy link
Owner

Choose a reason for hiding this comment

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

Break this line into two lines

@@ -14,7 +14,7 @@ configurations.all {

dependencies {
projects.apply {
implementation(data.marketRepository)
api(data.marketRepository)
Copy link
Owner

Choose a reason for hiding this comment

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

Why api?

Comment on lines +9 to +11
MarketDetailViewModel(
get(), get(), get(), get()
)
Copy link
Owner

Choose a reason for hiding this comment

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

Put it into one line.

@@ -14,7 +14,7 @@ configurations.all {

dependencies {
projects.apply {
implementation(data.marketRepository)
api(data.marketRepository)
Copy link
Owner

Choose a reason for hiding this comment

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

Why api?

Comment on lines +9 to +11
MarketListViewModel(
get(), get(), get(), get()
)
Copy link
Owner

Choose a reason for hiding this comment

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

Put it into one line

Comment on lines +12 to +13
api(feature.marketlist)
api(feature.marketdetail)
Copy link
Owner

Choose a reason for hiding this comment

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

Why api?

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.

2 participants