Hey there I have a kotkin multiplatform compose ap...
# compose-web
j
Hey there I have a kotkin multiplatform compose app that runs on wasm and works fine for the most part, my issue is that some clients have really old browsers that doesnt have wasmGC. I have read somewhere that instead of KMC for web with wasm we can use generation of js. Yes skia is still build using wasm I guess, but the app itself will use the skia and draw on html canvas. I believe this is something that flutter is doing in the last 2+ years. I have read that Kotlin Multiplatform Compose web was also working without wasm some time ago but right now cant find how to migrate my wasm builds to js only builds.
o
that's right. It's possible. There is no tutorial for such a migration 🙂 But you can have a look at this example - https://github.com/JetBrains/compose-multiplatform/tree/master/examples/imageviewer It has both js and wasmJs targets. I think you can have both as well (no need to delete wasmJs target).
./gradlew :webApp:jsBrowserRun
🙏 1
j
Yes i just want to use the js IR temporary since we have wasm support in safari and mobile
And change the build to use js(ir)
j
Yes it would be awesome btw if the kmm wizard has a trick for this and option to generate such starter
o
Maybe that's true. The cons is that it might make it a bit less clear and more confusing (like, what to choose? how to decide, etc.). Since both targets are for web (browsers). And we've chosen k/wasm as the main default one.
j
I am coming from flutter btw where there are even 2 web renderers not counting wasm which is third and its not confusing ;) its a lot harder to google and search docs or slack . The way we have kmm wizard asking for shared and not shared Ui I believe we should have a tick or a radio for web wasm and web canvas and or even web unshared (for using kotlin js but i guess this might be super hard to actually include easilly in the same project and is no longer focus even when it is the most stable option ;) ) But i agree wasm should be the default but maybe not today … maybe in 2025 ? ;) anyway huge fan have to share that coming from flutter writing compose is so so so so so so much more enjoyable maybe because of the lack of ;, and [] for lists of components but its simply way more fun
❤️ 1
It didnt work btw too many things are missing there is no webApp folder anymore no jsMain and etc there is no js configuration in the build script and if you add it looks for non existing folders ;)