Closed sdeleuze closed 10 months ago
I have several Compose Multiplatform projects that I'd like to add wasm support to, but I cannot because I'm blocked by atomicfu.
We are planning to add WASM to our regular releases post-1.9.0. For now, it's available in Maven repository https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental
under experimental coordinates
Related PR #334
Since 0.23.0
release kotlinx-atomicfu
supports both wasmJs
and wasmWasi
targets 🎉.
Kudos to @mvicsokolova & @igoriakovlev! 👏
Thanks for the work to bring this to WASM; noting that I currently see a warning when compiling:
A compileOnly dependency is used in targets: Kotlin/Native, Kotlin/Wasm.
Dependencies:
- org.jetbrains.kotlinx:atomicfu:0.25.0 (source sets: webMain)
Using compileOnly dependencies in these targets is not currently supported, because compileOnly dependencies must be present during the compilation of projects that depend on this project.
To ensure consistent compilation behaviour, compileOnly dependencies should be exposed as api dependencies.
Example:
kotlin {
sourceSets {
nativeMain {
dependencies {
compileOnly("org.example:lib:1.2.3")
// additionally add the compileOnly dependency as an api dependency:
api("org.example:lib:1.2.3")
}
}
}
}
This warning can be suppressed in gradle.properties:
kotlin.suppressGradlePluginWarnings=IncorrectCompileOnlyDependencyWarning
...I don't use compileOnly
, I only applied the plugin, so I guess this is added by the plugin.
Explicitly adding api("org.jetbrains.kotlinx:atomicfu:0.25.0")
to commonMain
makes the warning go away, but not sure of the desired state here.
We begin to need Kotlin/Wasm support in
kotlinx-atomicfu
for supporting Wasm in the ecosystem. There is a concrete need in https://github.com/bendgk/effekt that is currently being ported to multiplatform.When using version
0.20.0
, we getUnsupported transformation platform 'wasm'
and the special version0.18.5-wasm0
deployed in https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental/ expected to work with wasm does not seems to be usable on this project (conflict with Gradle or other related errors).The release of Kotlin
1.8.20
is going to increase Wasm reach to would be nice to get it supported upstream.