Hello friends.
I posted these questions on #multiplatform channel but I am copying it here, hope we have the answer faster 🙂
From what I understood, for now compose web parses kotlin code to DOM. So:
1. We can not share the mobile/desktop code with web (because mobile/desktop render on Canvas), is this correct?
2. But if web use Canvas, it will have the problem with SEO and performance (big bundle for first load) - like Flutter?
h
hfhbd
04/21/2022, 7:47 AM
Yeah. The new canvas implementation will allow you to share compose code, but it uses canvas with its downsides.
p
phuc.tran
04/21/2022, 7:47 AM
thanks @hfhbd
h
hfhbd
04/21/2022, 7:50 AM
Technically, you could use expect/actual to share compose code (the same like JetBrains tried with web-widgets), but implementing Modifier in web with dom api is challenging.
👍🏻 1
p
phuc.tran
04/21/2022, 7:51 AM
thanks for sharing, I am not really familiar with compose actually, I come from Native/React Native/Flutter
phuc.tran
04/21/2022, 7:51 AM
I found that compose syntax is quite similar to Flutter
phuc.tran
04/21/2022, 7:51 AM
But I got issue with Flutter Web, that’s why I’m looking at compose