As it stands now the current stable way of doing K...
# compose-web
o
As it stands now the current stable way of doing Kotlin for web is through KotlinJs? Until compose for web is more stable?
a
It’s a completely different use case I’d say . Compose HTML is DOM, Compose for web is canvas. Different challenges, benefits and drawbacks
a
If you mean compose, I think neither is production-level atm, but the one we’re looking for feedback on currently is compose/wasm (on canvas).
o
hmmmmok what i'm asking I guess is, if i wanna do kotlin for web, where should i put my hopes and effort ? Kotlin Multiplatform with Kotlin/JS using React?
d
@oday There are 3 different compose for web: 1) Compose by Wasm Canvas 2) Compose by JS Canvas 3) Compose by HTML/DOM The first 2 share the same code. They just differ by compilation target. Their Composables are also compatible with Android, iOS and Desktop. However Wasm Canvas is at the very beginning of its experimental phase. If you want to build a web app, at the moment it might be better to test it with JS canvas, and switch to Wasm in the next few weeks
t
It's not easy to find the link to Compose HTML.
a
I think people underestimate the drawbacks of building a webapp with canvas, be it JS or WASM. You lose all of the default UX the browser and the DOM brings. Personally I stick to Compose HTML for now, for actual production projects
t
I'm considering to adopt Compose HTML for my MonoSketch, for now, I use my own version of DSL for generating DOM.
m
@Tuna it was easier before they changed the README to include the new Compose Web, however iirc they did say that in the future they will change the Compose website to make Compose HTML more prominent https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/HTML/Getting_Started
k
Is it realistic to expect that perhaps someday Compose by Wasm would render HTML/DOM as an option rather than canvas? I share the same concern that @Arjan van Wieringen mentioned about losing the default UX and accessibility of HTML. On the other hand, however, the ability to share code across iOS, Android, and Web that Compose by Wasm allows seems too good a productivity boon to take off the table. Not an easy tradeoff decision to make in my mind!
a
@Kalalau Cantrell luckily we have Compose HTML of course, but it feels like WASM will get way more attention. Although I like the idea of having a write once, run anywhere for UI, I am afraid that it’ll always be a mirage in the distance. The differences between platforms are too big such that you’ll always get stuck with platform specific code, knowledge and teams. However, I’d love to get surprised