Are there any multiplatform libraries for seamless...
# multiplatform
v
Are there any multiplatform libraries for seamless client-server communication (i.e. which abstracts from creating http endpoints and manual server querying)
d
Ktor. Or do you mean like multiplatform retrofit?
v
Probably something built on top of ktor or ktor plugin
d
Probably not. You want http abstracted away? What exactly do you want this library or plugin to do?
v
yep http/session management
instead of writing http endpoints you write service contract in common module, implement it in backend and call it on clients
I can even imagine borderless reactivity
d
Ah I see. Kotlin doesn't have the machinery to create something like that yet.
Do you know any libraries that do this? (In other languages or smth).
v
c
OctoberCMS (PHP) does something like this to a large extent, too https://octobercms.com/
v
why? doesn't look like something relevant, since PHP is backend only
g
hmm, is it like gRPC?
there is no MPP gRPC implementation as I know, but it would be interesting project. Square’s Wire is good candidate for this (or at least first part), but it’s not cross platform
v
it can be used as underlying transport/serialization
g
actually, you probalby don’t need pure Kotlin implementation, gRPC already supported on JVM, JS and ObjC
so, all Kotlin platfroms are covered
it will defentely work on jVM with no problem, there are even a couple projects to generate Kotlin code with data classes and corouines, not sure tho how pleasant it use from JS and ObjC APIs
v
I don't want to use it from js/objC. Say we have a project completely written on Kotlin
and instead of writing http api I just define some services on the backend which I can directly call from client
g
What kind flavour of Kotlin? Anyway, if technology is not a problem there is a plenty of options, even just define OpenAPI spec and generate code And again gRPC imo the best option
v
yep thats how things work nowadays
let's just talk about JS client (frontend)
if we create frontend on kotlin we can already use common data classes right ?
I feel it's better to come back with some sample project
d
Yeah data classses should be fine.