any guides to follow when migrating android/ios ta...
# compose-web
l
any guides to follow when migrating android/ios targets to support web?
o
there is this guide about starting with Compose Multiplatform project in general and it includes web - https://kotlinlang.org/docs/multiplatform/compose-multiplatform-create-first-app.html Usually the first step is to add a kotlin wasm target to your modules. An example - https://github.com/JetBrains/compose-multiplatform/blob/master/examples/imageviewer/shared/build.gradle.kts#L22 Your feedback about this process is welcome!
Also you will need to add a couple of web specific files: • index.html • main.kt entry point for web https://kmp.jetbrains.com/?android=true&ios=true&iosui=compose&desktop=true&web=true&webui=compose&includeTests=true - the simplest project generated from the wizard demonstrates this
https://lp.jetbrains.com/cmp-for-web/ - there is a video you might find helpful
l
I managed to successfully run a wasm target, now ill need to check if all of the expect/actual will work as expected
.wasm 1
👍 1
I think only my language swapping isnt working, so ill need to do some research based on my current setup, otherwise dont see any issues so far! This is so much better then learning a proper web framework
o
Could you please elaborate what you mean by language swapping?
l
I have my app running 2 languages. On mobile side I did this by using Locale and then doing a recomposition on Locale change.Im not seeing the change happen on the web, so i probably did something wrong in the actual part maybe
o
perhaps you've seen this already. sharing just in case - https://kotlinlang.org/docs/multiplatform/compose-resource-environment.html#locale
l
Yes im doing something based on that. Probably did something wrong, since I did it a bit of a hurry
👍 1
Yes I forgot the index.html part of the language, seems to work now
🎉 1
Thanks!