File tree Expand file tree Collapse file tree 23 files changed +86
-75
lines changed
composeApp/src/commonMain/kotlin
main/kotlin/kotlinx/rpc/sample
test/kotlin/kotlinx/rpc/sample
app/src/main/kotlin/kotlinx/rpc/sample
main/kotlin/kotlinx/rpc/sample Expand file tree Collapse file tree 23 files changed +86
-75
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "gradle.autoImportOnSave" : false
3+ }
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44
55import androidx.compose.animation.AnimatedVisibility
@@ -14,7 +14,7 @@ import androidx.compose.ui.Alignment
1414import androidx.compose.ui.Modifier
1515import io.ktor.client.*
1616import io.ktor.http.*
17- import kotlinx.rpc.krpc.ktor.client.installRPC
17+ import kotlinx.rpc.krpc.ktor.client.installKrpc
1818import kotlinx.rpc.krpc.ktor.client.rpc
1919import kotlinx.rpc.krpc.ktor.client.rpcConfig
2020import kotlinx.rpc.krpc.serialization.json.json
@@ -28,7 +28,7 @@ expect val DEV_SERVER_HOST: String
2828
2929val client by lazy {
3030 HttpClient {
31- installRPC ()
31+ installKrpc ()
3232 }
3333}
3434
Original file line number Diff line number Diff line change 11[versions ]
2- kotlin = " 2.0.21 "
2+ kotlin = " 2.1.0 "
33
4- agp = " 8.8.0"
4+ agp = " 8.8.0-alpha05 "
55android-compileSdk = " 35"
66android-minSdk = " 24"
77android-targetSdk = " 35"
@@ -13,13 +13,13 @@ androidx-espresso-core = "3.6.1"
1313androidx-material = " 1.12.0"
1414androidx-test-junit = " 1.2.1"
1515compose = " 1.7.6"
16- compose-plugin = " 1.8.0+check "
16+ compose-plugin = " 1.8.0-alpha01 "
1717junit = " 4.13.2"
1818ktor = " 3.0.3"
1919logback = " 1.5.16"
2020serialization = " 1.8.0"
2121coroutines = " 1.10.1"
22- kotlinx-rpc = " 0.4 .0"
22+ kotlinx-rpc = " 0.5 .0"
2323
2424[libraries ]
2525# kotlin
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44
55package kotlinx.rpc.sample
@@ -10,15 +10,15 @@ import io.ktor.server.application.*
1010import io.ktor.server.netty.*
1111import io.ktor.server.plugins.cors.routing.*
1212import io.ktor.server.routing.*
13- import kotlinx.rpc.krpc.ktor.server.RPC
13+ import kotlinx.rpc.krpc.ktor.server.Krpc
1414import kotlinx.rpc.krpc.ktor.server.rpc
1515import kotlinx.rpc.krpc.serialization.json.json
1616
1717fun main (args : Array <String >): Unit = EngineMain .main(args)
1818
1919@Suppress(" unused" )
2020fun Application.module () {
21- install(RPC )
21+ install(Krpc )
2222
2323 installCORS()
2424
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44
55package kotlinx.rpc.sample
@@ -8,7 +8,7 @@ import UserData
88import UserService
99import io.ktor.server.testing.*
1010import kotlinx.coroutines.flow.toList
11- import kotlinx.rpc.krpc.ktor.client.installRPC
11+ import kotlinx.rpc.krpc.ktor.client.installKrpc
1212import kotlinx.rpc.krpc.ktor.client.rpc
1313import kotlinx.rpc.krpc.ktor.client.rpcConfig
1414import kotlinx.rpc.krpc.serialization.json.json
@@ -21,7 +21,7 @@ class ApplicationTest {
2121 @Test
2222 fun testRoot () = testApplication {
2323 val service = createClient {
24- installRPC ()
24+ installKrpc ()
2525 }.rpc(" /api" ) {
2626 rpcConfig {
2727 serialization {
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44
55@file:Suppress(" UnstableApiUsage" )
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44
55package kotlinx.rpc.sample.data
66
77import io.ktor.client.HttpClient
88import io.ktor.client.engine.okhttp.OkHttp
99import io.ktor.client.request.url
10- import kotlinx.rpc.RPCClient
11- import kotlinx.rpc.krpc.ktor.client.installRPC
10+ import kotlinx.rpc.RpcClient
11+ import kotlinx.rpc.krpc.ktor.client.installKrpc
1212import kotlinx.rpc.krpc.ktor.client.rpc
1313import kotlinx.rpc.krpc.ktor.client.rpcConfig
1414import kotlinx.rpc.krpc.serialization.json.json
1515
16- suspend fun createRpcClient (): RPCClient {
16+ suspend fun createRpcClient (): RpcClient {
1717 return HttpClient (OkHttp ) {
18- installRPC ()
18+ installKrpc ()
1919 }.rpc {
2020 url(" ws://10.0.2.2:8080/api" )
2121
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44
55package kotlinx.rpc.sample.ui
@@ -14,14 +14,14 @@ import kotlinx.coroutines.delay
1414import kotlinx.coroutines.flow.MutableStateFlow
1515import kotlinx.coroutines.flow.StateFlow
1616import kotlinx.coroutines.launch
17- import kotlinx.rpc.RPCClient
17+ import kotlinx.rpc.RpcClient
1818import kotlinx.rpc.krpc.streamScoped
1919import kotlinx.rpc.withService
2020import kotlinx.rpc.sample.MyService
2121import kotlinx.rpc.sample.UserData
2222
2323class AppViewModel : ViewModel () {
24- private var rpcClient: RPCClient ? = null
24+ private var rpcClient: RpcClient ? = null
2525 private var apiService: MyService ? = null
2626
2727 private val _uiState = MutableStateFlow <WelcomeData ?>(null )
@@ -64,4 +64,4 @@ class AppViewModel : ViewModel() {
6464 }
6565 }
6666 }
67- }
67+ }
Original file line number Diff line number Diff line change 11[versions ]
22agp = " 8.8.0"
3- kotlin = " 2.0.21 "
3+ kotlin = " 2.1.0 "
44androidx-activityCompose = " 1.9.3"
55androidx-appcompat = " 1.7.0"
66androidx-constraintlayout = " 2.2.0"
@@ -15,7 +15,7 @@ ktor = "3.0.3"
1515kotlinx-serialization-json = " 1.8.0"
1616kotlinx-coroutines-core = " 1.10.1"
1717logback = " 1.5.16"
18- kotlinx-rpc = " 0.4 .0"
18+ kotlinx-rpc = " 0.5 .0"
1919
2020[libraries ]
2121# kotlin
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44package kotlinx.rpc.sample
55
66import io.ktor.server.application.*
77import io.ktor.server.cio.*
88import io.ktor.server.routing.*
9- import io. ktor.server.websocket.*
9+ import kotlinx.rpc.krpc. ktor.server.Krpc
1010import kotlinx.rpc.krpc.ktor.server.rpc
1111import kotlinx.rpc.krpc.serialization.json.json
1212
1313fun main (args : Array <String >): Unit = EngineMain .main(args)
1414
1515@Suppress(" unused" )
1616fun Application.module () {
17- install(WebSockets )
17+ install(Krpc )
1818
1919 routing {
2020 rpc(" /api" ) {
You can’t perform that action at this time.
0 commit comments