|
| 1 | +# Compatibility policy for kotlinx.coroutines |
| 2 | + |
| 3 | +All `kotlinx.coroutines` API comes into five flavors: stable, experimental, obsolete, internal and deprecated. |
| 4 | + * **Deprecated** API is marked with `@Deprecated` and will be removed in `1.0.0` release. |
| 5 | + * **Internal** API is marked with `@InternalCoroutinesApi`. It is intended to be used only by `kotlinx.coroutines` machinery and can (will) be broken without a warning. If you are using internal API, please tell us what problem you are trying to solve, so we can provide a stable alternative. |
| 6 | + * **Experimental** API is marked with `ExperimentalCoroutinesApi`. Such API may have (known) design issues or we are unsure about its semantics. |
| 7 | + Roughly speaking, there is a chance that those declarations will be deprecated in the near future or the semantics of their behavior may change in the way that may break some code. In that case, proper migration aid |
| 8 | + will be provided for next several releases alongside with a stable alternative. |
| 9 | + * **Obsolete** API is marked with `@ObsoleteCoroutinesApi`. This API is known to have some serious issues, so it will be replaced with a better alternative. |
| 10 | + In the sense of migration and deprecation, it is equal to experimental. |
| 11 | + * **Stable** API is public API without any annotations. This API is proven to be stable and it is not going to change. If at some point it will be discovered that such API has unfixable design flaws, |
| 12 | + it will be gradually deprecated with proper replacement and migration aid, but won't be removed for at least a year. |
| 13 | + |
| 14 | +## Migration to 1.0.0 version with Kotlin 1.3 |
| 15 | + |
| 16 | +The main difference between Kotlin 1.2 and 1.3 is that coroutines are now |
| 17 | +stable public API, and thus `kotlinx.coroutines` is leaving its "experimental" status. For that reason, future releases of `kotlinx.coroutines` will be available only for Kotlin 1.3. |
| 18 | +Version `1.0.0` (starting with its release candidate build) will have all its deprecated declarations removed and `kotlinx.coroutines.experimental` package will be renamed to `kotlinx.coroutines` without functional changes. |
| 19 | +In order to migrate `kotlinx.coroutines` to `1.0.0`, follow these steps: |
| 20 | + |
| 21 | +1. Update `kotlinx.coroutines` to `0.30.0` version. |
| 22 | +2. Inspect compiler warnings about deprecated API and migrate it to a proposed alternative. Most of deprecated API has a corresponding replacement which can be applied from IDEA with quickfix. |
| 23 | +3. Update Kotlin version to `1.3.0` or to the latest `1.3.0-rc` and `kotlinx.coroutines` to version `0.30.0-eap13`. Then just get rid of `experimental` suffix in all imports. |
| 24 | +4. Update `kotlinx.coroutines` to version `1.0.0` or to the corresponding release candidate of it). |
| 25 | + |
0 commit comments