I’m not sure how common it is but at my company, 9...
# multiplatform
t
I’m not sure how common it is but at my company, 99% of screens (300) are compiled native code and the last 1% are an assortment of WebViews to the mobile web app (react). This usually drives high code churn screens with requirements that change frequently by marketing or legal teams etc. This gets around having do more frequent app releases and waiting for version adoption. Generally I’m exploring some options for sharing common code between mobile and web and had a interesting thought. We have a KMP app (100% shared UI, domain and data layer 😎) that supports all platform targets but we only ship Android and iOS. In theory, I think it would possible ship the wasm target as a mobile website that only exposes those specific screen as pages. This would remove react from our stack and we’d be truly 100% Kotlin. There are some interesting challenges to overcome in there. But I’m wondering if anyone else has employed this strategy and how’s it working out?
c
I think Zipline is pretty much exactly what you're looking for https://github.com/cashapp/zipline
j
Yeah, this was what Redwood+Zipline did. Both are effectively abandoned, however.
😞 3
s
Remote Compose could become something that can accomplish this. It (especially rendering on the JVM, creating the dynamic documents) is still very much experimental.
g
Server driven UI could be helpful, but it is a hassle to come up with your own protocol; I am not sure if there are lib / framework for this for KMP
o
> Remote Compose could become something that can accomplish this. Note: if you want your RemoteCompose-driven screens to have similar UI that your "client-side" screens have, you would need to re-implement your design system from scratch using Remote Compose DSL (not the usual Composables you have right now). Another note: Remote Compose was created with widgets and "remote views" in mind. For example, there is no support for text fields/text input. Personally, I would not use it for general purpose "Remotely-configured/driven UI"
s
Yup, I came to the same conclusion, when trying it out. But I'm hoping it will evolve to a proper server side rendering set of libraries in the (near) future.
y
using Remote Compose DSL (not the usual Composables you have right now).
We are unpicking that, so hopefully won't be long. e.g. android-review.googlesource.com/c/platform/…/4348028
Definitely will be part of 1.0. Well at least JVM and Android from AndroidX.
❤️ 3
K 3
For example, there is no support for text fields/text input.
The POR is that you use custom components for something like this. You would have to build this into your clients ahead of time.
There are samples if it's helpful.