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?
Check out the web samples https://zal.im/wasm/iv and see that the whole website is just one canvas element.
There is also #C01F2HV7868 where you might get better answers to questions like this.
👍🏻 1
a
AndrewStone
10/30/2025, 9:22 PM
Its not canvas anymore. I think it used to be, and there's a deprecated API that you can still use to render into a canvas. This is completely done in compose, and you can see its all shown as DOM in the browser.