Reposting here: <https://twitter.com/kpgalligan/st...
# multiplatform
k
t
For libraries we need more on DB/SQL, network libs like retrofit and production-ready coroutines and serialization.
Smaller libs like okio and timber are welcome as well
k
Can you expand on the db need? Example?
t
For tooling my vote for testing (mock/assert)
@kpgalligan kv/nosql and sqlite driver/mapper as well (I know about your work on knarch and sqldelight is getting multiplatfrom as well)
k
Any specific nosql library you use currently? Not super versed on that side of mobile db. Also, different features of sqlite driver? That's kind of what knarch is intended to be (sqlite driver), although now that K/N releases are becoming more stable there's a long refactor list
o
I think you can look at “top ios/android libs” lists and come to some conclusions, like this: https://www.raywenderlich.com/259-top-10-libraries-for-ios-developers
t
@kpgalligan probably most used is https://realm.io/products/realm-database, but I have not experience with is
But the most challenging is some UI framework for iOS/Android.
k
UI. That'll definitely be challenging. I've been thinking about that quite a bit recently. Big topic, lot of dimensions. UI generation, more of a UI testable "contract" that needs to be generated in a platform specific way, componentized (React/Flutter), code change/reload time, big team, small team, etc.
Realm. Would be interesting to see their current situation. The devrel budget seems to have contracted, and I haven't heard much WRT conference submissions for Droidcon. Wondering what's actually happening out in the field. I had a version working with J2objc at one point, but their java does bytecode manipulation, which didn't work out with J2objc. The core is C++, though, which would be pretty portable, but I digress.
Side note, SqlCipher would be pretty straightforward (not easy, per say, but no existential issues AFAIK).
t
For UI we can probably use react native-like approach (actually there are not too much alternatives) with wrapping views, but some work on bootstrapping common UI controller (activity/fragment and uiviewcontroller) must be done first.
Actually there is Anko layout for Android that is already able to inflate layouts from DSL but I'm not 100% sure that loosing xml layouts (and tooling!) is a good thing.
(BTW UI discussion probably with separate thread)
k
Yeah. Agree. Also, I was writing a big reply, but I think I'll restart that later. I'm very good at procrastinating when I should be actually working on this talk.
👌 2
o
Come back after 3 more slides 😉
😃 3
r
I’d second mocking. A cross-platform mockito replacement would be great for common-module unit tests
o
I’m afraid multiplatform mocking framework would need a compiler extension to manipulate code generation. And this is not coming very soon…
k
You think "not coming very soon" is like not this year, not next year, or not really on the roadmap? I know that kind of stuff is hard to say, but curious
o
I can only say it is on the radar, but doesn’t have specific slot in the plan.
👍 3
r
I appreciate that you give some hints about your plans and what is important to the Kotlin team. That’s really helpful for devs relying on Kotlin
👍 1
g
A cross-platform mockito replacement
#mockk is on the best position there, Even K/N support under development https://github.com/mockk/mockk/issues/58
k
I've been poking around that issue. The solution was worked on around K/N 0.6.2, so I think it would make sense to have a refresh on that. Same approach? That kind of thing.
l
Multi-threaded coroutines are what is missing for me. I now write UI contracts with
suspend
functions, and it could be platform agnostic, but I can't use it from Kotlin/Native for now
k
Yeah, on my list that's the biggest one. I mention it multiple times in the talk 🙂
l
After this is done, I'll spend time learning iOS APIs and Kotlin/Native seriously, then try to make BleGattCoroutines and CameraCoroutines multiplatform among other things
r
Another place to look for potential new libs is third party frameworks. Something like Firebase comes to mind, or any of the myriad analytics frameworks. There’s lots of things that have Android and iOS libraries that probably expose pretty similar APIs and could be wrapped in expect/actual without too much work. Obviously down the road most third-party dependencies will publish this themselves if Kotlin Multiplatform gets popular, but that doesn’t help you if you want to use something today.
1
l
Yes, I thought about Firebase the other day, but again, this needs multi-threaded Coroutines to work (see recent Android Firebase Task API module in kotlinx.coroutines that shows how much the APIs are coroutines friendly)
Something that will be missing: efficient multiplatform l10n support
g
Actually localisation is interesting problem. Looks that you need own multiplatform implementation of localisation. otherwise you should duplicate strings or generate them for each platform on compile time