From 663f1cdd164e54a6c89d7a45c44677c0e616d4e9 Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Fri, 27 Jun 2025 11:03:23 +0200 Subject: [PATCH 1/4] Set version to 0.8.0 --- .github/workflows/docs.yml | 2 +- README.md | 12 ++--- docs/pages/kotlinx-rpc/help-versions.json | 2 +- docs/pages/kotlinx-rpc/v.list | 2 +- docs/pages/kotlinx-rpc/writerside.cfg | 2 +- kotlin-js-store/package-lock.json | 60 +++++++++++------------ kotlin-js-store/wasm/package-lock.json | 60 +++++++++++------------ versions-root/libs.versions.toml | 2 +- 8 files changed, 71 insertions(+), 71 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 5dad15ffd..6eae1282f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,7 @@ env: ALGOLIA_INDEX_NAME: 'prod_kotlin_rpc' ALGOLIA_KEY: '${{ secrets.ALGOLIA_KEY }}' CONFIG_JSON_PRODUCT: 'kotlinx-rpc' - CONFIG_JSON_VERSION: '0.7.0' + CONFIG_JSON_VERSION: '0.8.0' jobs: build: diff --git a/README.md b/README.md index 8e09c8972..a9605b3b1 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ Example of a setup in a project's `build.gradle.kts`: plugins { kotlin("multiplatform") version "2.2.0" kotlin("plugin.serialization") version "2.2.0" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.7.0" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.8.0" } ``` @@ -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.7.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client:0.8.0") // Server API - implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server:0.7.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server:0.8.0") // Serialization module. Also, protobuf and cbor are provided - implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json:0.7.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json:0.8.0") // Transport implementation for Ktor - implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client:0.7.0") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server:0.7.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client:0.8.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server:0.8.0") // Ktor API implementation("io.ktor:ktor-client-cio-jvm:$ktor_version") diff --git a/docs/pages/kotlinx-rpc/help-versions.json b/docs/pages/kotlinx-rpc/help-versions.json index 88888d30f..2c7d0e0ad 100644 --- a/docs/pages/kotlinx-rpc/help-versions.json +++ b/docs/pages/kotlinx-rpc/help-versions.json @@ -1,3 +1,3 @@ [ - {"version":"0.7.0","url":"/kotlinx-rpc/0.7.0/","isCurrent":true} + {"version":"0.8.0","url":"/kotlinx-rpc/0.8.0/","isCurrent":true} ] diff --git a/docs/pages/kotlinx-rpc/v.list b/docs/pages/kotlinx-rpc/v.list index e1b31733d..d556cded1 100644 --- a/docs/pages/kotlinx-rpc/v.list +++ b/docs/pages/kotlinx-rpc/v.list @@ -14,6 +14,6 @@ - + diff --git a/docs/pages/kotlinx-rpc/writerside.cfg b/docs/pages/kotlinx-rpc/writerside.cfg index 605d17796..69d888c34 100644 --- a/docs/pages/kotlinx-rpc/writerside.cfg +++ b/docs/pages/kotlinx-rpc/writerside.cfg @@ -12,5 +12,5 @@ - + diff --git a/kotlin-js-store/package-lock.json b/kotlin-js-store/package-lock.json index 157b33f10..3415a64f2 100644 --- a/kotlin-js-store/package-lock.json +++ b/kotlin-js-store/package-lock.json @@ -1,12 +1,12 @@ { "name": "kotlinx-rpc", - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kotlinx-rpc", - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "workspaces": [ "packages/kotlinx-rpc-core", "packages/kotlinx-rpc-core-test", @@ -4415,11 +4415,11 @@ "devDependencies": {} }, "packages/kotlinx-rpc-core": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-core-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4438,11 +4438,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-client": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-client-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4461,11 +4461,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-core": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-core-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4484,14 +4484,14 @@ } }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-client": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "ws": "8.18.0" }, "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-client-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0", "ws": "8.18.0" @@ -4511,11 +4511,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-core": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-core-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4534,11 +4534,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-server": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-server-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4557,11 +4557,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-logging": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-logging-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4580,11 +4580,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-cbor": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-cbor-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4603,11 +4603,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-core": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-core-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4626,11 +4626,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-json": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-json-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4649,11 +4649,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-protobuf": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-protobuf-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4672,11 +4672,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-server": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-server-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4695,11 +4695,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-test-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4718,11 +4718,11 @@ } }, "packages/kotlinx-rpc-utils": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-utils-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, diff --git a/kotlin-js-store/wasm/package-lock.json b/kotlin-js-store/wasm/package-lock.json index d470b1d51..44f3782d5 100644 --- a/kotlin-js-store/wasm/package-lock.json +++ b/kotlin-js-store/wasm/package-lock.json @@ -1,12 +1,12 @@ { "name": "kotlinx-rpc", - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kotlinx-rpc", - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "workspaces": [ "packages/kotlinx-rpc-core", "packages/kotlinx-rpc-core-test", @@ -4415,11 +4415,11 @@ "devDependencies": {} }, "packages/kotlinx-rpc-core": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-core-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4437,11 +4437,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-client": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-client-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4459,11 +4459,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-core": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-core-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4481,14 +4481,14 @@ } }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-client": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "ws": "8.18.0" }, "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-client-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0", "ws": "8.18.0" @@ -4507,11 +4507,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-core": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-core-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4529,11 +4529,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-server": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-ktor-krpc-ktor-server-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4551,11 +4551,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-logging": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-logging-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4573,11 +4573,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-cbor": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-cbor-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4595,11 +4595,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-core": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-core-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4617,11 +4617,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-json": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-json-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4639,11 +4639,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-protobuf": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-protobuf-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4661,11 +4661,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-server": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-server-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4683,11 +4683,11 @@ } }, "packages/kotlinx-rpc-krpc-krpc-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-krpc-krpc-test-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, @@ -4705,11 +4705,11 @@ } }, "packages/kotlinx-rpc-utils": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "devDependencies": {} }, "packages/kotlinx-rpc-utils-test": { - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": { "puppeteer": "24.9.0" }, diff --git a/versions-root/libs.versions.toml b/versions-root/libs.versions.toml index 71c747da9..fea2bcecb 100644 --- a/versions-root/libs.versions.toml +++ b/versions-root/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # core library version -kotlinx-rpc = "0.8.0-SNAPSHOT" +kotlinx-rpc = "0.8.0" # kotlin kotlin-lang = "2.2.0" # or env.KOTLIN_VERSION From 72c13169d790b71e17e5a97eff81fc1b918c06de Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Fri, 27 Jun 2025 16:38:34 +0200 Subject: [PATCH 2/4] CHANGELOG.md --- CHANGELOG.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab546d692..491a5e251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,57 @@ +# 0.8.0 +> Published 30 June 2025 + +## Overview +This release brings a lot of changes, including breaking changes: +- Kotlin 2.2.0 Update +- Decoupling of `kotlinx.serialization` from the core functionality +- Simplifying lifetime schema (services lost their `CoroutineScope`) +- Irreversible enforcement of the [strict mode](https://kotlin.github.io/kotlinx-rpc/strict-mode.html) + +These changes significantly reduce the number of footguns and improve the overall usability of the library. + +Additionally, the internal structure of kRPC protocol and our compiler plugin reduced its complexity. +That allows us to provide better quality in future releases +(and this also applies to gRPC, even though in this particular release it was not a priority). + +For the full list of changes that require migration, +see the [Migration Guide](https://kotlin.github.io/kotlinx-rpc/0-8-0.html). + +## Docs update + +We added three new documentation sections: +- [API Reference](https://kotlin.github.io/kotlinx-rpc/api/index.html) +- [Platform compatibility overview](https://kotlin.github.io/kotlinx-rpc/platforms.html) +- [Changelog](https://kotlin.github.io/kotlinx-rpc/changelog.html) in the web + +### Features ๐ŸŽ‰ +* Serialization decoupling by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/354 +* Update Kotlin to 2.2.0 by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/359 + +### Breaking Changes ๐Ÿ”ด +* [Meta] Strict mode, deprecations, lifetime by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/353 + +### Bug fixes ๐Ÿ› +* Fix compilation for standalone k2 module by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/350 +* Fix Pupperteer Version by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/355 + +### Documentation ๐Ÿ“— +* Platforms Table and docs by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/356 +* Dokka by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/357 +* Add Changelog.md to Docs by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/358 +* Onboarding by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/363 + +### Other Changes ๐Ÿงน +* Advance version to 0.8.0-SNAPSHOT by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/340 +* Update README.md to use non-suspend flows by @brokenhappy in https://github.com/Kotlin/kotlinx-rpc/pull/342 +* Fix kotlin master builds by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/345 +* Simplify Gradle Configs by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/360 + +## New Contributors +* @brokenhappy made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/342 + +**Full Changelog**: https://github.com/Kotlin/kotlinx-rpc/compare/0.7.0...0.8.0 + # 0.7.0 > Published 13 May 2025 From 34fa8ef796208fa9a29967653892c2baf617d17f Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Mon, 30 Jun 2025 11:05:39 +0200 Subject: [PATCH 3/4] Bump deps (#367) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yml | 2 +- .github/workflows/platforms.yml | 2 +- .../internalServiceDescriptorOf.js.kt | 4 ++- kotlin-js-store/package-lock.json | 14 ++++++-- kotlin-js-store/wasm/package-lock.json | 14 ++++++-- monitor/requirements.txt | 32 +++++++++---------- settings.gradle.kts | 3 +- versions-root/libs.versions.toml | 14 ++++---- 8 files changed, 52 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6eae1282f..00a0a7252 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -81,7 +81,7 @@ jobs: fetch-depth: 0 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Run Dokka run: ./gradlew dokkaGenerate diff --git a/.github/workflows/platforms.yml b/.github/workflows/platforms.yml index a9082bcd3..ec703c54a 100644 --- a/.github/workflows/platforms.yml +++ b/.github/workflows/platforms.yml @@ -14,6 +14,6 @@ jobs: - name: Checkout Sources uses: actions/checkout@v4 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Check Platforms Table run: ./gradlew verifyPlatformTable --no-configuration-cache diff --git a/core/src/jsMain/kotlin/kotlinx/rpc/internal/internalServiceDescriptorOf.js.kt b/core/src/jsMain/kotlin/kotlinx/rpc/internal/internalServiceDescriptorOf.js.kt index a7c89136a..f1e5dac10 100644 --- a/core/src/jsMain/kotlin/kotlinx/rpc/internal/internalServiceDescriptorOf.js.kt +++ b/core/src/jsMain/kotlin/kotlinx/rpc/internal/internalServiceDescriptorOf.js.kt @@ -1,11 +1,13 @@ /* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ @file:Suppress("detekt.MatchingDeclarationName") package kotlinx.rpc.internal +import js.array.component1 +import js.array.component2 import js.objects.Object import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.descriptor.RpcServiceDescriptor diff --git a/kotlin-js-store/package-lock.json b/kotlin-js-store/package-lock.json index 3415a64f2..a58ae0d02 100644 --- a/kotlin-js-store/package-lock.json +++ b/kotlin-js-store/package-lock.json @@ -36,7 +36,7 @@ "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-json-test", "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-protobuf", "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-protobuf-test", - "packages_imported/ktor-ktor-client-ktor-client-core/3.1.2" + "packages_imported/ktor-ktor-client-core/3.2.0" ], "devDependencies": {} }, @@ -2490,8 +2490,8 @@ "resolved": "packages/kotlinx-rpc-utils-test", "link": true }, - "node_modules/ktor-ktor-client-ktor-client-core": { - "resolved": "packages_imported/ktor-ktor-client-ktor-client-core/3.1.2", + "node_modules/ktor-ktor-client-core": { + "resolved": "packages_imported/ktor-ktor-client-core/3.2.0", "link": true }, "node_modules/lines-and-columns": { @@ -4406,9 +4406,17 @@ "resolved": "https://packages.jetbrains.team/npm/p/krpc/build-deps/zod/-/zod-3.25.67.tgz", "integrity": "sha512-idA2YXwpCdqUSKRCACDE6ItZD9TZzy3OZMtpfLoh6oPR47lipysRrJfjzMqFxQ3uJuUPyUeWe1r9vLH33xO/Qw==" }, + "packages_imported/ktor-ktor-client-core/3.2.0": { + "version": "3.2.0", + "dependencies": { + "ws": "8.18.0" + }, + "devDependencies": {} + }, "packages_imported/ktor-ktor-client-ktor-client-core/3.1.2": { "name": "ktor-ktor-client-ktor-client-core", "version": "3.1.2", + "extraneous": true, "dependencies": { "ws": "8.18.0" }, diff --git a/kotlin-js-store/wasm/package-lock.json b/kotlin-js-store/wasm/package-lock.json index 44f3782d5..75d47c3e6 100644 --- a/kotlin-js-store/wasm/package-lock.json +++ b/kotlin-js-store/wasm/package-lock.json @@ -36,7 +36,7 @@ "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-json-test", "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-protobuf", "packages/kotlinx-rpc-krpc-krpc-serialization-krpc-serialization-protobuf-test", - "packages_imported/ktor-ktor-client-ktor-client-core-wasm-js/3.1.2" + "packages_imported/ktor-ktor-client-core-wasm-js/3.2.0" ], "devDependencies": {} }, @@ -2490,8 +2490,8 @@ "resolved": "packages/kotlinx-rpc-utils-test", "link": true }, - "node_modules/ktor-ktor-client-ktor-client-core-wasm-js": { - "resolved": "packages_imported/ktor-ktor-client-ktor-client-core-wasm-js/3.1.2", + "node_modules/ktor-ktor-client-core-wasm-js": { + "resolved": "packages_imported/ktor-ktor-client-core-wasm-js/3.2.0", "link": true }, "node_modules/lines-and-columns": { @@ -4406,9 +4406,17 @@ "resolved": "https://packages.jetbrains.team/npm/p/krpc/build-deps/zod/-/zod-3.25.67.tgz", "integrity": "sha512-idA2YXwpCdqUSKRCACDE6ItZD9TZzy3OZMtpfLoh6oPR47lipysRrJfjzMqFxQ3uJuUPyUeWe1r9vLH33xO/Qw==" }, + "packages_imported/ktor-ktor-client-core-wasm-js/3.2.0": { + "version": "3.2.0", + "dependencies": { + "ws": "8.18.0" + }, + "devDependencies": {} + }, "packages_imported/ktor-ktor-client-ktor-client-core-wasm-js/3.1.2": { "name": "ktor-ktor-client-ktor-client-core-wasm-js", "version": "3.1.2", + "extraneous": true, "dependencies": { "ws": "8.18.0" }, diff --git a/monitor/requirements.txt b/monitor/requirements.txt index 8e5b39d68..b7de72a12 100644 --- a/monitor/requirements.txt +++ b/monitor/requirements.txt @@ -1,16 +1,16 @@ aiohappyeyeballs==2.6.1 -aiohttp==3.11.16 +aiohttp==3.12.13 aiohttp-jinja2==1.6 aiosignal==1.3.2 anyio==4.9.0 async-timeout==5.0.1 attrs==25.3.0 -certifi==2025.1.31 -click==8.1.8 -exceptiongroup==1.2.2 -frozenlist==1.5.0 -h11==0.14.0 -httpcore==1.0.7 +certifi==2025.6.15 +click==8.2.1 +exceptiongroup==1.3.0 +frozenlist==1.7.0 +h11==0.16.0 +httpcore==1.0.9 httpx==0.28.1 idna==3.10 Jinja2==3.1.6 @@ -19,16 +19,16 @@ markdown-it-py==3.0.0 MarkupSafe==3.0.2 mdit-py-plugins==0.4.2 mdurl==0.1.2 -msgpack==1.1.0 -multidict==6.4.2 -platformdirs==4.3.7 -propcache==0.3.1 -Pygments==2.19.1 +msgpack==1.1.1 +multidict==6.6.0 +platformdirs==4.3.8 +propcache==0.3.2 +Pygments==2.19.2 rich==14.0.0 sniffio==1.3.1 -textual==3.0.1 +textual==3.5.0 textual-dev==1.7.0 -textual-serve==1.1.1 -typing_extensions==4.13.1 +textual-serve==1.1.2 +typing_extensions==4.14.0 uc-micro-py==1.0.3 -yarl==1.19.0 +yarl==1.20.1 diff --git a/settings.gradle.kts b/settings.gradle.kts index 89cfb8408..913d47da7 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,7 +19,8 @@ plugins { id("conventions-repositories") id("conventions-version-resolution") id("conventions-develocity") - id("org.gradle.toolchains.foojay-resolver-convention") version "0.10.0" + // rollback to 0.9.0, as 1.0.0 requires JDK_17 on CI, which I have no time to set up + id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0" } dependencyResolutionManagement { diff --git a/versions-root/libs.versions.toml b/versions-root/libs.versions.toml index fea2bcecb..0f7f580dd 100644 --- a/versions-root/libs.versions.toml +++ b/versions-root/libs.versions.toml @@ -9,25 +9,25 @@ kotlin-compiler = "0.0.0" # default to kotlin-lang or env.KOTLIN_COMPILER_VERSIO # kotlin independent versions detekt-analyzer = "1.23.6" coroutines = "1.10.2" -ktor = "3.1.2" -kotlin-logging = "7.0.6" +ktor = "3.2.0" +kotlin-logging = "7.0.7" slf4j = "2.0.17" logback = "1.3.14" gradle-plugin-publish = "1.3.1" -kotlin-wrappers = "2025.4.8" +kotlin-wrappers = "2025.6.11" junit4 = "4.13.2" -junit5 = "5.12.1" +junit5 = "5.13.2" intellij = "241.19416.19" -gradle-doctor = "0.10.0" +gradle-doctor = "0.11.0" kotlinx-browser = "0.3" dokka = "2.0.0" puppeteer = "24.9.0" -atomicfu = "0.27.0" +atomicfu = "0.29.0" serialization = "1.8.1" detekt-gradle-plugin = "1.23.8" kover = "0.9.1" develocity = "3.19.2" -common-custom-user-data = "2.2.1" +common-custom-user-data = "2.3" [libraries] # kotlinx.rpc โ€“ references to the included builds From 1e176a153870075b76232d5381df23be01a2b6bc Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Mon, 30 Jun 2025 11:06:06 +0200 Subject: [PATCH 4/4] Update samples (#365) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- samples/grpc-app/build.gradle.kts | 6 +-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../composeApp/build.gradle.kts | 5 +- .../composeApp/src/commonMain/kotlin/App.kt | 1 - .../gradle/libs.versions.toml | 18 +++---- .../gradle/wrapper/gradle-wrapper.jar | Bin 43705 -> 43764 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- samples/ktor-all-platforms-app/gradlew | 4 +- samples/ktor-all-platforms-app/gradlew.bat | 4 +- .../kotlin/kotlinx/rpc/sample/Application.kt | 2 +- .../kotlinx/rpc/sample/UserServiceImpl.kt | 2 +- .../kotlinx/rpc/sample/ApplicationTest.kt | 5 +- .../shared/build.gradle.kts | 2 +- .../src/commonMain/kotlin/UserService.kt | 3 +- .../kotlin/kotlinx/rpc/sample/data/Client.kt | 2 +- .../kotlinx/rpc/sample/ui/AppViewModel.kt | 50 ++++++++---------- .../kotlin/kotlinx/rpc/sample/MyService.kt | 3 +- .../gradle/libs.versions.toml | 14 ++--- .../gradle/wrapper/gradle-wrapper.jar | Bin 43705 -> 43764 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- samples/ktor-android-app/gradlew | 4 +- samples/ktor-android-app/gradlew.bat | 4 +- .../kotlin/kotlinx/rpc/sample/Application.kt | 2 +- .../kotlinx/rpc/sample/MyServiceImpl.kt | 4 +- .../common/src/commonMain/kotlin/Common.kt | 3 +- .../frontend/src/jsMain/kotlin/App.kt | 17 ++---- .../frontend/src/jsMain/kotlin/RPC.kt | 2 +- .../ktor-web-app/gradle/libs.versions.toml | 8 +-- .../gradle/wrapper/gradle-wrapper.jar | Bin 43705 -> 43764 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- samples/ktor-web-app/gradlew | 4 +- samples/ktor-web-app/gradlew.bat | 4 +- .../server/src/main/kotlin/Application.kt | 2 +- .../server/src/main/kotlin/MyServiceImpl.kt | 3 +- .../server/src/test/kotlin/ApplicationTest.kt | 1 - samples/simple-ktor-app/build.gradle.kts | 20 +++---- .../gradle/wrapper/gradle-wrapper.jar | Bin 43705 -> 43764 bytes .../gradle/wrapper/gradle-wrapper.properties | 2 +- samples/simple-ktor-app/gradlew | 4 +- samples/simple-ktor-app/gradlew.bat | 4 +- .../simple-ktor-app/src/main/kotlin/Client.kt | 2 - .../src/main/kotlin/ImageRecognizer.kt | 6 +-- .../simple-ktor-app/src/main/kotlin/Server.kt | 2 +- .../src/test/kotlin/ApplicationTest.kt | 3 -- 44 files changed, 100 insertions(+), 130 deletions(-) diff --git a/samples/grpc-app/build.gradle.kts b/samples/grpc-app/build.gradle.kts index 3d85034fa..2cddfba6f 100644 --- a/samples/grpc-app/build.gradle.kts +++ b/samples/grpc-app/build.gradle.kts @@ -5,7 +5,7 @@ plugins { kotlin("jvm") version "2.1.10" kotlin("plugin.serialization") version "2.1.10" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.6.0" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.7.0" id("com.google.protobuf") version "0.9.5" } @@ -22,9 +22,9 @@ kotlin { } dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-rpc-grpc-core:0.5.1-grpc-39") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-grpc-core:0.7.0-grpc-56") implementation("ch.qos.logback:logback-classic:1.5.18") - implementation("io.grpc:grpc-netty:1.71.0") + implementation("io.grpc:grpc-netty:1.73.0") } rpc { diff --git a/samples/grpc-app/gradle/wrapper/gradle-wrapper.properties b/samples/grpc-app/gradle/wrapper/gradle-wrapper.properties index 37f853b1c..ff23a68d7 100644 --- a/samples/grpc-app/gradle/wrapper/gradle-wrapper.properties +++ b/samples/grpc-app/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/samples/ktor-all-platforms-app/composeApp/build.gradle.kts b/samples/ktor-all-platforms-app/composeApp/build.gradle.kts index 0dd4ada29..682d2d799 100644 --- a/samples/ktor-all-platforms-app/composeApp/build.gradle.kts +++ b/samples/ktor-all-platforms-app/composeApp/build.gradle.kts @@ -5,7 +5,6 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget -import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig plugins { @@ -17,9 +16,9 @@ plugins { } kotlin { - @OptIn(ExperimentalWasmDsl::class) + @OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) wasmJs { - moduleName = "composeApp" + outputModuleName = "composeApp" browser { val projectDirPath = project.projectDir.path commonWebpackConfig { diff --git a/samples/ktor-all-platforms-app/composeApp/src/commonMain/kotlin/App.kt b/samples/ktor-all-platforms-app/composeApp/src/commonMain/kotlin/App.kt index e159d8c6d..785ba06c7 100644 --- a/samples/ktor-all-platforms-app/composeApp/src/commonMain/kotlin/App.kt +++ b/samples/ktor-all-platforms-app/composeApp/src/commonMain/kotlin/App.kt @@ -18,7 +18,6 @@ import kotlinx.rpc.krpc.ktor.client.installKrpc import kotlinx.rpc.krpc.ktor.client.rpc import kotlinx.rpc.krpc.ktor.client.rpcConfig import kotlinx.rpc.krpc.serialization.json.json -import kotlinx.rpc.krpc.streamScoped import kotlinx.rpc.withService import ktor_all_platforms_app.composeapp.generated.resources.Res import ktor_all_platforms_app.composeapp.generated.resources.compose_multiplatform diff --git a/samples/ktor-all-platforms-app/gradle/libs.versions.toml b/samples/ktor-all-platforms-app/gradle/libs.versions.toml index 47da114a2..d0b765fdf 100644 --- a/samples/ktor-all-platforms-app/gradle/libs.versions.toml +++ b/samples/ktor-all-platforms-app/gradle/libs.versions.toml @@ -1,25 +1,25 @@ [versions] -kotlin = "2.1.21" +kotlin = "2.2.0" -agp = "8.9.1" -android-compileSdk = "35" +agp = "8.11.0-alpha07" +android-compileSdk = "36" android-minSdk = "24" -android-targetSdk = "35" +android-targetSdk = "36" androidx-activityCompose = "1.10.1" -androidx-appcompat = "1.7.0" +androidx-appcompat = "1.7.1" 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.8" -compose-plugin = "1.8.0-SNAPSHOT+pull-5245" +compose = "1.8.3" +compose-plugin = "1.8.2" junit = "4.13.2" -ktor = "3.1.2" +ktor = "3.1.3" logback = "1.5.18" serialization = "1.8.1" coroutines = "1.10.2" -kotlinx-rpc = "0.7.0" +kotlinx-rpc = "0.8.0" [libraries] # kotlin diff --git a/samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.jar b/samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.jar index 9bbc975c742b298b441bfb90dbc124400a3751b9..1b33c55baabb587c669f562ae36f953de2481846 100644 GIT binary patch delta 642 zcmdmamFde>rVZJA^}0Q$xegf!xPEW^+5YDM%iT2bEgct9o+jH~+sJas#HZ=szO|** z=Pj=X_vx?W&DSwKck|WWn~hffsvnQ+42*W$b7b0$SCcOoZ`{W{^$^pk;4>8-A*-)$ z?n(Po`1$6Jn_u?t-L+tsPyZ2#X}8T6OS8pAU;kdgd+_Hw4z4TW0p9E!T+=f7-c&O% zFic^X{7^$?^Ho04eona9n#mGMxKhA=~8B%JN`M zMhm5wc-2v)$``sY$!Q`9xiU@DhI73ZxiGEKg>yIPs)NmWwMdF-ngLXpZSqV5ez36n zVkxF2rjrjWR+_xr6e6@_u@s~2uv{9vi*1pj2)BjFD+-%@&pRVP1f{O1glxTOp2-62Ph;v z`N1+vCd)9ea)af*Ol1*JCfnp$%Uu}%OuoN7g2}3C@`L5FlP#(sA=|h@iixuZC?qp^ z=L$=v$ZoI}|87Wh=&h7udff{aieKr*l+zDp?pf)_bbRvUf>kn;HCDMXNlgbbo!QRK I1x7am0No)LiU0rr delta 584 zcmexzm1*ZyrVZJAexH5Moc8h7)w{^+t*dqJ%=yhh23L$9JpFV=_k`zJ-?Q4DI*eSe z+ES)HSrVnWLtJ&)lO%hRkV9zl5qqWRt0e;bb zPPo`)y?HTAyZI&u&X<|2$FDHCf4;!v8}p=?Tm`^F0`u(|1ttf~&t$qP3KUSD>@TJQ zRwJ}Pim6NzEc8KA6)e;S6gs8=7IIL8sQL*MYEuRYO;Uj<%3UbMbV&^&!Zvx+LKmjT z8Zch6rYP7Tw?$Hn(UTJwWiS=$f{lB(C=e*%usDV})0AQIK~sat=ND@+Gg*Pyij!rR z*fa02W|%BsV++>4W{DKDGSIUEHd2$P+8ct!RF+CHDowUuTEZOZ%rJSQv*qOXOSPDN zT|sP-$p*_3ncsWB*qoD7JQcyZ9xan%cJP6Tb4-?AZpr*F6v98hoNaPJm@HV`yya5N z))6pqFXn@}P(3T0nEzM8*c_9KtE9o|_pFd&K35GBXP^9Kg(b6GH-z8S4GDzIl~T+b zdLd#meKKHu$5u))8cu$=GKINkGDPOUD)!0$C(BH(U!}!-e;Q0ok8Sc?V1zRO04>ts AA^-pY diff --git a/samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.properties b/samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.properties index 37f853b1c..ff23a68d7 100644 --- a/samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.properties +++ b/samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/samples/ktor-all-platforms-app/gradlew b/samples/ktor-all-platforms-app/gradlew index faf93008b..23d15a936 100755 --- a/samples/ktor-all-platforms-app/gradlew +++ b/samples/ktor-all-platforms-app/gradlew @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/samples/ktor-all-platforms-app/gradlew.bat b/samples/ktor-all-platforms-app/gradlew.bat index 9d21a2183..db3a6ac20 100644 --- a/samples/ktor-all-platforms-app/gradlew.bat +++ b/samples/ktor-all-platforms-app/gradlew.bat @@ -70,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/samples/ktor-all-platforms-app/server/src/main/kotlin/kotlinx/rpc/sample/Application.kt b/samples/ktor-all-platforms-app/server/src/main/kotlin/kotlinx/rpc/sample/Application.kt index 2e8d0f649..c0e0f136f 100644 --- a/samples/ktor-all-platforms-app/server/src/main/kotlin/kotlinx/rpc/sample/Application.kt +++ b/samples/ktor-all-platforms-app/server/src/main/kotlin/kotlinx/rpc/sample/Application.kt @@ -30,7 +30,7 @@ fun Application.module() { } } - registerService { ctx -> UserServiceImpl(ctx) } + registerService { UserServiceImpl() } } } } diff --git a/samples/ktor-all-platforms-app/server/src/main/kotlin/kotlinx/rpc/sample/UserServiceImpl.kt b/samples/ktor-all-platforms-app/server/src/main/kotlin/kotlinx/rpc/sample/UserServiceImpl.kt index 89724005b..fb74ca14c 100644 --- a/samples/ktor-all-platforms-app/server/src/main/kotlin/kotlinx/rpc/sample/UserServiceImpl.kt +++ b/samples/ktor-all-platforms-app/server/src/main/kotlin/kotlinx/rpc/sample/UserServiceImpl.kt @@ -11,7 +11,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import kotlin.coroutines.CoroutineContext -class UserServiceImpl(override val coroutineContext: CoroutineContext) : UserService { +class UserServiceImpl : UserService { override suspend fun hello(user: String, userData: UserData): String { return "Nice to meet you $user, how is it in ${userData.address}?" } diff --git a/samples/ktor-all-platforms-app/server/src/test/kotlin/kotlinx/rpc/sample/ApplicationTest.kt b/samples/ktor-all-platforms-app/server/src/test/kotlin/kotlinx/rpc/sample/ApplicationTest.kt index d3ce2155a..da7057529 100644 --- a/samples/ktor-all-platforms-app/server/src/test/kotlin/kotlinx/rpc/sample/ApplicationTest.kt +++ b/samples/ktor-all-platforms-app/server/src/test/kotlin/kotlinx/rpc/sample/ApplicationTest.kt @@ -12,7 +12,6 @@ import kotlinx.rpc.krpc.ktor.client.installKrpc import kotlinx.rpc.krpc.ktor.client.rpc import kotlinx.rpc.krpc.ktor.client.rpcConfig import kotlinx.rpc.krpc.serialization.json.json -import kotlinx.rpc.krpc.streamScoped import kotlinx.rpc.withService import kotlin.test.Test import kotlin.test.assertEquals @@ -20,6 +19,10 @@ import kotlin.test.assertEquals class ApplicationTest { @Test fun testRoot() = testApplication { + application { + module() + } + val service = createClient { installKrpc() }.rpc("/api") { diff --git a/samples/ktor-all-platforms-app/shared/build.gradle.kts b/samples/ktor-all-platforms-app/shared/build.gradle.kts index 5d99db48b..463e14624 100644 --- a/samples/ktor-all-platforms-app/shared/build.gradle.kts +++ b/samples/ktor-all-platforms-app/shared/build.gradle.kts @@ -3,8 +3,8 @@ */ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.dsl.JvmTarget -import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig plugins { diff --git a/samples/ktor-all-platforms-app/shared/src/commonMain/kotlin/UserService.kt b/samples/ktor-all-platforms-app/shared/src/commonMain/kotlin/UserService.kt index 8ea4be9a3..4c5d445a0 100644 --- a/samples/ktor-all-platforms-app/shared/src/commonMain/kotlin/UserService.kt +++ b/samples/ktor-all-platforms-app/shared/src/commonMain/kotlin/UserService.kt @@ -3,7 +3,6 @@ */ import kotlinx.coroutines.flow.Flow -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.serialization.Serializable @@ -14,7 +13,7 @@ data class UserData( ) @Rpc -interface UserService : RemoteService { +interface UserService { suspend fun hello(user: String, userData: UserData): String fun subscribeToNews(): Flow diff --git a/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/data/Client.kt b/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/data/Client.kt index 01a658e50..1caf656aa 100644 --- a/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/data/Client.kt +++ b/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/data/Client.kt @@ -13,7 +13,7 @@ import kotlinx.rpc.krpc.ktor.client.rpc import kotlinx.rpc.krpc.ktor.client.rpcConfig import kotlinx.rpc.krpc.serialization.json.json -suspend fun createRpcClient(): RpcClient { +fun createRpcClient(): RpcClient { return HttpClient(OkHttp) { installKrpc() }.rpc { diff --git a/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/ui/AppViewModel.kt b/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/ui/AppViewModel.kt index 65a80c57b..c833084af 100644 --- a/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/ui/AppViewModel.kt +++ b/samples/ktor-android-app/app/src/main/kotlin/kotlinx/rpc/sample/ui/AppViewModel.kt @@ -6,6 +6,7 @@ package kotlinx.rpc.sample.ui import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope +import kotlinx.coroutines.CoroutineScope import kotlinx.rpc.sample.data.createRpcClient import kotlinx.rpc.sample.ui.state.WelcomeData import kotlinx.coroutines.Dispatchers @@ -15,49 +16,40 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch import kotlinx.rpc.RpcClient -import kotlinx.rpc.krpc.streamScoped import kotlinx.rpc.withService import kotlinx.rpc.sample.MyService import kotlinx.rpc.sample.UserData class AppViewModel : ViewModel() { - private var rpcClient: RpcClient? = null - private var apiService: MyService? = null + private val rpcClient: RpcClient = createRpcClient() + private val apiService: MyService = rpcClient.withService() private val _uiState = MutableStateFlow(null) val uiState: StateFlow = _uiState init { viewModelScope.launch(Dispatchers.IO) { - rpcClient = createRpcClient() - rpcClient?.let { - apiService = it.withService() - fetchData() - } + fetchData() } } - private fun fetchData() { - viewModelScope.launch(Dispatchers.IO) { - delay(2000) - val greetingDeferred = async { - apiService?.hello( - "Alex", - UserData("Berlin", "Smith") - ) - } - - val serverGreeting = greetingDeferred.await() - - val allNews: MutableList = mutableListOf() - apiService?.subscribeToNews()?.collect { - allNews += it - - val sendNews = allNews.toMutableList() // fix ConcurrentModificationException - serverGreeting?.let { - _uiState.value = WelcomeData(serverGreeting, sendNews) - } - } + private suspend fun CoroutineScope.fetchData() { + delay(2000) + val greetingDeferred = async { + apiService.hello( + "Alex", + UserData("Berlin", "Smith") + ) + } + + val serverGreeting = greetingDeferred.await() + + val allNews: MutableList = mutableListOf() + apiService.subscribeToNews().collect { + allNews += it + + val sendNews = allNews.toMutableList() // fix ConcurrentModificationException + _uiState.value = WelcomeData(serverGreeting, sendNews) } } } diff --git a/samples/ktor-android-app/common/src/main/kotlin/kotlinx/rpc/sample/MyService.kt b/samples/ktor-android-app/common/src/main/kotlin/kotlinx/rpc/sample/MyService.kt index a5bf328a9..4ddc48a38 100644 --- a/samples/ktor-android-app/common/src/main/kotlin/kotlinx/rpc/sample/MyService.kt +++ b/samples/ktor-android-app/common/src/main/kotlin/kotlinx/rpc/sample/MyService.kt @@ -5,11 +5,10 @@ package kotlinx.rpc.sample import kotlinx.coroutines.flow.Flow -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc @Rpc -interface MyService : RemoteService { +interface MyService { suspend fun hello(user: String, userData: UserData): String fun subscribeToNews(): Flow diff --git a/samples/ktor-android-app/gradle/libs.versions.toml b/samples/ktor-android-app/gradle/libs.versions.toml index 994cb9322..1d76e5a6e 100644 --- a/samples/ktor-android-app/gradle/libs.versions.toml +++ b/samples/ktor-android-app/gradle/libs.versions.toml @@ -1,21 +1,21 @@ [versions] -agp = "8.9.1" -kotlin = "2.1.21" +agp = "8.11.0-alpha07" +kotlin = "2.2.0" androidx-activityCompose = "1.10.1" -androidx-appcompat = "1.7.0" +androidx-appcompat = "1.7.1" androidx-constraintlayout = "2.2.1" androidx-core-ktx = "1.16.0" androidx-test-junit = "1.2.1" -compose = "1.7.8" +compose = "1.8.3" compose-plugin = "1.5.14" # https://mvnrepository.com/artifact/androidx.compose.compiler/compiler -compose-bom = "2025.04.00" +compose-bom = "2025.06.01" material3 = "1.3.2" junit = "4.13.2" -ktor = "3.1.2" +ktor = "3.2.0" kotlinx-serialization-json = "1.8.1" kotlinx-coroutines-core = "1.10.2" logback = "1.5.18" -kotlinx-rpc = "0.7.0" +kotlinx-rpc = "0.8.0" [libraries] # kotlin diff --git a/samples/ktor-android-app/gradle/wrapper/gradle-wrapper.jar b/samples/ktor-android-app/gradle/wrapper/gradle-wrapper.jar index 9bbc975c742b298b441bfb90dbc124400a3751b9..1b33c55baabb587c669f562ae36f953de2481846 100644 GIT binary patch delta 642 zcmdmamFde>rVZJA^}0Q$xegf!xPEW^+5YDM%iT2bEgct9o+jH~+sJas#HZ=szO|** z=Pj=X_vx?W&DSwKck|WWn~hffsvnQ+42*W$b7b0$SCcOoZ`{W{^$^pk;4>8-A*-)$ z?n(Po`1$6Jn_u?t-L+tsPyZ2#X}8T6OS8pAU;kdgd+_Hw4z4TW0p9E!T+=f7-c&O% zFic^X{7^$?^Ho04eona9n#mGMxKhA=~8B%JN`M zMhm5wc-2v)$``sY$!Q`9xiU@DhI73ZxiGEKg>yIPs)NmWwMdF-ngLXpZSqV5ez36n zVkxF2rjrjWR+_xr6e6@_u@s~2uv{9vi*1pj2)BjFD+-%@&pRVP1f{O1glxTOp2-62Ph;v z`N1+vCd)9ea)af*Ol1*JCfnp$%Uu}%OuoN7g2}3C@`L5FlP#(sA=|h@iixuZC?qp^ z=L$=v$ZoI}|87Wh=&h7udff{aieKr*l+zDp?pf)_bbRvUf>kn;HCDMXNlgbbo!QRK I1x7am0No)LiU0rr delta 584 zcmexzm1*ZyrVZJAexH5Moc8h7)w{^+t*dqJ%=yhh23L$9JpFV=_k`zJ-?Q4DI*eSe z+ES)HSrVnWLtJ&)lO%hRkV9zl5qqWRt0e;bb zPPo`)y?HTAyZI&u&X<|2$FDHCf4;!v8}p=?Tm`^F0`u(|1ttf~&t$qP3KUSD>@TJQ zRwJ}Pim6NzEc8KA6)e;S6gs8=7IIL8sQL*MYEuRYO;Uj<%3UbMbV&^&!Zvx+LKmjT z8Zch6rYP7Tw?$Hn(UTJwWiS=$f{lB(C=e*%usDV})0AQIK~sat=ND@+Gg*Pyij!rR z*fa02W|%BsV++>4W{DKDGSIUEHd2$P+8ct!RF+CHDowUuTEZOZ%rJSQv*qOXOSPDN zT|sP-$p*_3ncsWB*qoD7JQcyZ9xan%cJP6Tb4-?AZpr*F6v98hoNaPJm@HV`yya5N z))6pqFXn@}P(3T0nEzM8*c_9KtE9o|_pFd&K35GBXP^9Kg(b6GH-z8S4GDzIl~T+b zdLd#meKKHu$5u))8cu$=GKINkGDPOUD)!0$C(BH(U!}!-e;Q0ok8Sc?V1zRO04>ts AA^-pY diff --git a/samples/ktor-android-app/gradle/wrapper/gradle-wrapper.properties b/samples/ktor-android-app/gradle/wrapper/gradle-wrapper.properties index 37f853b1c..ff23a68d7 100644 --- a/samples/ktor-android-app/gradle/wrapper/gradle-wrapper.properties +++ b/samples/ktor-android-app/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/samples/ktor-android-app/gradlew b/samples/ktor-android-app/gradlew index faf93008b..23d15a936 100755 --- a/samples/ktor-android-app/gradlew +++ b/samples/ktor-android-app/gradlew @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/samples/ktor-android-app/gradlew.bat b/samples/ktor-android-app/gradlew.bat index 9d21a2183..db3a6ac20 100644 --- a/samples/ktor-android-app/gradlew.bat +++ b/samples/ktor-android-app/gradlew.bat @@ -70,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/samples/ktor-android-app/server/src/main/kotlin/kotlinx/rpc/sample/Application.kt b/samples/ktor-android-app/server/src/main/kotlin/kotlinx/rpc/sample/Application.kt index 1ac0a6929..68975fcdc 100644 --- a/samples/ktor-android-app/server/src/main/kotlin/kotlinx/rpc/sample/Application.kt +++ b/samples/ktor-android-app/server/src/main/kotlin/kotlinx/rpc/sample/Application.kt @@ -24,7 +24,7 @@ fun Application.module() { } } - registerService { ctx -> MyServiceImpl(ctx) } + registerService { MyServiceImpl() } } } } diff --git a/samples/ktor-android-app/server/src/main/kotlin/kotlinx/rpc/sample/MyServiceImpl.kt b/samples/ktor-android-app/server/src/main/kotlin/kotlinx/rpc/sample/MyServiceImpl.kt index 453dee6f3..76b9e6a16 100644 --- a/samples/ktor-android-app/server/src/main/kotlin/kotlinx/rpc/sample/MyServiceImpl.kt +++ b/samples/ktor-android-app/server/src/main/kotlin/kotlinx/rpc/sample/MyServiceImpl.kt @@ -9,7 +9,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import kotlin.coroutines.CoroutineContext -class MyServiceImpl(override val coroutineContext: CoroutineContext) : MyService { +class MyServiceImpl : MyService { override suspend fun hello(user: String, userData: UserData): String { return "Nice to meet you $user, how is it in ${userData.address}?" } @@ -22,4 +22,4 @@ class MyServiceImpl(override val coroutineContext: CoroutineContext) : MyService } } } -} \ No newline at end of file +} diff --git a/samples/ktor-web-app/common/src/commonMain/kotlin/Common.kt b/samples/ktor-web-app/common/src/commonMain/kotlin/Common.kt index 7618312a1..824f086ef 100644 --- a/samples/ktor-web-app/common/src/commonMain/kotlin/Common.kt +++ b/samples/ktor-web-app/common/src/commonMain/kotlin/Common.kt @@ -3,7 +3,6 @@ */ import kotlinx.coroutines.flow.Flow -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.serialization.Serializable @@ -14,7 +13,7 @@ data class UserData( ) @Rpc -interface MyService : RemoteService { +interface MyService { suspend fun hello(user: String, userData: UserData): String fun subscribeToNews(): Flow diff --git a/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt b/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt index a81cc7440..cc7737f0d 100644 --- a/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt +++ b/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt @@ -2,7 +2,6 @@ * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -import kotlinx.rpc.RpcClient import kotlinx.rpc.withService import react.FC import react.Props @@ -11,20 +10,10 @@ import react.useEffectOnce import react.useState val App = FC { - var rpcClient by useState(null) + val rpcClient = initRpcClient() - useEffectOnce { - rpcClient = initRpcClient() - } - - rpcClient?.also { client -> - AppContainer { - this.apiService = client.withService() - } - } ?: run { - div { - +"Establishing connection..." - } + AppContainer { + apiService = rpcClient.withService() } } diff --git a/samples/ktor-web-app/frontend/src/jsMain/kotlin/RPC.kt b/samples/ktor-web-app/frontend/src/jsMain/kotlin/RPC.kt index 1330b72d2..766bb551e 100644 --- a/samples/ktor-web-app/frontend/src/jsMain/kotlin/RPC.kt +++ b/samples/ktor-web-app/frontend/src/jsMain/kotlin/RPC.kt @@ -11,7 +11,7 @@ import kotlinx.rpc.krpc.ktor.client.rpc import kotlinx.rpc.krpc.ktor.client.rpcConfig import kotlinx.rpc.krpc.serialization.json.json -suspend fun initRpcClient(): RpcClient { +fun initRpcClient(): RpcClient { return HttpClient(Js) { installKrpc() }.rpc { diff --git a/samples/ktor-web-app/gradle/libs.versions.toml b/samples/ktor-web-app/gradle/libs.versions.toml index 152bec720..782dc9fdd 100644 --- a/samples/ktor-web-app/gradle/libs.versions.toml +++ b/samples/ktor-web-app/gradle/libs.versions.toml @@ -1,11 +1,11 @@ [versions] -kotlin = "2.1.21" -kotlin-wrappers-bom = "2025.4.8" -ktor = "3.1.2" +kotlin = "2.2.0" +kotlin-wrappers-bom = "2025.6.11" +ktor = "3.2.0" kotlinx-serialization-json = "1.8.1" kotlinx-coroutines-core = "1.10.2" logback = "1.5.18" -kotlinx-rpc = "0.7.0" +kotlinx-rpc = "0.8.0" [libraries] # kotlin diff --git a/samples/ktor-web-app/gradle/wrapper/gradle-wrapper.jar b/samples/ktor-web-app/gradle/wrapper/gradle-wrapper.jar index 9bbc975c742b298b441bfb90dbc124400a3751b9..1b33c55baabb587c669f562ae36f953de2481846 100644 GIT binary patch delta 642 zcmdmamFde>rVZJA^}0Q$xegf!xPEW^+5YDM%iT2bEgct9o+jH~+sJas#HZ=szO|** z=Pj=X_vx?W&DSwKck|WWn~hffsvnQ+42*W$b7b0$SCcOoZ`{W{^$^pk;4>8-A*-)$ z?n(Po`1$6Jn_u?t-L+tsPyZ2#X}8T6OS8pAU;kdgd+_Hw4z4TW0p9E!T+=f7-c&O% zFic^X{7^$?^Ho04eona9n#mGMxKhA=~8B%JN`M zMhm5wc-2v)$``sY$!Q`9xiU@DhI73ZxiGEKg>yIPs)NmWwMdF-ngLXpZSqV5ez36n zVkxF2rjrjWR+_xr6e6@_u@s~2uv{9vi*1pj2)BjFD+-%@&pRVP1f{O1glxTOp2-62Ph;v z`N1+vCd)9ea)af*Ol1*JCfnp$%Uu}%OuoN7g2}3C@`L5FlP#(sA=|h@iixuZC?qp^ z=L$=v$ZoI}|87Wh=&h7udff{aieKr*l+zDp?pf)_bbRvUf>kn;HCDMXNlgbbo!QRK I1x7am0No)LiU0rr delta 584 zcmexzm1*ZyrVZJAexH5Moc8h7)w{^+t*dqJ%=yhh23L$9JpFV=_k`zJ-?Q4DI*eSe z+ES)HSrVnWLtJ&)lO%hRkV9zl5qqWRt0e;bb zPPo`)y?HTAyZI&u&X<|2$FDHCf4;!v8}p=?Tm`^F0`u(|1ttf~&t$qP3KUSD>@TJQ zRwJ}Pim6NzEc8KA6)e;S6gs8=7IIL8sQL*MYEuRYO;Uj<%3UbMbV&^&!Zvx+LKmjT z8Zch6rYP7Tw?$Hn(UTJwWiS=$f{lB(C=e*%usDV})0AQIK~sat=ND@+Gg*Pyij!rR z*fa02W|%BsV++>4W{DKDGSIUEHd2$P+8ct!RF+CHDowUuTEZOZ%rJSQv*qOXOSPDN zT|sP-$p*_3ncsWB*qoD7JQcyZ9xan%cJP6Tb4-?AZpr*F6v98hoNaPJm@HV`yya5N z))6pqFXn@}P(3T0nEzM8*c_9KtE9o|_pFd&K35GBXP^9Kg(b6GH-z8S4GDzIl~T+b zdLd#meKKHu$5u))8cu$=GKINkGDPOUD)!0$C(BH(U!}!-e;Q0ok8Sc?V1zRO04>ts AA^-pY diff --git a/samples/ktor-web-app/gradle/wrapper/gradle-wrapper.properties b/samples/ktor-web-app/gradle/wrapper/gradle-wrapper.properties index 37f853b1c..ff23a68d7 100644 --- a/samples/ktor-web-app/gradle/wrapper/gradle-wrapper.properties +++ b/samples/ktor-web-app/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/samples/ktor-web-app/gradlew b/samples/ktor-web-app/gradlew index faf93008b..23d15a936 100755 --- a/samples/ktor-web-app/gradlew +++ b/samples/ktor-web-app/gradlew @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/samples/ktor-web-app/gradlew.bat b/samples/ktor-web-app/gradlew.bat index 9d21a2183..db3a6ac20 100644 --- a/samples/ktor-web-app/gradlew.bat +++ b/samples/ktor-web-app/gradlew.bat @@ -70,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/samples/ktor-web-app/server/src/main/kotlin/Application.kt b/samples/ktor-web-app/server/src/main/kotlin/Application.kt index 13b1580cf..fe789c46f 100644 --- a/samples/ktor-web-app/server/src/main/kotlin/Application.kt +++ b/samples/ktor-web-app/server/src/main/kotlin/Application.kt @@ -28,7 +28,7 @@ fun Application.module() { } } - registerService { ctx -> MyServiceImpl(ctx) } + registerService { MyServiceImpl() } } staticResources("/", "/static") { diff --git a/samples/ktor-web-app/server/src/main/kotlin/MyServiceImpl.kt b/samples/ktor-web-app/server/src/main/kotlin/MyServiceImpl.kt index bfaeb660a..1f07766aa 100644 --- a/samples/ktor-web-app/server/src/main/kotlin/MyServiceImpl.kt +++ b/samples/ktor-web-app/server/src/main/kotlin/MyServiceImpl.kt @@ -5,9 +5,8 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow -import kotlin.coroutines.CoroutineContext -class MyServiceImpl(override val coroutineContext: CoroutineContext) : MyService { +class MyServiceImpl : MyService { override suspend fun hello(user: String, userData: UserData): String { return "Nice to meet you $user, how is it in ${userData.address}?" } diff --git a/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt b/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt index 725623e90..1bf295e53 100644 --- a/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt +++ b/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt @@ -8,7 +8,6 @@ import kotlinx.rpc.krpc.ktor.client.installKrpc import kotlinx.rpc.krpc.ktor.client.rpc import kotlinx.rpc.krpc.ktor.client.rpcConfig import kotlinx.rpc.krpc.serialization.json.json -import kotlinx.rpc.krpc.streamScoped import kotlinx.rpc.withService import kotlin.test.Test import kotlin.test.assertEquals diff --git a/samples/simple-ktor-app/build.gradle.kts b/samples/simple-ktor-app/build.gradle.kts index 5483a9a57..b8c9987e2 100644 --- a/samples/simple-ktor-app/build.gradle.kts +++ b/samples/simple-ktor-app/build.gradle.kts @@ -3,10 +3,10 @@ */ plugins { - kotlin("jvm") version "2.1.21" - kotlin("plugin.serialization") version "2.1.21" - id("io.ktor.plugin") version "3.1.2" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.7.0" + kotlin("jvm") version "2.2.0" + kotlin("plugin.serialization") version "2.2.0" + id("io.ktor.plugin") version "3.2.0" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.8.0" } group = "kotlinx.rpc.sample" @@ -28,17 +28,17 @@ kotlin { } dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client:0.7.0") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server:0.7.0") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json:0.7.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-client:0.8.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-server:0.8.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-serialization-json:0.8.0") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client:0.7.0") - implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server:0.7.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-client:0.8.0") + implementation("org.jetbrains.kotlinx:kotlinx-rpc-krpc-ktor-server:0.8.0") implementation("io.ktor:ktor-client-cio") implementation("io.ktor:ktor-server-netty-jvm") implementation("ch.qos.logback:logback-classic:1.5.18") testImplementation("io.ktor:ktor-server-test-host") - testImplementation("org.jetbrains.kotlin:kotlin-test-junit:2.1.21") + testImplementation("org.jetbrains.kotlin:kotlin-test-junit:2.2.0") } diff --git a/samples/simple-ktor-app/gradle/wrapper/gradle-wrapper.jar b/samples/simple-ktor-app/gradle/wrapper/gradle-wrapper.jar index 9bbc975c742b298b441bfb90dbc124400a3751b9..1b33c55baabb587c669f562ae36f953de2481846 100644 GIT binary patch delta 642 zcmdmamFde>rVZJA^}0Q$xegf!xPEW^+5YDM%iT2bEgct9o+jH~+sJas#HZ=szO|** z=Pj=X_vx?W&DSwKck|WWn~hffsvnQ+42*W$b7b0$SCcOoZ`{W{^$^pk;4>8-A*-)$ z?n(Po`1$6Jn_u?t-L+tsPyZ2#X}8T6OS8pAU;kdgd+_Hw4z4TW0p9E!T+=f7-c&O% zFic^X{7^$?^Ho04eona9n#mGMxKhA=~8B%JN`M zMhm5wc-2v)$``sY$!Q`9xiU@DhI73ZxiGEKg>yIPs)NmWwMdF-ngLXpZSqV5ez36n zVkxF2rjrjWR+_xr6e6@_u@s~2uv{9vi*1pj2)BjFD+-%@&pRVP1f{O1glxTOp2-62Ph;v z`N1+vCd)9ea)af*Ol1*JCfnp$%Uu}%OuoN7g2}3C@`L5FlP#(sA=|h@iixuZC?qp^ z=L$=v$ZoI}|87Wh=&h7udff{aieKr*l+zDp?pf)_bbRvUf>kn;HCDMXNlgbbo!QRK I1x7am0No)LiU0rr delta 584 zcmexzm1*ZyrVZJAexH5Moc8h7)w{^+t*dqJ%=yhh23L$9JpFV=_k`zJ-?Q4DI*eSe z+ES)HSrVnWLtJ&)lO%hRkV9zl5qqWRt0e;bb zPPo`)y?HTAyZI&u&X<|2$FDHCf4;!v8}p=?Tm`^F0`u(|1ttf~&t$qP3KUSD>@TJQ zRwJ}Pim6NzEc8KA6)e;S6gs8=7IIL8sQL*MYEuRYO;Uj<%3UbMbV&^&!Zvx+LKmjT z8Zch6rYP7Tw?$Hn(UTJwWiS=$f{lB(C=e*%usDV})0AQIK~sat=ND@+Gg*Pyij!rR z*fa02W|%BsV++>4W{DKDGSIUEHd2$P+8ct!RF+CHDowUuTEZOZ%rJSQv*qOXOSPDN zT|sP-$p*_3ncsWB*qoD7JQcyZ9xan%cJP6Tb4-?AZpr*F6v98hoNaPJm@HV`yya5N z))6pqFXn@}P(3T0nEzM8*c_9KtE9o|_pFd&K35GBXP^9Kg(b6GH-z8S4GDzIl~T+b zdLd#meKKHu$5u))8cu$=GKINkGDPOUD)!0$C(BH(U!}!-e;Q0ok8Sc?V1zRO04>ts AA^-pY diff --git a/samples/simple-ktor-app/gradle/wrapper/gradle-wrapper.properties b/samples/simple-ktor-app/gradle/wrapper/gradle-wrapper.properties index 37f853b1c..ff23a68d7 100644 --- a/samples/simple-ktor-app/gradle/wrapper/gradle-wrapper.properties +++ b/samples/simple-ktor-app/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/samples/simple-ktor-app/gradlew b/samples/simple-ktor-app/gradlew index faf93008b..23d15a936 100755 --- a/samples/simple-ktor-app/gradlew +++ b/samples/simple-ktor-app/gradlew @@ -114,7 +114,7 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar +CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/samples/simple-ktor-app/gradlew.bat b/samples/simple-ktor-app/gradlew.bat index 9d21a2183..db3a6ac20 100644 --- a/samples/simple-ktor-app/gradlew.bat +++ b/samples/simple-ktor-app/gradlew.bat @@ -70,11 +70,11 @@ goto fail :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar +set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/samples/simple-ktor-app/src/main/kotlin/Client.kt b/samples/simple-ktor-app/src/main/kotlin/Client.kt index c62e588c6..78cbeb0a6 100644 --- a/samples/simple-ktor-app/src/main/kotlin/Client.kt +++ b/samples/simple-ktor-app/src/main/kotlin/Client.kt @@ -4,7 +4,6 @@ import io.ktor.client.* import io.ktor.http.* -import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.flow import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking @@ -54,7 +53,6 @@ fun main() = runBlocking { val categories = recognizer.recognizeAll(imageFlow) categories.collect { println("Recognized category: $it") } - recognizer.cancel() ktorClient.close() stateJob.cancel() } diff --git a/samples/simple-ktor-app/src/main/kotlin/ImageRecognizer.kt b/samples/simple-ktor-app/src/main/kotlin/ImageRecognizer.kt index f2ccd0920..676293dab 100644 --- a/samples/simple-ktor-app/src/main/kotlin/ImageRecognizer.kt +++ b/samples/simple-ktor-app/src/main/kotlin/ImageRecognizer.kt @@ -7,10 +7,8 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.map -import kotlinx.rpc.RemoteService import kotlinx.rpc.annotations.Rpc import kotlinx.serialization.Serializable -import kotlin.coroutines.CoroutineContext @Suppress("ArrayInDataClass") @Serializable @@ -26,7 +24,7 @@ enum class Category { } @Rpc -interface ImageRecognizer : RemoteService { +interface ImageRecognizer { fun currentlyProcessedImage(): Flow suspend fun recognize(image: Image): Category @@ -34,7 +32,7 @@ interface ImageRecognizer : RemoteService { fun recognizeAll(images: Flow): Flow } -class ImageRecognizerService(override val coroutineContext: CoroutineContext) : ImageRecognizer { +class ImageRecognizerService : ImageRecognizer { private val _currentlyProcessedImage: MutableStateFlow = MutableStateFlow(null) override fun currentlyProcessedImage(): Flow { diff --git a/samples/simple-ktor-app/src/main/kotlin/Server.kt b/samples/simple-ktor-app/src/main/kotlin/Server.kt index b8fb73b34..7922da367 100644 --- a/samples/simple-ktor-app/src/main/kotlin/Server.kt +++ b/samples/simple-ktor-app/src/main/kotlin/Server.kt @@ -27,7 +27,7 @@ fun Application.module() { } } - registerService { ctx -> ImageRecognizerService(ctx) } + registerService { ImageRecognizerService() } } } } diff --git a/samples/simple-ktor-app/src/test/kotlin/ApplicationTest.kt b/samples/simple-ktor-app/src/test/kotlin/ApplicationTest.kt index 7c3482fed..dfcd499b6 100644 --- a/samples/simple-ktor-app/src/test/kotlin/ApplicationTest.kt +++ b/samples/simple-ktor-app/src/test/kotlin/ApplicationTest.kt @@ -7,13 +7,10 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel import kotlinx.coroutines.launch -import kotlinx.rpc.awaitFieldInitialization import kotlinx.rpc.krpc.ktor.client.installKrpc -import kotlinx.rpc.krpc.ktor.client.installRPC import kotlinx.rpc.krpc.ktor.client.rpc import kotlinx.rpc.krpc.ktor.client.rpcConfig import kotlinx.rpc.krpc.serialization.json.json -import kotlinx.rpc.krpc.streamScoped import kotlinx.rpc.withService import org.junit.Test import kotlin.test.assertContentEquals