(Cross posting from <#CDFP59223|>) Hi! I heard in ...
# compose-web
j
(Cross posting from #CDFP59223) Hi! I heard in a lightning talk from the Kotlin Conf 2025 that Compose Multiplatform on Web (with Wasm) is rendered on Canvas. How does that work? Are there any resources diving into rendering? I have a bunch of questions like • Does it write ui updates as bytes into a shared memory and the web browser reads from it as a stream and sends that to the canvas? • Does it calculate/render the compose tree and send that over the browser where it converts it as UI?
o
> • Does it write ui updates as bytes into a shared memory and the web browser reads from it as a stream and sends that to the canvas? Skia is compiled to Wasm using emscripten. And it calls webgl API that "draws the pixels" on the canvas. Then Skia is wrapped by Skiko so we can call it from Kotlin. > Does it calculate/render the compose tree and send that over the browser where it converts it as UI? I'm not sure what you mean by "send that over the browser". There is compose-runtime which is responsible for the composition and calculating/applying the changes. It's performed on a client side (by the browser engine - executing Wasm). The browser doesn't "know/care" that we render UI - it just executes the Wasm code. Actually, it's not all Wasm code. Even the simplest Compose for Web makes some Web API calls. And Web API is available only in JS. So there is also wasm-js-wasm interop