Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:
ALGOLIA_INDEX_NAME: 'prod_kotlin_rpc'
ALGOLIA_KEY: '${{ secrets.ALGOLIA_KEY }}'
CONFIG_JSON_PRODUCT: 'kotlinx-rpc'
CONFIG_JSON_VERSION: '0.9.1'
CONFIG_JSON_VERSION: '0.10.0'
DOKKA_ARTIFACT: 'dokka.zip'
ASSEMBLE_DIR: '__docs_assembled'
ASSEMBLE_ARTIFACT: 'assembled.zip'
Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -67,7 +67,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: kotlinx-rpc
path: artifacts
Expand All @@ -83,12 +83,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Download Writerside artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: kotlinx-rpc

Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: kotlinx-rpc-assembled

Expand All @@ -151,7 +151,7 @@ jobs:
uses: actions/configure-pages@v5

- name: Package and upload Pages artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
with:
path: publish

Expand All @@ -167,7 +167,7 @@ jobs:
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3
steps:
- name: Download artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: kotlinx-rpc
- name: Unzip artifact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Gradle
Expand Down
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
# 0.10.0
> Published 1 October 2025

## Overview
This release brings a lot of changes, work:
- Kotlin 2.2.20 and 2.2.10 support
- kRPC: Backpressure

To read about the backpressure feature,
see the updated [kRPC Configuration](https://kotlin.github.io/kotlinx-rpc/configuration.html#connector-dsl) page.

### Breaking Changes 🔴
* Allow suspend calls inside ktor rpc builder #433 by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/439

### Features 🎉
* Kotlin 2.2.20 by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/478
* Kotlin 2.2.10 by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/456
* kRPC: Backpressure by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/462
* Add support for Wasm/Wasi to krpc #465 by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/480

### Bug fixes 🐛
* Add collect once check for client streams by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/431
* Fix diagnostic rendering for compiler plugins checkers by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/432
* fix wrong unchecked null cast (potential NPE) by @y9maly in https://github.com/Kotlin/kotlinx-rpc/pull/445

### Documentation 📗
* Docs for gRPC with Ktor by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/394
* Add a doc for KMP source sets with gRPC by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/405
* Update strict-mode.topic by @BierDav in https://github.com/Kotlin/kotlinx-rpc/pull/440
* Update grpc-configuration.topic by @flockbastian in https://github.com/Kotlin/kotlinx-rpc/pull/450
* Added docs for release by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/482
* Fix typo in docs grpc-configuration.topic by @sebaslogen in https://github.com/Kotlin/kotlinx-rpc/pull/495

### Infra 🚧
* Fix docs yaml and signing tasks by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/404
* Fix jdk resolution problems on CI by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/406
* Use compat-patrouille for compatibility settings by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/438

### Other Changes 🧹
* Fix how we create 'publishMavenArtifact' tasks by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/416
* Update grpc-sample app by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/425
* Fix LV and signing by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/424
* Update ktor-all-platforms-app sample to sync service creation by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/455
* Added Ktor closure tests and Cancellation tests, + minor fixes by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/479
* Fix flaky tests by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/481

## New Contributors
* @flockbastian made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/450
* @y9maly made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/445
* @sebaslogen made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/495

**Full Changelog**: https://github.com/Kotlin/kotlinx-rpc/compare/0.9.1...0.10.0

# 0.9.1
> Published 17 July 2025

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[![Kotlin Experimental](https://kotl.in/badges/experimental.svg)](https://kotlinlang.org/docs/components-stability.html)
[![Official JetBrains project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![Kotlin](https://img.shields.io/badge/kotlin-2.0.0--2.2.10-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-2.0.0--2.2.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![GitHub License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)

[//]: # ([![TeamCity build](https://img.shields.io/teamcity/build/s/Build_kRPC_All.svg?server=http%3A%2F%2Fkrpc.teamcity.com)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=Build_kRPC_All&guest=1))
Expand Down Expand Up @@ -102,7 +102,7 @@ To ensure that all IDE features of our compiler plugin work properly on IntelliJ
We support all stable Kotlin versions starting from 2.0.0:
- 2.0.0, 2.0.10, 2.0.20, 2.0.21
- 2.1.0, 2.1.10, 2.1.20, 2.1.21
- 2.2.0, 2.2.10
- 2.2.0, 2.2.10, 2.2.20

For a full compatibility checklist,
see [Versions](https://kotlin.github.io/kotlinx-rpc/versions.html).
Expand Down Expand Up @@ -134,9 +134,9 @@ that will set up code generation in a project.
Example of a setup in a project's `build.gradle.kts`:
```kotlin
plugins {
kotlin("multiplatform") version "2.2.10"
kotlin("plugin.serialization") version "2.2.10"
id("org.jetbrains.kotlinx.rpc.plugin") version "0.9.1"
kotlin("multiplatform") version "2.2.20"
kotlin("plugin.serialization") version "2.2.20"
id("org.jetbrains.kotlinx.rpc.plugin") version "0.10.0"
}
```

Expand All @@ -151,15 +151,15 @@ And now you can add dependencies to your project:
```kotlin
dependencies {
// Client API
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client:0.9.1")
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client:0.10.0")
// Server API
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server:0.9.1")
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server:0.10.0")
// Serialization module. Also, protobuf and cbor are provided
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json:0.9.1")
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json:0.10.0")

// Transport implementation for Ktor
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client:0.9.1")
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server:0.9.1")
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client:0.10.0")
implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server:0.10.0")

// Ktor API
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@

package kotlinx.rpc.codegen

import kotlinx.rpc.codegen.extension.RpcIrExtension
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.compiler.plugin.AbstractCliOption
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter

@OptIn(ExperimentalCompilerApi::class)
class RpcCommandLineProcessor : CommandLineProcessor {
override val pluginId = "kotlinx-rpc"
override val pluginId = PLUGIN_ID

override val pluginOptions = listOf(
RpcFirCliOptions.ANNOTATION_TYPE_SAFETY,
Expand All @@ -37,20 +33,3 @@ class RpcCommandLineProcessor : CommandLineProcessor {
}
}
}

@OptIn(ExperimentalCompilerApi::class)
class RpcCompilerPlugin : CompilerPluginRegistrar() {
override val supportsK2: Boolean = true

override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
registerRpcExtensions(configuration)
}
}

@OptIn(ExperimentalCompilerApi::class)
fun CompilerPluginRegistrar.ExtensionStorage.registerRpcExtensions(configuration: CompilerConfiguration) {
VersionSpecificApi.INSTANCE = VersionSpecificApiImpl

IrGenerationExtension.registerExtension(RpcIrExtension(configuration))
FirExtensionRegistrarAdapter.registerExtension(FirRpcExtensionRegistrar(configuration))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

package kotlinx.rpc.codegen

const val PLUGIN_ID = "org.jetbrains.kotlinx.rpc"
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

package kotlinx.rpc.codegen

import kotlinx.rpc.codegen.extension.RpcIrExtension
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.CompilerConfiguration
import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter

@OptIn(ExperimentalCompilerApi::class)
fun CompilerPluginRegistrar.ExtensionStorage.registerRpcExtensions(configuration: CompilerConfiguration) {
VersionSpecificApi.INSTANCE = VersionSpecificApiImpl

IrGenerationExtension.registerExtension(RpcIrExtension(configuration))
FirExtensionRegistrarAdapter.registerExtension(FirRpcExtensionRegistrar(configuration))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

package kotlinx.rpc.codegen

import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.CompilerConfiguration

@OptIn(ExperimentalCompilerApi::class)
class RpcCompilerPlugin : CompilerPluginRegistrar() {
override val supportsK2: Boolean = true

//##csm RpcCompilerPlugin.pluginId
//##csm specific=[2.0.0...2.2.99]
//##csm /specific
//##csm default
override val pluginId: String = PLUGIN_ID
//##csm /default
//##csm /RpcCompilerPlugin.pluginId

override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
registerRpcExtensions(configuration)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class FirRpcServiceGenerator(
* Generates [owner]'s service stub.
* Scrapes the functions from the [owner] to generate method classes.
*/
private fun generateRpcServiceStubClass(owner: FirClassSymbol<*>): FirRegularClassSymbol? {
private fun generateRpcServiceStubClass(owner: FirClassSymbol<*>): FirRegularClassSymbol {
return createNestedClass(owner, RpcNames.SERVICE_STUB_NAME, RpcGeneratedStubKey(owner.name)) {
visibility = Visibilities.Public
modality = Modality.FINAL
Expand Down
3 changes: 0 additions & 3 deletions compiler-plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ org.gradle.configuration-cache=true
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true

# https://youtrack.jetbrains.com/issue/KT-78504
kotlin.js.yarn=false

# development mode for kotlinx.rpc gradle plugin. Uses local project paths to apply the compiler plugin
kotlinx.rpc.plugin.internalDevelopment=true

Expand Down
6 changes: 3 additions & 3 deletions docs/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ Here is a 'simple' guide for solving problems:
- Docker
- `Cannot connect to the Docker daemon` - open `Docker Desktop`
- Kotlin/Js or Kotlin/Wasm
- `kotlinUpgradePackageLock` or `kotlinWasmUpgradePackageLock` (and also `kotlinNpmInstall` or `kotlinWasmNpmInstall`)
- `kotlinUpgradeYarnLock` or `kotlinWasmUpgradeYarnLock` (and also `kotlinNpmInstall` or `kotlinWasmNpmInstall`)
have a funny tendency to fail sometimes, and you don't know why.

I'll tell you!
Expand All @@ -403,7 +403,7 @@ Here is a 'simple' guide for solving problems:
If something doesn't work, your steps are:
- Delete `package-lock.json` file
- Delete `<REPO_ROOT>/build/js` / `<REPO_ROOT>/build/wasm`
- Run `kotlinUpgradePackageLock` / `kotlinWasmUpgradePackageLock`
- Run `kotlinUpgradeYarnLock` / `kotlinWasmUpgradeYarnLock`
- If the problem persists:
- Check that `<REPO_ROOT>/build/<target>/.npmrc` AND `<REPO_ROOT>/build/<target>/.yarnrc` are present
- Check that `.yarnrc` contains one line: `registry: "https://packages.jetbrains.team/npm/p/krpc/build-deps/"`
Expand Down Expand Up @@ -479,7 +479,7 @@ all included builds (not subprojects) must reflect the change.
- `checkLegacyAbi` / `updateLegacyAbi` - ABI checks.
See https://kotlinlang.org/docs/whatsnew22.html#binary-compatibility-validation-included-in-kotlin-gradle-plugin.
Former BCV: https://github.com/Kotlin/binary-compatibility-validator
- `kotlinUpgradePackageLock` / `kotlinWasmUpgradePackageLock` - update [kotlin-js-store](../kotlin-js-store) contents,
- `kotlinUpgradeYarnLock` / `kotlinWasmUpgradeYarnLock` - update [kotlin-js-store](../kotlin-js-store) contents,
usually after Kotlin version update.
- `updateDocsChangelog` - put modified [CONTRIBUTING.md](../CONTRIBUTING.md) into [topics](pages/kotlinx-rpc/topics)
- `detekt` - run detekt checks.
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/kotlinx-rpc/help-versions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[
{"version":"0.9.1","url":"/kotlinx-rpc/0.9.1/","isCurrent":true}
{"version":"0.10.0","url":"/kotlinx-rpc/0.10.0/","isCurrent":true}
]
1 change: 1 addition & 0 deletions docs/pages/kotlinx-rpc/rpc.tree
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<toc-element topic="versions.topic"/>
<toc-element topic="platforms.topic"/>
<toc-element toc-title="Migration guides">
<toc-element topic="0-10-0.topic"/>
<toc-element topic="0-8-0.topic"/>
<toc-element topic="0-6-0.topic"/>
<toc-element topic="0-5-0.topic"/>
Expand Down
32 changes: 32 additions & 0 deletions docs/pages/kotlinx-rpc/topics/0-10-0.topic
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
-->

<!DOCTYPE topic
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="Migration to 0.10.0" id="0-10-0">

<p>
Version <code>0.10.0</code> brings some changes that require a migration:
</p>
<list>
<li>
<code>waitForServices</code> parameter in kRPC config is deprecated
and should be replaced with <a href="configuration.topic#connector-dsl"/>
</li>
<li>
As a continuation of the previous point, the backpressure mechanism is now introduced.
You may encounter slowdowns by default when using streams.
Use <a href="configuration.topic#connector-dsl"/>
to configure better suited buffer sizes.
</li>
<li>
For Ktor kRPC integration -
<code>public fun Route.rpc</code> functions now accept a suspending function parameter
instead of a regular one.
</li>
</list>
</topic>
Loading