Skip to content

Commit 0ef7a1e

Browse files
authored
Add wasmJs support (#31)
* Add `wasmJs` support - Closes #30 * Update ABI * Fix warning * Extract dependencies to toml * Fix compiler warnings * Update CHANGELOG
1 parent dbcd919 commit 0ef7a1e

File tree

7 files changed

+31
-12
lines changed

7 files changed

+31
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ target
88
local.properties
99
.kotlin
1010
.DS_Store
11+
kotlin-js-store/

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [3.1.0] - 2025-10-21
11+
12+
### Added
13+
14+
- Add `wasmJs` target support.
15+
1016
## [3.0.2] - 2025-10-08
1117

1218
### Added

gradle/libs.versions.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
[versions]
22
kotlin = "2.2.20"
3+
34
kotlinx-coroutines = "1.10.2"
5+
kotlinx-datetime = "0.7.1"
6+
kotlinx-io = "0.8.0"
47
kotlinx-serialization = "1.9.0"
58

6-
dokka = "2.0.0"
9+
dokka = "2.1.0"
710
kover = "0.9.2"
811
ktlint = "13.1.0"
912
nexus-publish = "2.0.0"
1013
researchgate-release = "3.1.0"
1114

1215
[libraries]
1316
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
17+
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
18+
kotlinx-io-bytestring = { module = "org.jetbrains.kotlinx:kotlinx-io-bytestring", version.ref = "kotlinx-io" }
19+
kotlinx-io-core = { module = "org.jetbrains.kotlinx:kotlinx-io-core", version.ref = "kotlinx-io" }
1420
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
1521

1622
[plugins]

library/api/library.klib.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Klib ABI Dump
2-
// Targets: [iosArm64, iosSimulatorArm64, macosArm64]
2+
// Targets: [iosArm64, iosSimulatorArm64, macosArm64, wasmJs]
33
// Rendering settings:
44
// - Signature version: 2
55
// - Show manifest properties: true

library/build.gradle.kts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
@file:OptIn(
2+
org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class,
3+
org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation::class,
4+
)
5+
16
plugins {
27
kotlin("multiplatform")
38
kotlin("plugin.serialization")
@@ -10,25 +15,28 @@ plugins {
1015

1116
dependencies {
1217
commonMainApi(libs.kotlinx.serialization.core)
13-
commonMainApi("org.jetbrains.kotlinx:kotlinx-io-core:0.8.0")
18+
commonMainApi(libs.kotlinx.io.core)
1419

1520
commonTestImplementation(kotlin("test"))
1621
commonTestImplementation(libs.kotlinx.coroutines.test)
17-
commonTestImplementation("org.jetbrains.kotlinx:kotlinx-io-bytestring:0.8.0")
18-
commonTestImplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1")
22+
commonTestImplementation(libs.kotlinx.datetime)
23+
commonTestImplementation(libs.kotlinx.io.bytestring)
1924
}
2025

2126
kotlin {
2227
jvm()
2328
iosArm64()
2429
iosSimulatorArm64()
2530
macosArm64()
31+
wasmJs {
32+
browser()
33+
nodejs()
34+
}
2635

2736
jvmToolchain(8)
2837

2938
explicitApi()
3039

31-
@OptIn(org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation::class)
3240
abiValidation {
3341
enabled = true
3442
}

library/src/commonTest/kotlin/kotlinx/serialization/test/TestingFramework.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import kotlinx.serialization.csv.source.CsvSource
1414
import kotlin.test.assertEquals
1515
import kotlin.test.assertFailsWith
1616

17-
inline fun <reified T : Any?> Csv.assertEncodeAndDecode(
17+
internal inline fun <reified T : Any?> Csv.assertEncodeAndDecode(
1818
expected: String,
1919
original: T,
2020
serializer: KSerializer<T>,
@@ -38,7 +38,7 @@ inline fun <reified T : Any?> Csv.assertEncodeAndDecode(
3838
assertEquals(restored, restored2)
3939
}
4040

41-
inline fun <reified T : Any> Csv.assertDecode(
41+
internal inline fun <reified T : Any> Csv.assertDecode(
4242
input: String,
4343
expected: T,
4444
serializer: KSerializer<T>,
@@ -53,7 +53,7 @@ inline fun <reified T : Any> Csv.assertDecode(
5353
assertEquals(expected, restored2)
5454
}
5555

56-
inline fun <reified T : Any> Csv.assertDecodeFails(
56+
internal inline fun <reified T : Any> Csv.assertDecodeFails(
5757
input: String,
5858
serializer: KSerializer<T>,
5959
) {
@@ -62,4 +62,4 @@ inline fun <reified T : Any> Csv.assertDecodeFails(
6262
}
6363
}
6464

65-
infix fun <T> T.shouldBe(expected: T) = assertEquals(expected, this)
65+
internal infix fun <T> T.shouldBe(expected: T) = assertEquals(expected, this)

settings.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ plugins {
2020
}
2121

2222
dependencyResolutionManagement {
23-
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
24-
2523
repositories {
2624
google()
2725
mavenCentral()

0 commit comments

Comments
 (0)