Hey everyone, I just wanted to show I was experime...
# compose-desktop
a
Hey everyone, I just wanted to show I was experimenting with Compose Desktop multiplatform (based on the experimental folder in de JB repo) and was quite amazed. Ofcourse I ran into a lot of weirdness, but nonetheless I was able to pull the following movie off quite fast. It is a common module which contains everything: logic, viewmodel and compose view. The platform specific modules only bootstrap my
MandelbrotViewer
composable. In the movie we have JVM, iOS iPad Simulator and JS. Quite the difference in platform! Biggest issue is that I got VM allocation errors when using
withContext(Dispatchers.Default)
on iOS targets so it is blocking the main thread. I also can't get it to work on Arm64 on Mac. But it's experimental. So... there's that. I really enjoyed this, and it was very very easy. I can't understate how awesome it would be to have a true multiplatform UI library in Kotlin. I'll post the code later on GitHub.
🔥 15
âš¡ 5
s
Thanks for sharing! I haven’t dug into the new memory manager yet, but
Dispatchers.Default
isn’t working yet? 😞 Is there a limitation around this I’m not aware of? Is there a bug to track that anyone is aware of in the coroutines library?
l
I’ve been using Dispatchers.Default on iOS, and can confirm that it does not run on the main thread for me. I’ve been using the new mm for a while.
a
Probably just an error on my side. I think I need to switch to the new MM or something.
a
@thelumiereguy
t
Oh wow! I definitely gotta check this out!
a
l
If you’re using compose 1.2.0, it would be good to use Kotlin 1.7.20
1.7.20 also brings the new mm by default
a
@Landry Norris Ah, now the dispatcher works! But the 1.2.0 compose version for Kotlin 1.7.20 doesn't support JS. You win some you lose some 🙂
l
You can add kotlin.native.binary.memoryModel=experimental before 1.7.20