kotlinx.rpc 0.4.0 Help

Migration to 0.4.0

Version 0.4.0 introduces breaking changes.

@Rpc Annotation and RemoteService Interface

This version brings changes to service definitions. Starting with this version, service definitions require the @Rpc annotation.

Prior to 0.4.0, a service was defined as follows:

interface MyService : RPC

Starting from 0.4.0, the new service definition should be:

@Rpc interface MyService

This definition is sufficient for the project to build. However, it will not fully support IDE features, such as code highlighting. All interfaces annotated with @Rpc are inherently of type RemoteService, which is added by the compiler plugin, but IDEs won't be able to resolve it.

To ensure proper IDE support, add explicit typing:

@Rpc interface MyService : RemoteService

Removal of Kotlin versions prior to 2.0

We stopped publishing compiler plugin artifacts for Kotlin versions prior to 2.0.0. The reason being its high maintenance cost with little to no usage. We encourage the migration to Kotlin 2.0, where all stable versions are now supported.

Currently supported Kotlin versions: 2.0.0, 2.0.10, 2.0.20, 2.0.21

Removal of org.jetbrains.kotlinx.rpc.platform Gradle plugin

The Gradle plugin with id org.jetbrains.kotlinx.rpc.platform is not being published anymore. The reason is that it's sole role was to set BOM in the project, which is now considered unnecessary. Gradle version catalogs can be used instead.

Removal of BOM from the Gradle plugin

The Gradle plugin with id org.jetbrains.kotlinx.rpc.plugin does not set BOM for the project anymore.

To configure BOM manually, add the following dependency:

dependencies { implementation(platform("org.jetbrains.kotlinx:kotlinx-rpc-bom:0.4.0")) }
Last modified: 05 November 2024