Migration to 0.4.0
Edit pageLast modified: 05 November 2024Version 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
note
The reasoning behind this update is that the Kotlin Compiler Plugin API has changed. Versions
2.0.0
and2.0.10
allowed our plugin to resolve marker interfaces (likeRPC
) before the code generation phase. Starting from version2.0.20
, this behaviour changed, making annotations the only reliable way to detect RPC services.To track changes in this regard, we raised an issue with the compiler team. Note that this approach is subject to change, and the final API design may be updated before the stable release.
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.5.1"))
}