Skip to content

Commit

Permalink
migration guide page
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudgiuliani committed Sep 26, 2024
1 parent df8ad6f commit 59c829a
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/setup/migrate.md
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`

0 comments on commit 59c829a

Please sign in to comment.