-
-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df8ad6f
commit 59c829a
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: Migration Guides | ||
--- | ||
|
||
All you need to setting up Koin in your project | ||
|
||
## From Koin 3.x to Koin 4.0 | ||
|
||
### Kotlin Version | ||
|
||
:::info | ||
Koin 4.0 requires Kotlin `2.0.20`. Be sure to have the right Kotlin version if you see some compilation problems. | ||
::: | ||
|
||
With this new version of Kotlin, we benefit from new `kotlin.uuid.uuid` API. The `KoinPlatformTools.generateId()` Koin function now uses this new API to generates real UUID over platforms. | ||
|
||
|
||
### New ViewModel DSL & API | ||
|
||
Koin 4.0 introduces new ViewModel DSL & API that mutualize the Google/Jetbrains KMP API. To avoid duplication over the codebase, | ||
the ViewModel API is now located in `koin-core-viewmodel` & `koin-core-viewmodel-navigation` projects. | ||
|
||
You don't have to change your package, current ones are already using those new `koin-core-viewmodel` packages. You just need to change your import like follow: | ||
|
||
```kotlin | ||
org.koin.core.module.dsl.* | ||
``` | ||
|
||
### Deprecations | ||
|
||
The following APIs have been deprecated, and should not be used anymore: | ||
|
||
- `koin-test` - checkModules | ||
- `koin-android` - ViewModel DSL in favor of new centralized DSL in koin-core | ||
- `koin-compose-viewmodel` - ViewModel DSL in favor of new centralized DSL in koin-core | ||
|
||
|
||
### Removals | ||
|
||
The following APIs have been removed, due to deprecations in last milestone: | ||
|
||
- `koin-core` - all API tagged with @KoinReflectAPI | ||
- `koin-android` - all state ViewModel API (stateViewModel, sharedStateViewModel ...) | ||
- `koin-compose` - functions `get` and `inject` have been removed in favor of `koinInject` | ||
|
||
class `ApplicationAlreadyStartedException` has been renamed `KoinApplicationAlreadyStartedException` |