JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.72k stars 1.14k forks source link

Use compose animations without skiko on wasmJs target #4133

Open rjaros opened 7 months ago

rjaros commented 7 months ago

I would like to use compose animations core dependency in my wasmJs compose-runtime based application (not compose-web). I don't draw on canvas, I don't want nor need skiko and I have disabled unpacking it with compose {} dsl in gradle. But when adding org.jetbrains.compose.animation:animation-core dependency I can't build my project with this error:

Module not found: Error: Can't resolve './skiko.mjs'

It works ok when I allow generation of skiko.wasm, but I don't want to load almost 9MB of unused (?) code. The same project builds fine and works without skiko when targeting js (my animations work without skiko).

I've used webpack.NormalModuleReplacementPlugin to replace skiko.mjs with some fake, empty module. It allowed me to build my app for both dev and prod, but the development version crashes with a runtime error import object field 'org_jetbrains_skia_Bitmap__1nMake' is not a Function. The production version (processed with binaryen) works fine.

okushnikov commented 1 month ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.