0.1 to 0.2
Version 0.2 takes the Compose part out of the core, so that an app can use VIE without Compose, with SwiftUI for instance. The contracts, the ViewModels and the middlewares do not change.
What changes
-
VIEViewandSignalEffectmove fromvie-mvito a new artifact,vie-compose. -
They move from the
org.kodein.arch.viepackage toorg.kodein.arch.vie.compose. -
vie-mvino longer brings the Compose runtime along. -
The lifecycle dependencies are Google’s
androidx.lifecycleartifacts, instead of theorg.jetbrains.androidx.lifecyclerepublication.
Migrating a Compose project
-
Add
vie-composeto the modules that write views:build.gradle.ktscommonMain.dependencies { implementation("org.kodein.arch.vie:vie-mvi:0.2.0") implementation("org.kodein.arch.vie:vie-compose:0.2.0") (1) }1 New. A module that only declares contracts and ViewModels does not need it. -
Import
VIEViewandSignalEffectfrom their new package:// before import org.kodein.arch.vie.SignalEffect import org.kodein.arch.vie.VIEView // after import org.kodein.arch.vie.compose.SignalEffect import org.kodein.arch.vie.compose.VIEView -
If you declare the lifecycle artifacts yourself, use Google’s coordinates, with the same version:
// before implementation("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-navigation3:2.11.0") // after implementation("androidx.lifecycle:lifecycle-viewmodel-navigation3:2.11.0")
Nothing else changes in your code.
Using VIE from SwiftUI
Version 0.2 also lets a SwiftUI app share your contracts and ViewModels, without Compose in its framework. See SwiftUI.