5 ms·
How does Compose Multiplatform on web work? Does it paint on Canvas like flutter? Do you use the same widgets on Desktop, web, iOS and Android? I understand th
by leononame 3y ago
How does Compose Multiplatform on web work? Does it paint on Canvas like flutter?
Do you use the same widgets on Desktop, web, iOS and Android? I understand that on Android it's native. Does it emulate other styles on other platform? I guess, my question is mostly: How is the _feel_ of a Compose Multiplatform App on non-Android platforms.
Dart on web e.g. feels extremely janky to me, so does electron on Desktop. Dart on Desktop is ok, but all the applications tend to be very App-like with huge buttons and whitespace that just make it feel more like it was an Android App running in an emulator rather than an actual native app.
Would you recommend Kotlin as a language for new projects?
- jillesvangurp 3y agoCompose web indeed uses a canvas and just like the Android and IOS versions it renders using low level graphics libraries such as cairo. I think the intention is indeed to have the same core components across all platforms and indeed emulate the look of the native platform. This is similar to what things like flutter do, which also depends on cairo if I'm not mistaken. There is also compose web html which seems to be not getting a lot of attention lately. That depends on kotlin-js and works with the dom tree. But for obvious reasons it's a lot less easy to use the same components there. I think it's too early to tell how it will perform, look, and feel on every platform. This is also a bit of a function of how much effort and design you put in. Using wasm in the browser should help with performance though. Dart might copy that trick as well. I think they currently cross compile to javascript. Kotlin as a language is more than fine. Anything server related or Android related, it's a great language and I vastly prefer it to Java at this point (27 years of experience). I personally use it for web development (kotlin-js in the browser) and server development (spring-boot, ktor). IOS native development for libraries is also a popular option for sharing code across IOS and Android. That just got promoted to a stable release. There are some gotchas with interoperability with e.g. Swift and Flutter from what I understand. But it's basically very stable and workable at this point and fairly widely used. Compose multiplatform is not quite ready yet. The Android and Desktop side work fine and are stable. But the rest is a work in progress. Compose web is going to be a while because even the compiler isn't ready yet. Compose IOS looks like it should get to a usable stage in the next six months or so. Stable is probably at least a year out for that.
- yurishimo 3y agoHow does this work in regards to accessibility? I think historically, canvas has not had a great track record as it's essentially a black box. While it might be okay for certain use cases (intranet, one-off tools, etc), I don't see how this would ever take off on platforms with a public user facing application. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#accessibility_concerns https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ca...
- usrusr 3y agoCompose on android is native as in it takes full responsibility for its canvas, not native as in react native which tries to operate pre-existing controls as much as possible.
- xster 3y ago> Dart on web e.g. feels extremely janky to me That's what this WasmGC is for :) Dart on web runs as dart2js whereas other platforms like Android/iOS/macOS/Linux/Windows runs as AOT arm64 or x86_64 code. Dart on wasm (as shown in demo in the article) will run better than transpiled JavaScript.