What's the difference between the Compose Web js target and wasm target, other than the technology used? any changes in performance or anything else that affects the user experience?
in other words: is there a reason to target WASM given it doesnt work on all browsers rn, while the js target 'just works'?
m
mohamed rejeb
05/11/2024, 11:01 AM
Compose Wasm is much better in performance, and it will be the preferred option I guess for Compose Web. We are just waiting for more k/wasm support.
https://kotlinlang.org/docs/wasm-overview.html
🔥 3
mohamed rejeb
05/11/2024, 11:06 AM
Also the good thing is that Compose team are sharing code between Compose Web JS and Wasm so most of the time when they add a new feature or fix a bug in Compose Web it's for both JS and Wasm at the same time.
K 1
a
Alex Styl
05/11/2024, 11:16 AM
it definitely feels like that. I'm trying to figure out which one to use for library website demos. still undecided
I think the js one outputs a much smaller app, so it loads quicker
but the wasm is indeed more performant
l
Luca
05/13/2024, 5:00 PM
@Alex Styl the wasm binary is usually smaller in my experience for produciton builds
a
Alex Styl
05/13/2024, 7:30 PM
@Luca thanks for the reminder there's a producton gradle task. will check eventually
l
Luca
05/13/2024, 7:31 PM
yup np, wasm-opt is only run for production afaik 👍
c
Chris Athanas
05/15/2024, 8:19 PM
We are waiting for Safari to support Wasm targets, until then, JS is the only universal target that supports all the browsers