Hi! I heard in a lightning talk from the Kotlin Co...
# webassembly
j
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?
c
It’s using skiko to draw to an
<canvas>
Element
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
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.
c
That’s compose HTML and not Compose web. They are 2 different things. Compose HTML is not multiplatform. https://github.com/JetBrains/compose-multiplatform