diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a7ff94ad..512eea09 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.2.2' + CONFIG_JSON_VERSION: '0.2.4' jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index c48e3acf..3a32aad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,23 @@ +# 0.2.4 +> Published 20 August 2024 + +### Features +* KRPC-18 Add K2 and IR code generation plugins, preserve KSP for K1 by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/105 +* Added 1.9.25 and 2.0.10 Kotlin Versions by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/168 + +### Bug fixes +* KRPC-101 Check if the entire stream is not already closed. by @pikinier20 in https://github.com/Kotlin/kotlinx-rpc/pull/158 +* KRPC-119 Exception Deserialization by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/170 +* Fix compilation on Kotlin/Native by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/172 + +### Infra +* Add issue templates by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/167 + +## New Contributors +* @pikinier20 made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/158 + +**Full Changelog**: https://github.com/Kotlin/kotlinx-rpc/compare/0.2.2...0.2.4 + # 0.2.2 > Published 5 August 2024 diff --git a/README.md b/README.md index c154d651..eb044679 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Example of plugins setup in a project's `build.gradle.kts`: plugins { kotlin("jvm") version "2.0.10" kotlin("plugin.serialization") version "2.0.10" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.2" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.4" } ``` @@ -106,7 +106,7 @@ plugins { kotlin("jvm") version "1.9.25" kotlin("plugin.serialization") version "1.9.25" id("com.google.devtools.ksp") version "1.9.25-1.0.20" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.2" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.4" } ``` ### Runtime dependencies @@ -166,11 +166,11 @@ based on the project's Kotlin version: ```kotlin plugins { kotlin("jvm") version "2.0.10" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.2" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.4" } dependencies { - // version 0.2.2 is set by the Gradle plugin + // version 0.2.4 is set by the Gradle plugin implementation("org.jetbrains.kotlinx:kotlinx-rpc-core") } ``` diff --git a/docs/pages/kotlinx-rpc/.idea/.gitignore b/docs/pages/kotlinx-rpc/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/docs/pages/kotlinx-rpc/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/docs/pages/kotlinx-rpc/.idea/vcs.xml b/docs/pages/kotlinx-rpc/.idea/vcs.xml new file mode 100644 index 00000000..c2365ab1 --- /dev/null +++ b/docs/pages/kotlinx-rpc/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/docs/pages/kotlinx-rpc/help-versions.json b/docs/pages/kotlinx-rpc/help-versions.json index 83931531..0d021e7f 100644 --- a/docs/pages/kotlinx-rpc/help-versions.json +++ b/docs/pages/kotlinx-rpc/help-versions.json @@ -1,3 +1,3 @@ [ - {"version":"0.2.2","url":"/kotlinx-rpc/0.2.2/","isCurrent":true} + {"version":"0.2.4","url":"/kotlinx-rpc/0.2.4/","isCurrent":true} ] diff --git a/docs/pages/kotlinx-rpc/rpc.tree b/docs/pages/kotlinx-rpc/rpc.tree index 78de9b6b..034df82a 100644 --- a/docs/pages/kotlinx-rpc/rpc.tree +++ b/docs/pages/kotlinx-rpc/rpc.tree @@ -26,6 +26,7 @@ + \ No newline at end of file diff --git a/docs/pages/kotlinx-rpc/topics/0-2-4.topic b/docs/pages/kotlinx-rpc/topics/0-2-4.topic new file mode 100644 index 00000000..b3c79c55 --- /dev/null +++ b/docs/pages/kotlinx-rpc/topics/0-2-4.topic @@ -0,0 +1,59 @@ + + + + + + +

+ Version 0.2.4 does introduce any breaking changes. + However, it includes some updates that may require additional modifications in user projects. +

+ + If your project uses Kotlin 2.0, + you are no longer required to add KSP Gradle plugin to your build files: + + plugins { + kotlin("jvm") version "2.0.10" + kotlin("plugin.serialization") version "2.0.10" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.4" + + // KSP can be removed + // id("com.google.devtools.ksp") version "2.0.10-1.0.24" + } + + This change brings one more benefit: + without KSP, projects that use kotlinx.rpc + can now use Gradle configuration + caches. + + + Some client APIs were moved from kotlinx-rpc-krpc-client artifact (and package) + into kotlinx-rpc-core module (and package). These APIs are not kRPC specific hence the move. +

List of API changes:

+ + + + + + + + + + + + + + + + + +
0.2.20.2.4
kotlinx.rpc.client.withServicekotlinx.rpc.withService
kotlinx.rpc.client.awaitFieldInitializationkotlinx.rpc.awaitFieldInitialization
kotlinx.rpc.client.UninitializedRPCFieldExceptionkotlinx.rpc.UninitializedRPCFieldException
+ Old declaration and marked with @Deprecated(WARNING) + and will be removed in 2 minor releases. +
+
\ No newline at end of file diff --git a/docs/pages/kotlinx-rpc/v.list b/docs/pages/kotlinx-rpc/v.list index 189b7823..77e277ce 100644 --- a/docs/pages/kotlinx-rpc/v.list +++ b/docs/pages/kotlinx-rpc/v.list @@ -14,7 +14,7 @@ - + diff --git a/docs/pages/kotlinx-rpc/writerside.cfg b/docs/pages/kotlinx-rpc/writerside.cfg index bf45ad84..6469bf23 100644 --- a/docs/pages/kotlinx-rpc/writerside.cfg +++ b/docs/pages/kotlinx-rpc/writerside.cfg @@ -12,5 +12,5 @@ - + \ No newline at end of file diff --git a/samples/ktor-all-platforms-app/build.gradle.kts b/samples/ktor-all-platforms-app/build.gradle.kts index 5f6f972f..1889de65 100644 --- a/samples/ktor-all-platforms-app/build.gradle.kts +++ b/samples/ktor-all-platforms-app/build.gradle.kts @@ -13,5 +13,5 @@ plugins { alias(libs.plugins.kotlinPluginSerialization) apply false alias(libs.plugins.kotlinx.rpc) apply false alias(libs.plugins.kotlinx.rpc.platform) apply false - alias(libs.plugins.ksp) apply false + alias(libs.plugins.compose.compiler) apply false } diff --git a/samples/ktor-all-platforms-app/composeApp/build.gradle.kts b/samples/ktor-all-platforms-app/composeApp/build.gradle.kts index 47087793..23da170c 100644 --- a/samples/ktor-all-platforms-app/composeApp/build.gradle.kts +++ b/samples/ktor-all-platforms-app/composeApp/build.gradle.kts @@ -8,6 +8,7 @@ plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidApplication) alias(libs.plugins.jetbrainsCompose) + alias(libs.plugins.compose.compiler) alias(libs.plugins.kotlinx.rpc.platform) } 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 700b074f..883783ca 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 @@ -14,7 +14,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import io.ktor.client.* import io.ktor.http.* -import kotlinx.rpc.client.withService +import kotlinx.rpc.withService import kotlinx.rpc.serialization.json import kotlinx.rpc.streamScoped import kotlinx.rpc.transport.ktor.client.installRPC diff --git a/samples/ktor-all-platforms-app/gradle/libs.versions.toml b/samples/ktor-all-platforms-app/gradle/libs.versions.toml index a8605136..4e2b6819 100644 --- a/samples/ktor-all-platforms-app/gradle/libs.versions.toml +++ b/samples/ktor-all-platforms-app/gradle/libs.versions.toml @@ -1,6 +1,5 @@ [versions] -kotlin = "1.9.24" -ksp = "1.9.24-1.0.20" +kotlin = "2.0.10" agp = "8.2.0" android-compileSdk = "34" @@ -20,7 +19,7 @@ ktor = "2.3.11" logback = "1.5.6" kotlinx-serialization-json = "1.6.3" kotlinx-coroutines-core = "1.8.1" -kotlinx-rpc = "0.2.2" +kotlinx-rpc = "0.2.4" [libraries] # kotlin @@ -75,10 +74,10 @@ junit = { group = "junit", name = "junit", version.ref = "junit" } androidApplication = { id = "com.android.application", version.ref = "agp" } androidLibrary = { id = "com.android.library", version.ref = "agp" } jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } kotlinPluginSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } ktor = { id = "io.ktor.plugin", version.ref = "ktor" } kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } kotlinx-rpc = { id = "org.jetbrains.kotlinx.rpc.plugin", version.ref = "kotlinx-rpc" } kotlinx-rpc-platform = { id = "org.jetbrains.kotlinx.rpc.platform", version.ref = "kotlinx-rpc" } -ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } 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 2244d79d..23107bef 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 @@ -8,7 +8,7 @@ import UserData import UserService import io.ktor.server.testing.* import kotlinx.coroutines.flow.toList -import kotlinx.rpc.client.withService +import kotlinx.rpc.withService import kotlinx.rpc.serialization.json import kotlinx.rpc.streamScoped import kotlinx.rpc.transport.ktor.client.installRPC diff --git a/samples/ktor-all-platforms-app/shared/build.gradle.kts b/samples/ktor-all-platforms-app/shared/build.gradle.kts index f24339af..6c90bb68 100644 --- a/samples/ktor-all-platforms-app/shared/build.gradle.kts +++ b/samples/ktor-all-platforms-app/shared/build.gradle.kts @@ -5,7 +5,6 @@ plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidLibrary) - alias(libs.plugins.ksp) alias(libs.plugins.kotlinx.rpc) alias(libs.plugins.kotlinPluginSerialization) } diff --git a/samples/ktor-android-app/app/build.gradle.kts b/samples/ktor-android-app/app/build.gradle.kts index bfdf4bbe..185a3f7f 100644 --- a/samples/ktor-android-app/app/build.gradle.kts +++ b/samples/ktor-android-app/app/build.gradle.kts @@ -6,8 +6,8 @@ plugins { alias(libs.plugins.androidApplication) alias(libs.plugins.kotlinAndroid) alias(libs.plugins.kotlinPluginSerialization) - alias(libs.plugins.ksp) alias(libs.plugins.kotlinx.rpc.platform) + alias(libs.plugins.compose.compiler) } android { 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 ef9eef12..fe4de267 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 @@ -16,7 +16,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.launch import kotlinx.rpc.RPCClient import kotlinx.rpc.streamScoped -import kotlinx.rpc.client.withService +import kotlinx.rpc.withService import kotlinx.rpc.sample.MyService import kotlinx.rpc.sample.UserData diff --git a/samples/ktor-android-app/build.gradle.kts b/samples/ktor-android-app/build.gradle.kts index 610e2969..e0d7b9c8 100644 --- a/samples/ktor-android-app/build.gradle.kts +++ b/samples/ktor-android-app/build.gradle.kts @@ -6,4 +6,5 @@ plugins { alias(libs.plugins.androidApplication) apply false alias(libs.plugins.kotlinAndroid) apply false alias(libs.plugins.kotlinJvm) apply false + alias(libs.plugins.compose.compiler) apply false } \ No newline at end of file diff --git a/samples/ktor-android-app/common/build.gradle.kts b/samples/ktor-android-app/common/build.gradle.kts index 176a9d92..ea6a79c3 100644 --- a/samples/ktor-android-app/common/build.gradle.kts +++ b/samples/ktor-android-app/common/build.gradle.kts @@ -5,7 +5,6 @@ plugins { alias(libs.plugins.kotlinJvm) alias(libs.plugins.kotlinPluginSerialization) - alias(libs.plugins.ksp) alias(libs.plugins.ktor) alias(libs.plugins.kotlinx.rpc) } diff --git a/samples/ktor-android-app/gradle/libs.versions.toml b/samples/ktor-android-app/gradle/libs.versions.toml index d198a6e6..3b48935f 100644 --- a/samples/ktor-android-app/gradle/libs.versions.toml +++ b/samples/ktor-android-app/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] agp = "8.1.3" -kotlin = "1.9.24" +kotlin = "2.0.10" androidx-activityCompose = "1.8.2" androidx-appcompat = "1.6.1" androidx-constraintlayout = "2.1.4" @@ -14,8 +14,7 @@ ktor = "2.3.11" kotlinx-serialization-json = "1.6.1" kotlinx-coroutines-core = "1.8.1" logback = "1.5.6" -kotlinx-rpc = "0.2.2" -ksp = "1.9.24-1.0.20" +kotlinx-rpc = "0.2.4" [libraries] # kotlin @@ -77,7 +76,7 @@ androidApplication = { id = "com.android.application", version.ref = "agp" } kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlinPluginSerialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } -ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } kotlinx-rpc = { id = "org.jetbrains.kotlinx.rpc.plugin", version.ref = "kotlinx-rpc" } kotlinx-rpc-platform = { id = "org.jetbrains.kotlinx.rpc.platform", version.ref = "kotlinx-rpc" } ktor = { id = "io.ktor.plugin", version.ref = "ktor" } \ No newline at end of file diff --git a/samples/ktor-android-app/server/build.gradle.kts b/samples/ktor-android-app/server/build.gradle.kts index a07fd9b9..cbbd31ef 100644 --- a/samples/ktor-android-app/server/build.gradle.kts +++ b/samples/ktor-android-app/server/build.gradle.kts @@ -5,7 +5,6 @@ plugins { alias(libs.plugins.kotlinJvm) alias(libs.plugins.kotlinPluginSerialization) - alias(libs.plugins.ksp) alias(libs.plugins.ktor) alias(libs.plugins.kotlinx.rpc.platform) diff --git a/samples/ktor-android-app/server/src/test/kotlin/ApplicationTest.kt b/samples/ktor-android-app/server/src/test/kotlin/ApplicationTest.kt index 470b973b..aa0f4108 100644 --- a/samples/ktor-android-app/server/src/test/kotlin/ApplicationTest.kt +++ b/samples/ktor-android-app/server/src/test/kotlin/ApplicationTest.kt @@ -10,7 +10,7 @@ import io.ktor.server.response.* import io.ktor.server.routing.* import io.ktor.server.testing.* import kotlinx.coroutines.flow.toList -import kotlinx.rpc.client.withService +import kotlinx.rpc.withService import kotlinx.rpc.sample.MyService import kotlinx.rpc.sample.UserData import kotlinx.rpc.serialization.json diff --git a/samples/ktor-web-app/common/build.gradle.kts b/samples/ktor-web-app/common/build.gradle.kts index 9e34b692..b696cbaa 100644 --- a/samples/ktor-web-app/common/build.gradle.kts +++ b/samples/ktor-web-app/common/build.gradle.kts @@ -6,7 +6,6 @@ plugins { alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.kotlin.plugin.serialization) alias(libs.plugins.kotlinx.rpc) - alias(libs.plugins.ksp) } kotlin { 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 1f474b03..adad6e46 100644 --- a/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt +++ b/samples/ktor-web-app/frontend/src/jsMain/kotlin/App.kt @@ -4,7 +4,7 @@ import kotlinx.coroutines.flow.flow import kotlinx.rpc.RPCClient -import kotlinx.rpc.client.withService +import kotlinx.rpc.withService import kotlinx.rpc.streamScoped import react.FC import react.Props diff --git a/samples/ktor-web-app/gradle/libs.versions.toml b/samples/ktor-web-app/gradle/libs.versions.toml index e55d0b04..3e8b3328 100644 --- a/samples/ktor-web-app/gradle/libs.versions.toml +++ b/samples/ktor-web-app/gradle/libs.versions.toml @@ -1,12 +1,11 @@ [versions] -kotlin = "1.9.24" +kotlin = "2.0.10" kotlin-wrappers-bom = "1.0.0-pre.747" ktor = "2.3.11" kotlinx-serialization-json = "1.6.1" kotlinx-coroutines-core = "1.8.1" logback = "1.5.6" -kotlinx-rpc = "0.2.2" -ksp = "1.9.24-1.0.20" +kotlinx-rpc = "0.2.4" [libraries] # kotlin @@ -55,4 +54,3 @@ kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlinx-rpc = { id = "org.jetbrains.kotlinx.rpc.plugin", version.ref = "kotlinx-rpc" } kotlinx-rpc-platform = { id = "org.jetbrains.kotlinx.rpc.platform", version.ref = "kotlinx-rpc" } -ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } 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 7ccf4fdd..3b54ea23 100644 --- a/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt +++ b/samples/ktor-web-app/server/src/test/kotlin/ApplicationTest.kt @@ -4,7 +4,7 @@ import io.ktor.server.testing.* import kotlinx.coroutines.flow.toList -import kotlinx.rpc.client.withService +import kotlinx.rpc.withService import kotlinx.rpc.serialization.json import kotlinx.rpc.streamScoped import kotlinx.rpc.transport.ktor.client.installRPC diff --git a/samples/simple-ktor-app/build.gradle.kts b/samples/simple-ktor-app/build.gradle.kts index 129fd863..430bd59e 100644 --- a/samples/simple-ktor-app/build.gradle.kts +++ b/samples/simple-ktor-app/build.gradle.kts @@ -3,11 +3,10 @@ */ plugins { - kotlin("jvm") version "1.9.24" - kotlin("plugin.serialization") version "1.9.24" + kotlin("jvm") version "2.0.10" + kotlin("plugin.serialization") version "2.0.10" id("io.ktor.plugin") version "2.3.11" - id("com.google.devtools.ksp") version "1.9.24-1.0.20" - id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.2" + id("org.jetbrains.kotlinx.rpc.plugin") version "0.2.4" } val kotlin_version: String by project diff --git a/samples/simple-ktor-app/src/main/kotlin/Client.kt b/samples/simple-ktor-app/src/main/kotlin/Client.kt index 111220a4..d8f3d0da 100644 --- a/samples/simple-ktor-app/src/main/kotlin/Client.kt +++ b/samples/simple-ktor-app/src/main/kotlin/Client.kt @@ -9,7 +9,7 @@ import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.flow import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking -import kotlinx.rpc.client.withService +import kotlinx.rpc.withService import kotlinx.rpc.serialization.json import kotlinx.rpc.streamScoped import kotlinx.rpc.transport.ktor.client.rpc diff --git a/samples/simple-ktor-app/src/test/kotlin/ApplicationTest.kt b/samples/simple-ktor-app/src/test/kotlin/ApplicationTest.kt index dc4054ec..f8117039 100644 --- a/samples/simple-ktor-app/src/test/kotlin/ApplicationTest.kt +++ b/samples/simple-ktor-app/src/test/kotlin/ApplicationTest.kt @@ -8,7 +8,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel import kotlinx.coroutines.launch import kotlinx.rpc.client.awaitFieldInitialization -import kotlinx.rpc.client.withService +import kotlinx.rpc.withService import kotlinx.rpc.serialization.json import kotlinx.rpc.transport.ktor.client.installRPC import kotlinx.rpc.transport.ktor.client.rpc diff --git a/versions-root/libs.versions.toml b/versions-root/libs.versions.toml index 0164baae..27a21d14 100644 --- a/versions-root/libs.versions.toml +++ b/versions-root/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # core library version -kotlinx-rpc = "0.2.2" +kotlinx-rpc = "0.2.4" # kotlin kotlin-lang = "2.0.10"