https://kotlinlang.org logo
Title
g

gagarin55

04/24/2023, 8:26 AM
Hello everyone! Am I right that using Compose Multiplatform I can compile only in WASM, not in pure JS ?
a

andylamax

04/24/2023, 9:08 AM
You can compile to both. Wasm and JS
g

gagarin55

04/24/2023, 9:16 AM
I'm looking at https://github.com/Kotlin/kotlin-wasm-examples/tree/main/compose-imageviewer. What gradle task I should use to run JS version of it?
s

sdeleuze

04/24/2023, 9:24 AM
I think Wasm support is not really usable outside of demos, and may require custom builds of dependencies.
So for now maybe better to use JS and wait Kotlin 1.9 and related Compose release to start using Wasm version for experimentation.
g

gagarin55

04/24/2023, 9:26 AM
I was thinking that I can't run my Compose Desktop in Browser by JS, only by wasm compilation
a

andylamax

04/24/2023, 9:26 AM
To answer your question on what gradle task. Try
./gradlew :webApp:jsBrowserDevelopmentRun
g

gagarin55

04/24/2023, 9:28 AM
I've tried but got
java.lang.IllegalStateException: FATAL ERROR: Could not find "org.jetbrains.kotlin:kotlinx-atomicfu-runtime"
What I'm really trying to understand is that : Is it possible to run Compose Desktop App inside browser now or I have to wait for Webassembly?
s

sdeleuze

04/24/2023, 9:43 AM
Possible with JS today yes.
g

gagarin55

04/24/2023, 9:59 AM
Do you know any working example projects?
s

sdeleuze

04/24/2023, 10:00 AM
Check maybe in #compose-web history
a

andylamax

04/24/2023, 10:04 AM
wait, running compose desktop app inside browser?? I don't think I am understanding this question properly
g

gagarin55

04/24/2023, 10:09 AM
There is Compose Multiplatform app which I can run on Android, Desktop and Webassembly.
BTW, according to #compose-web there is no Compose JS. They are stick to Wasm now
a

andylamax

04/24/2023, 11:39 AM
Compose JS has been split into two. Compose HTML and Compose Web. So there is still Compose JS in a sense that there is Compose HTML still