Hey folks, I have a Kotlin WASM JS web app that I ...
# multiplatform
i
Hey folks, I have a Kotlin WASM JS web app that I published via GitHub pages on https://ivylearn.app. I used the
:wasmJsBrowserDistribution
Gradle task. However, the app only seems to work on Google Chrome (desktop). It's broken on: • Safari (Desktop) • Google Chrome (Android) By broken I mean that click handling isn't working. Any ideas? Here's the code: https://github.com/Ivy-Apps/learn
r
Safari doesn't support WasmGC yet, so Kotlin/Wasm apps will not work. Don't know about mobile chrome.
thank you color 1
h
Chrome on iOS also uses Apples WebKit without WasmGC too.
thank you color 1
i
Got it. Thanks for the quick replies! Is there any ETA when it'll have full support? I'll just probably Google that 😄 Chrome (Android) might be something in my code cuz I use many Compose features. I'll investigate and let you know if I find the culprit. Tl;dr; • Kotlin WASM JS isn't yet ready for testing MVPs / validating ideas. I've never tried Koltin JS - is it possible to re-use Compose multiplatform code like in WASM?
💯 1
yes black 1
p
The terminology is a bit wide. Kotlin-js is basically everything related to kotlin compilation/transpilation to js. In this particular case you might want to look for compose-js. Which is a target very similar to wasmJs but compiled to js not wasm
🙌 1
i
Awesome - seems like exactly what we need. Goal: "Re-use our Compose UI from
commonMain
for all platforms"
p
Definitely doable yes.
i
I'm new to KMP is there any good resource/project that can help me migrate my setup from Kotlin WASM to Kotlin JS?
p
You can actually have both in the same project.
i
I'll get rid of WASM for now cuz some libraries doesn't support it
p
Check this one https://github.com/pablichjenkov/kmp-amadeus-api It still uses the old KMP project structure. I have to migrate from
share
to
composeApp
thank you color 1
GitHub is full of examples by the way
i
Yup, I just gotta dig. Btw, I migrated everything myself - it was easier than it sounds 😄
💯 1
Thank you very much for the help! Kotlin JS saved my day 🙏
👍 1
125 Views