How to Shrink Your Compose Desktop App by 10x :pir...
# compose
k
How to Shrink Your Compose Desktop App by 10x 🏴‍☠️😄 gist.github.com/terrakok/bb876b257adfdedffdd6fda98457c8ce
🆒 1
👀 4
😲 1
🔥 8
e
Size Optimization via ProGuard
Not related to Tauri, but I'm curious why ProGuard was chosen over R8. There was discussion about it and the benefits over ProGuard a while ago (CMP-5121), but that never seemed to go anywhere.
e
It is a magic! But not magic I hoped for 🙂
s
How the heck did we end up in a world where compiling an app to WASM and running it inside a WebView takes less space than shipping a JVM-optimized application? I guess that’s a rhetorical question.
k
the main reason is: tauri uses the system webview which is installed on every system. Java should be installed by users. That is why compose apps contain own proper java
s
I mean, I understand the reason. That’s why the question was rhetorical 🙂 But you know what else doesn't need a WebView or a VM runtime? A native build. Maybe one day Compose for Desktop will become fully native too. I’ve seen more and more requests for that lately, so it might be something worth considering.
k
"A native build." for each os/architecture/set of platform libraries/etc
s
exactly, does that hard for JB? Especially in the age of AI 😄
k
library developers should support their libraries for every platform as well
s
I understand the concern about maintaining native pieces properly on every platform. But not every part of a framework carries the same maintenance cost, especially when much of the code is shared Kotlin Multiplatform code. Also, this is a GUI framework, not an operating system or game engine. Other GUI frameworks like egui manage to target multiple platforms while compiling natively for each. Anyway, I'm not trying to dictate how this should be done. I'm just pointing out that the requests exist, there seems to be real interest in this direction within the Compose community, and I hope it gets explored further over time. ✌️
k
sure, we know the interest)
🙌🏼 1
❤️ 2
🙌🏾 1
m
There was also some agreement somewhere else here that going native is not necessarily such a good idea.
☝️ 1
u
I mean.. you might as well have a shell jvm app that just downloads the bigger jar apples to apples
k
But it seems you converted the desktop app to a web app
😂 1
g
> But it seems you converted the desktop app to a web app And this is really the power of wasm as runtime platform, web becomes not so special when every browser is a runtime