https://kotlinlang.org logo
f

fair_enough

02/09/2022, 4:39 PM
Hello. just wondering, trying Jetpack compose for web. Everything ok, but production file size is around 2,5 MB 🙂 any advice with kotlin JS IR dce? or some lazyloading for kotlin js?
b

Big Chungus

02/09/2022, 4:39 PM
That's expected. IR JS is still not well optimised, even with more aggressive DCE
Are you building it with jsProductionExecutable, btw? Dev builds are a ton larger.
Lazy loading of kotlin.js is also out of question until ir-per-module compiler flag is stable.
f

fair_enough

02/09/2022, 4:42 PM
@Big Chungus ah ok. trying to use your kmdc lib. I hope in one year timespan it will be better 🙂
jsBrowserProductionRun
b

Big Chungus

02/09/2022, 4:43 PM
We all do. But I think big size reductions will only come with es6 support
f

fair_enough

02/09/2022, 4:44 PM
And when it is in roadmap?
b

Big Chungus

02/09/2022, 4:44 PM
Postponed i think
Good news is that this size increase is a lot less visible for bigger apps as it scales with diminishing increase
f

fair_enough

02/09/2022, 4:45 PM
ah, ok, thanks
b

Big Chungus

02/09/2022, 4:46 PM
Hello world app will still be over a megabyte I think, but then small full spa with couple of pages will not increase as much compared with source code difference and can be around 2mb if really optimised
On a side note, please don't use kmdc in any apps that you care about. It's still way too experimental and the API will definitely change.
For now I'd recommend plain web compose with tailwind css
f

fair_enough

02/09/2022, 4:53 PM
I see. Just testing current status with simple app
a

Akif Abasov [JB]

02/09/2022, 5:25 PM
We are working with Kotlin/JS team to decrease bundle size. There’s space for optimisations.
🎉 9
3 Views