Hacker News new | ask | show | jobs
by tadfisher 1224 days ago
Compose for Web has a DOM toolkit as well as one that renders to Canvas. The Canvas toolkit lets you share code with Android and desktop JVM via the Compose UI libraries. The DOM toolkit renders to DOM nodes with its own API and minimal widget library.

Having worked on a multiplatform Compose project, I would recommend rendering to platform-native UI if possible. Compose feels like a weird Electron UI on desktop, and it doesn't fit in with the native look and feel. The code reuse aspect is tempting, but you will be plumbing tons of glue interfaces for anything more intensive than a to-do app.

Compose itself is fantastic, and it's general enough to target a wide array of native UIs with different execution paradigms.

1 comments

This feels like a good development! I hope devs actually do opt to relinquish "pixel-perfect" control (as this post & numerous other projects cite) for "text/html" intercompatibility; it's unknown atm. Im not really conviced projects even have to give up that much control/exactness to have a html/dom render target... it's heartening to hear at least one native world framework even bother to try & fit in, especially given how low it feels the lift should be. Good report! Thanks! But it does still seem contrary to the spirit of this post; Im glad to hear there's better/more respectfully positioned attempt, very glad, but the danger still seems ultra-real.

For most of the similar frameworks exploring making the web a target, there is zero interest or care in "text/html". Flutter, Qt, Uno: they come bearing no gifts, no respect, simply seeing the web's very lowest levels as an efficiently accessible delivery target they can exploit, & they have zero compunctions about ignoring the 99.9999% of the web stack that all other sites use in favor of the low level graphical interfaces.