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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 0.6.1
> Published 11 April 2025

### Bug fixes 🐛
* Fix bidirectional flows in non-suspend streams by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/316
* Fix KRPC-173 (#315) by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/317

**Full Changelog**: https://github.com/Kotlin/kotlinx-rpc/compare/0.6.0...0.6.1

# 0.6.0
> Published 4 April 2025

Expand Down
2 changes: 1 addition & 1 deletion gradle-conventions-settings/develocity/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ configurations.configureEach {

dependencies {
implementation("com.gradle:develocity-gradle-plugin:3.17")
implementation("com.gradle:common-custom-user-data-gradle-plugin:2.1")
implementation("com.gradle:common-custom-user-data-gradle-plugin:2.2.1")
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://packages.jetbrains.team/files/p/krpc/build-deps/distributions/gradle-8.12.1-bin.zip
distributionUrl=https\://packages.jetbrains.team/files/p/krpc/build-deps/distributions/gradle-8.13-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 8 additions & 8 deletions monitor/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aiohappyeyeballs==2.6.1
aiohttp==3.11.14
aiohttp==3.11.16
aiohttp-jinja2==1.6
aiosignal==1.3.2
anyio==4.9.0
Expand All @@ -20,15 +20,15 @@ MarkupSafe==3.0.2
mdit-py-plugins==0.4.2
mdurl==0.1.2
msgpack==1.1.0
multidict==6.1.0
platformdirs==4.3.6
propcache==0.3.0
multidict==6.4.2
platformdirs==4.3.7
propcache==0.3.1
Pygments==2.19.1
rich==13.9.4
rich==14.0.0
sniffio==1.3.1
textual==2.1.2
textual==3.0.1
textual-dev==1.7.0
textual-serve==1.1.1
typing_extensions==4.12.2
typing_extensions==4.13.1
uc-micro-py==1.0.3
yarl==1.18.3
yarl==1.19.0
9 changes: 9 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@
],
"enabled": false,
},
{
// Reason: kotlin-dsl updates are to be done manually
"description": "Ignore Kotlin DSL (Gradle) updates",
"matchDepNames": [
"/org.gradle.kotlin:gradle-kotlin-dsl-plugins(:|\\.).*/",
"/org.gradle.kotlin.kotlin-dsl(:|\\.).*/",
],
"enabled": false,
},
{
// Reason: we support java 8, logback 1.4 or later switched to java 11
"description": "Ignore logback in Core",
Expand Down
10 changes: 5 additions & 5 deletions samples/grpc-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
plugins {
kotlin("jvm") version "2.1.10"
kotlin("plugin.serialization") version "2.1.10"
id("org.jetbrains.kotlinx.rpc.plugin") version "0.5.1-grpc-16"
id("com.google.protobuf") version "0.9.4"
id("org.jetbrains.kotlinx.rpc.plugin") version "0.6.0"
id("com.google.protobuf") version "0.9.5"
}

group = "kotlinx.rpc.sample"
Expand All @@ -22,9 +22,9 @@ kotlin {
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-rpc-grpc-core:0.5.1-grpc-16")
implementation("ch.qos.logback:logback-classic:1.5.16")
implementation("io.grpc:grpc-netty:1.69.0")
implementation("org.jetbrains.kotlinx:kotlinx-rpc-grpc-core:0.5.1-grpc-39")
implementation("ch.qos.logback:logback-classic:1.5.18")
implementation("io.grpc:grpc-netty:1.71.0")
}

rpc {
Expand Down
Binary file modified samples/grpc-app/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 1 addition & 5 deletions samples/grpc-app/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#
# Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
#

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
18 changes: 16 additions & 2 deletions samples/grpc-app/gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
#!/bin/sh

#
# Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
Expand Down Expand Up @@ -191,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
Expand Down
1 change: 1 addition & 0 deletions samples/ktor-all-platforms-app/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlinx.rpc)
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@ fun App() {
}

LaunchedEffect(service) {
streamScoped {
service.subscribeToNews().collect { article ->
news.add(article)
}
service.subscribeToNews().collect { article ->
news.add(article)
}
}

Expand Down
24 changes: 12 additions & 12 deletions samples/ktor-all-platforms-app/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[versions]
kotlin = "2.1.10"
kotlin = "2.1.20"

agp = "8.8.0-alpha05"
agp = "8.9.1"
android-compileSdk = "35"
android-minSdk = "24"
android-targetSdk = "35"
androidx-activityCompose = "1.9.3"
androidx-activityCompose = "1.10.1"
androidx-appcompat = "1.7.0"
androidx-constraintlayout = "2.2.0"
androidx-core-ktx = "1.15.0"
androidx-constraintlayout = "2.2.1"
androidx-core-ktx = "1.16.0"
androidx-espresso-core = "3.6.1"
androidx-material = "1.12.0"
androidx-test-junit = "1.2.1"
compose = "1.7.6"
compose-plugin = "1.8.0-alpha01"
compose = "1.7.8"
compose-plugin = "1.8.0-SNAPSHOT+pull-5245"
junit = "4.13.2"
ktor = "3.0.3"
logback = "1.5.16"
serialization = "1.8.0"
coroutines = "1.10.1"
kotlinx-rpc = "0.5.1"
ktor = "3.1.2"
logback = "1.5.18"
serialization = "1.8.1"
coroutines = "1.10.2"
kotlinx-rpc = "0.6.1"

[libraries]
# kotlin
Expand Down
Binary file modified samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion samples/ktor-all-platforms-app/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
Expand Down
1 change: 1 addition & 0 deletions samples/ktor-all-platforms-app/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
plugins {
alias(libs.plugins.kotlinJvm)
alias(libs.plugins.ktor)
alias(libs.plugins.kotlinx.rpc)
application
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class UserServiceImpl(override val coroutineContext: CoroutineContext) : UserSer
return "Nice to meet you $user, how is it in ${userData.address}?"
}

override suspend fun subscribeToNews(): Flow<String> {
override fun subscribeToNews(): Flow<String> {
return flow {
repeat(10) {
delay(300)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ class ApplicationTest {
actual = service.hello("Alex", UserData("address1", "last")),
)

streamScoped {
assertEquals(
expected = List(10) { "Article number $it" },
actual = service.subscribeToNews().toList(),
)
}
assertEquals(
expected = List(10) { "Article number $it" },
actual = service.subscribeToNews().toList(),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ data class UserData(
interface UserService : RemoteService {
suspend fun hello(user: String, userData: UserData): String

suspend fun subscribeToNews(): Flow<String>
fun subscribeToNews(): Flow<String>
}
1 change: 1 addition & 0 deletions samples/ktor-android-app/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kotlinPluginSerialization)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.kotlinx.rpc)
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,23 @@ class AppViewModel : ViewModel() {

private fun fetchData() {
viewModelScope.launch(Dispatchers.IO) {
streamScoped {
delay(2000)
val greetingDeferred = async {
apiService?.hello(
"Alex",
UserData("Berlin", "Smith")
)
}
val newsDeferred = async { apiService?.subscribeToNews() }
delay(2000)
val greetingDeferred = async {
apiService?.hello(
"Alex",
UserData("Berlin", "Smith")
)
}

val serverGreeting = greetingDeferred.await()
val news = newsDeferred.await()
val serverGreeting = greetingDeferred.await()

val allNews: MutableList<String> = mutableListOf()
news?.collect {
allNews += it
val allNews: MutableList<String> = mutableListOf()
apiService?.subscribeToNews()?.collect {
allNews += it

val sendNews = allNews.toMutableList() // fix ConcurrentModificationException
serverGreeting?.let {
_uiState.value = WelcomeData(serverGreeting, sendNews)
}
val sendNews = allNews.toMutableList() // fix ConcurrentModificationException
serverGreeting?.let {
_uiState.value = WelcomeData(serverGreeting, sendNews)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ import kotlinx.rpc.annotations.Rpc
interface MyService : RemoteService {
suspend fun hello(user: String, userData: UserData): String

suspend fun subscribeToNews(): Flow<String>
fun subscribeToNews(): Flow<String>
}
26 changes: 13 additions & 13 deletions samples/ktor-android-app/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[versions]
agp = "8.8.0"
kotlin = "2.1.10"
androidx-activityCompose = "1.9.3"
agp = "8.9.1"
kotlin = "2.1.20"
androidx-activityCompose = "1.10.1"
androidx-appcompat = "1.7.0"
androidx-constraintlayout = "2.2.0"
androidx-core-ktx = "1.15.0"
androidx-constraintlayout = "2.2.1"
androidx-core-ktx = "1.16.0"
androidx-test-junit = "1.2.1"
compose = "1.7.6"
compose = "1.7.8"
compose-plugin = "1.5.14" # https://mvnrepository.com/artifact/androidx.compose.compiler/compiler
compose-bom = "2024.12.01"
material3 = "1.3.1"
compose-bom = "2025.04.00"
material3 = "1.3.2"
junit = "4.13.2"
ktor = "3.0.3"
kotlinx-serialization-json = "1.8.0"
kotlinx-coroutines-core = "1.10.1"
logback = "1.5.16"
kotlinx-rpc = "0.5.1"
ktor = "3.1.2"
kotlinx-serialization-json = "1.8.1"
kotlinx-coroutines-core = "1.10.2"
logback = "1.5.18"
kotlinx-rpc = "0.6.1"

[libraries]
# kotlin
Expand Down
Binary file modified samples/ktor-android-app/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion samples/ktor-android-app/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
Expand Down
1 change: 1 addition & 0 deletions samples/ktor-android-app/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {
alias(libs.plugins.kotlinJvm)
alias(libs.plugins.kotlinPluginSerialization)
alias(libs.plugins.ktor)
alias(libs.plugins.kotlinx.rpc)

application
distribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class MyServiceImpl(override val coroutineContext: CoroutineContext) : MyService
return "Nice to meet you $user, how is it in ${userData.address}?"
}

override suspend fun subscribeToNews(): Flow<String> {
override fun subscribeToNews(): Flow<String> {
return flow {
repeat(10) {
delay(2000)
delay(200)
emit("Article number $it")
}
}
Expand Down
Loading