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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.4'
CONFIG_JSON_VERSION: '0.3.0'

jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ build
!.idea/detekt.xml
!.idea/kotlinTestDataPluginTestDataPaths.xml

samples/**/.idea/*

.DS_Store

# Ignore generated Detekt reports
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# 0.3.0
> Published 27 September 2024

### Features 🎉
* Wasm Support by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/190

### Breaking Changes 🔴
* Move kRPC declarations from core by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/186

### Bug fixes 🐛
* Fix kotlin/js code and samples by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/179
* Fix regression of nested declarations in RPC interfaces by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/181

### Documentation 📗
* Wording fixes by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/175

### Infra 🚧
* Infra enhancements by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/206
* Fixed Wasm Publication by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/208
* Update renovate configs by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/185
* Configure JPMS checks by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/187
* Update some ide configs by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/188
* Added Gradle Doctor to the build by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/189
* Added build cache and develocity plugin by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/192
* Support variable Kotlin and project versions by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/201
* Update renovate and some deps by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/198

### Other Changes 🧹
* Bump version to 0.3.0-SNAPSHOT by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/174
* Fix compiler tests after #172 by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/180
* Remove unused and inactive annotation by @kez-lab in https://github.com/Kotlin/kotlinx-rpc/pull/182
* Use built-in JsClass getter by @Mr3zee in https://github.com/Kotlin/kotlinx-rpc/pull/184
* Update actions/configure-pages action to v5 by @renovate in https://github.com/Kotlin/kotlinx-rpc/pull/200
* Update Samples dependencies by @renovate in https://github.com/Kotlin/kotlinx-rpc/pull/199
* Update Core dependencies (non-major) by @renovate in https://github.com/Kotlin/kotlinx-rpc/pull/194
* Update Core dependencies (non-major) by @renovate in https://github.com/Kotlin/kotlinx-rpc/pull/205

## New Contributors
* @kez-lab made their first contribution in https://github.com/Kotlin/kotlinx-rpc/pull/182

**Full Changelog**: https://github.com/Kotlin/kotlinx-rpc/compare/0.2.4...0.3.0

# 0.2.4
> Published 20 August 2024

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.4"
id("org.jetbrains.kotlinx.rpc.plugin") version "0.3.0"
}
```

Expand All @@ -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.4"
id("org.jetbrains.kotlinx.rpc.plugin") version "0.3.0"
}
```
### Runtime dependencies
Expand Down Expand Up @@ -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.4"
id("org.jetbrains.kotlinx.rpc.plugin") version "0.3.0"
}

dependencies {
// version 0.2.4 is set by the Gradle plugin
// version 0.3.0 is set by the Gradle plugin
implementation("org.jetbrains.kotlinx:kotlinx-rpc-core")
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/kotlinx-rpc/help-versions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[
{"version":"0.2.4","url":"/kotlinx-rpc/0.2.4/","isCurrent":true}
{"version":"0.3.0","url":"/kotlinx-rpc/0.3.0/","isCurrent":true}
]
2 changes: 1 addition & 1 deletion docs/pages/kotlinx-rpc/v.list
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<var name="host" value="https://kotlin.github.io"/>

<!-- Library versions -->
<var name="kotlinx-rpc-version" value="0.2.4"/>
<var name="kotlinx-rpc-version" value="0.3.0"/>
<var name="kotlin-version" value="2.0.10"/>
<var name="ksp-version" value="1.9.25-1.0.20"/>
</vars>
4 changes: 2 additions & 2 deletions docs/pages/kotlinx-rpc/writerside.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
<images dir="images" web-path="images/"/>
<categories src="c.list"/>
<vars src="v.list"/>
<instance src="rpc.tree" version="0.2.4" web-path="/kotlinx-rpc/"/>
</ihp>
<instance src="rpc.tree" version="0.3.0" web-path="/kotlinx-rpc/"/>
</ihp>
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ develocity {
val startParameter = gradle.startParameter
val scanJournal = File(settingsDir, "scan-journal.log")

server = DEVELOCITY_SERVER
server.set(DEVELOCITY_SERVER)

buildScan {
uploadInBackground = !isCIRun
uploadInBackground.set(!isCIRun)

// obfuscate NIC since we don't want to expose user real IP (will be relevant without VPN)
obfuscation {
ipAddresses { addresses -> addresses.map { _ -> "0.0.0.0" } }
}

capture {
fileFingerprints = true
fileFingerprints.set(true)
}

buildScanPublished {
Expand Down
36 changes: 36 additions & 0 deletions gradle-conventions-settings/empty/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

import java.io.File
import java.nio.file.Files
import java.nio.file.Path

plugins {
alias(libs.plugins.gradle.kotlin.dsl)
}

fun Path.name() = fileName?.toString().orEmpty()

fun filterDirectory(sourceSetPath: Path, filter: (Path) -> Boolean): List<File> {
return Files.newDirectoryStream(sourceSetPath).use { it.toList() }.filter(filter).map { it.toFile() }
}

val pluginsSource: Path = layout.projectDirectory.dir("../develocity/src/main/kotlin").asFile.toPath()

val plugins = filterDirectory(pluginsSource) {
Files.isRegularFile(it) && it.name().endsWith(".settings.gradle.kts")
}.map { it.name.substringBefore('.') }

plugins.forEach { name ->
gradlePlugin {
plugins {
create(name) {
id = name
implementationClass = "EmptySettingsPlugin"
}
}

logger.info("Applied $name precompiled plugin as stub")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

// Do not delete this. It is used as a stub plugin for latest-only plugins
8 changes: 7 additions & 1 deletion gradle-conventions-settings/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ rootProject.name = "gradle-conventions-settings"
// Code below is a hack because a chicken-egg problem, I can't use myself as a settings-plugin
apply(from = "src/main/kotlin/settings-conventions.settings.gradle.kts")

include(":develocity")
val kotlinVersion: KotlinVersion by extra

if (kotlinVersion.isAtLeast(1, 9, 0)) {
include(":develocity")
} else {
include(":empty")
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ the<KoverProjectExtension>().apply {
total {
html {
onCheck.set(false)
charset.set("UTF_8")
charset.set("UTF-8")
htmlDir.set(rootDir.resolve("kover"))
}

Expand Down
11 changes: 11 additions & 0 deletions samples/ktor-all-platforms-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ plugins {
alias(libs.plugins.kotlinx.rpc.platform) apply false
alias(libs.plugins.compose.compiler) apply false
}

allprojects {
configurations.all {
resolutionStrategy {
// Workaround for https://youtrack.jetbrains.com/issue/CMP-6658
force(libs.kotlinx.serialization.core)
force(libs.kotlinx.serialization.json)
force(libs.kotlin.stdlib)
}
}
}
31 changes: 30 additions & 1 deletion samples/ktor-all-platforms-app/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
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 {
alias(libs.plugins.kotlinMultiplatform)
Expand All @@ -15,6 +17,24 @@ plugins {
}

kotlin {
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = "composeApp"
browser {
val projectDirPath = project.projectDir.path
commonWebpackConfig {
outputFileName = "composeApp.js"
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(projectDirPath)
}
}
}
}
binaries.executable()
}

androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
Expand Down Expand Up @@ -53,12 +73,21 @@ kotlin {
implementation(libs.kotlinx.rpc.krpc.client)
implementation(libs.kotlinx.rpc.krpc.serialization.json)
implementation(libs.kotlinx.rpc.krpc.ktor.client)
implementation(libs.ktor.client.cio)
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.websockets)
}
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
implementation(libs.ktor.client.cio)
}
iosMain.dependencies {
implementation(libs.ktor.client.cio)
}
wasmJsMain.dependencies {
implementation(libs.ktor.client.js)
}
androidMain.dependencies {
implementation(libs.ktor.client.cio)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import io.ktor.client.*
import io.ktor.http.*
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 kotlinx.rpc.serialization.json
import kotlinx.rpc.streamScoped
import kotlinx.rpc.transport.ktor.client.installRPC
import kotlinx.rpc.transport.ktor.client.rpc
import kotlinx.rpc.transport.ktor.client.rpcConfig
import ktor_all_platforms_app.composeapp.generated.resources.Res
import ktor_all_platforms_app.composeapp.generated.resources.compose_multiplatform
import org.jetbrains.compose.resources.painterResource
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
actual val DEV_SERVER_HOST: String = "127.0.0.1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import App
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.ComposeViewport
import kotlinx.browser.document

@OptIn(ExperimentalComposeUiApi::class)
fun main() {
ComposeViewport(document.body!!) {
App()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ktor-all-platforms-app</title>
<link type="text/css" rel="stylesheet" href="styles.css">
<script type="application/javascript" src="composeApp.js"></script>
</head>
<body>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
17 changes: 9 additions & 8 deletions samples/ktor-all-platforms-app/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ androidx-test-junit = "1.2.1"
compose = "1.7.2"
compose-plugin = "1.6.11"
junit = "4.13.2"
ktor = "2.3.12"
ktor = "3.0.0-rc-1"
logback = "1.5.8"
kotlinx-serialization-json = "1.7.1"
kotlinx-coroutines-core = "1.9.0"
kotlinx-rpc = "0.2.4"
serialization = "1.7.1"
coroutines = "1.9.0"
kotlinx-rpc = "0.3.0"

[libraries]
# kotlin
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }

Expand All @@ -40,21 +41,21 @@ compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref =
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }

# kotlinx
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines-core" }
kotlinx-coroutines-core-jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm", version.ref = "kotlinx-coroutines-core" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "serialization" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }

# ktor
ktor-server-core = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" }
ktor-server-netty = { module = "io.ktor:ktor-server-netty-jvm", version.ref = "ktor" }
ktor-server-tests = { module = "io.ktor:ktor-server-tests-jvm", version.ref = "ktor" }
ktor-server-cors-jvm = { module = "io.ktor:ktor-server-cors-jvm", version.ref = "ktor" }
ktor-server-websockets-jvm = { module = "io.ktor:ktor-server-websockets-jvm", version.ref = "ktor" }
ktor-server-host-common-jvm = { module = "io.ktor:ktor-server-host-common-jvm", version.ref = "ktor" }
ktor-server-test-host = { module = "io.ktor:ktor-server-test-host", version.ref = "ktor" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }

# kotlinx-rpc
kotlinx-rpc-core = { module = "org.jetbrains.kotlinx:kotlinx-rpc-core" }
Expand Down
4 changes: 2 additions & 2 deletions samples/ktor-all-platforms-app/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ application {

dependencies {
implementation(projects.shared)
implementation(libs.kotlinx.coroutines.core.jvm)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.logback)
implementation(libs.ktor.server.core)
implementation(libs.ktor.server.netty)
Expand All @@ -28,7 +28,7 @@ dependencies {
implementation(libs.kotlinx.rpc.krpc.server)
implementation(libs.kotlinx.rpc.krpc.serialization.json)
implementation(libs.kotlinx.rpc.krpc.ktor.server)
testImplementation(libs.ktor.server.tests)
testImplementation(libs.ktor.server.test.host)
testImplementation(libs.kotlinx.rpc.krpc.client)
testImplementation(libs.kotlinx.rpc.krpc.ktor.client)
testImplementation(libs.kotlin.test.junit)
Expand Down
Loading