feat(desktop): implement DI auto-wiring and validation#4782
Merged
jamesarich merged 1 commit intomainfrom Mar 13, 2026
Merged
Conversation
This commit migrates the Desktop (JVM) target to use the Koin K2 compiler plugin for dependency injection and introduces automated graph validation. Manual ViewModel wiring in `DesktopKoinModule` has been replaced by auto-generated modules from `commonMain`, ensuring parity with the Android implementation.
Specific changes include:
- **DI Automation**: Switched from manual `viewModel { ... }` blocks to Koin K2 compiler plugin auto-wiring for the Desktop target.
- **Graph Validation**: Added `DesktopKoinTest.kt` using Koin's `verify()` API to validate the entire Desktop DI graph (repositories, use cases, ViewModels, and stubs) at test-time.
- **New Stubs**: Implemented `NoopCompassHeadingProvider`, `NoopPhoneLocationProvider`, and `NoopMagneticFieldProvider` in `desktop/src/main/kotlin/org/meshtastic/desktop/stub/` to resolve missing dependencies identified during DI validation.
- **Module Refactoring**: Updated `DesktopKoinModule.kt` to include the generated Koin modules and registered the new compass-related stubs.
- **Documentation**: Updated `roadmap.md`, `kmp-migration.md`, and `architecture-review-2026-03.md` to reflect the completion of Desktop DI auto-wiring and the shift from KSP to the K2 compiler plugin for Koin annotations.
Signed-off-by: James Rich <[email protected]>
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.
This commit migrates the Desktop (JVM) target to use the Koin K2 compiler plugin for dependency injection and introduces automated graph validation. Manual ViewModel wiring in
DesktopKoinModulehas been replaced by auto-generated modules fromcommonMain, ensuring parity with the Android implementation.Specific changes include:
viewModel { ... }blocks to Koin K2 compiler plugin auto-wiring for the Desktop target.DesktopKoinTest.ktusing Koin'sverify()API to validate the entire Desktop DI graph (repositories, use cases, ViewModels, and stubs) at test-time.NoopCompassHeadingProvider,NoopPhoneLocationProvider, andNoopMagneticFieldProviderindesktop/src/main/kotlin/org/meshtastic/desktop/stub/to resolve missing dependencies identified during DI validation.DesktopKoinModule.ktto include the generated Koin modules and registered the new compass-related stubs.roadmap.md,kmp-migration.md, andarchitecture-review-2026-03.mdto reflect the completion of Desktop DI auto-wiring and the shift from KSP to the K2 compiler plugin for Koin annotations.