Hey friends! We're rapidly increasing the amount ...
# kotlin-native
a
Hey friends! We're rapidly increasing the amount of features that expose coroutines/flows to iOS, so our manual wrapping approach (while definitely easier thanks to @russhwolf’s abstractions) isn't exactly sustainable for the long-haul. Curious if anyone has worked with either of these (or any other) options for automating coroutine/flow wrapping for iOS: • Koru or • KMP-NativeCoroutines From the looks of it, Koru requires manual opt-in for each class via an annotation, and generates a new class for iOS that wraps the actual Kotlin implementation. KMP-NativeCoroutines automatically generates wrapped versions of suspend/Flow properties/functions in the same classes. It also provides its own helper pods to map to RxSwift, Combine, and Async/Await. Has anyone used both and have a strong preference for one vs the other? Are there any other substantial differences between the two? Should we just wait until KSP supports multiplatform?
k
@russhwolf and I have been talking about building something in this space. Curious to understand what you'd be looking for. We're trying to figure out what we'd want in a library for this, and KSP and/or compiler plugin is on the map if needed.
a
Honestly we aren't far enough in the weeds yet that we have particularly advanced needs here 🙃 We basically just want something hands-off, reliable, performant, and regularly updated as Kotlin and Coroutines get updates. As far as I can tell, koru and KMP-NativeCoroutines can both meet our needs, so I was curious if I was missing anything
f
Ksp does support multiplatform
jvm web and native iirc
m
@ankushg I only just found this post, wonder if you tried one or the other. I mantain koru and was wondering if you had any experience with that eventually. Also I'm wrapping my head around rewriting koru with ksp...
And of course I used koru in a production project and it works pretty fine for me. Both libs seem to do similar things, the api is a bit different so this would probably be the main point to consider. Maybe something around mutability / freezing, whether it's configurable or not
I also focused on making sure that you can generate both classes and their interfaces so that on ios you can easily use the generated protocols for testing