Can you point out a good sample for getting starte...
# compose-web
d
Can you point out a good sample for getting started with Compose for Web Canvas ?
o
We don't have any tutorials for it for now. Some simple examples: https://github.com/JetBrains/compose-jb/tree/master/experimental/examples/falling-balls-mpp https://github.com/JetBrains/compose-jb/tree/master/experimental/examples/chat-mpp Both of them have desktop, android, ios, and k/js targets.
d
@Oleksandr Karpovich [JB] many thanks! What is the plan with Kotlin/JS Canvas? Is it still actively worked on, or will it be merged with the new Kotlin/Wasm?
o
Its current status is experimental and it has rather less attention than other targets. From feature-set perspective, I believe, Compose k/js canvas and Compose k/wasm canvas will be similar and will develop in parallel, because they would share the same common source set in almost all cases. The plan is to validate the combination of k/wasm and compose for now. After that we'll likely increase our attention to web target (in my opinion).
d
Is there a specific reason to keep both Compose K/JS Canvas and Compose K/Wasm? If I correctly understand (correct me if I am wrong): • for the UI rendering, both use Wasm • for the data layer, the first uses JS, the second uses Wasm Can we expect Compose K/Wasm to be better than Compose K/JS Canvas, for both performance and filesize?
o
If Compose K/JS Canvas and Compose K/Wasm share the same common source set then the price to keep both is rather small. As for now, k/wasm requires GC flag enabled in a browser + there're issues in some browsers running compose with k/wasm. I don't rule out that Compose k/wasm will reach the point when it's a preferred choice vs Compose k/js. And then we would decide to keep or not to keep compose k/js target. I personally expect better performance with k/wasm, at least because skiko and compose would be both compiled to wasm. But it's not clear yet, same as for filesize.
d
People working on Wasm GC, expect the browsers to lift the experimental GC flag within 1 year, which is great news: https://twitter.com/bashorov/status/1628503719313539077?s=20
a
I'm kinda confused, wasm is a runtime and canvas is just a renderer right? Or I'm missing something
d
@ayodele we are referring to the new Kotlin/Wasm target, available from Kotlin 1.8.20: https://kotlinlang.org/docs/whatsnew-eap.html#new-kotlin-wasm-target