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
kpgalligan
09/07/2021, 5:52 PM
@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
ankushg
09/07/2021, 6:39 PM
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
Fudge
09/07/2021, 9:11 PM
Ksp does support multiplatform
Fudge
09/07/2021, 9:12 PM
jvm web and native iirc
m
Michal Klimczak
10/21/2021, 6:32 PM
@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...
Michal Klimczak
10/21/2021, 6:36 PM
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
Michal Klimczak
10/21/2021, 6:37 PM
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