Thread
#multiplatform
    vlad.minaev

    vlad.minaev

    3 years ago
    Are there any multiplatform libraries for seamless client-server communication (i.e. which abstracts from creating http endpoints and manual server querying)
    Dominaezzz

    Dominaezzz

    3 years ago
    Ktor. Or do you mean like multiplatform retrofit?
    vlad.minaev

    vlad.minaev

    3 years ago
    Probably something built on top of ktor or ktor plugin
    Dominaezzz

    Dominaezzz

    3 years ago
    Probably not. You want http abstracted away? What exactly do you want this library or plugin to do?
    vlad.minaev

    vlad.minaev

    3 years ago
    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
    Dominaezzz

    Dominaezzz

    3 years ago
    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).
    vlad.minaev

    vlad.minaev

    3 years ago
    c

    Casey Brooks

    3 years ago
    OctoberCMS (PHP) does something like this to a large extent, too https://octobercms.com/
    vlad.minaev

    vlad.minaev

    3 years ago
    why? doesn't look like something relevant, since PHP is backend only
    gildor

    gildor

    3 years ago
    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
    vlad.minaev

    vlad.minaev

    3 years ago
    it can be used as underlying transport/serialization
    gildor

    gildor

    3 years ago
    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
    vlad.minaev

    vlad.minaev

    3 years ago
    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
    gildor

    gildor

    3 years ago
    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
    vlad.minaev

    vlad.minaev

    3 years ago
    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
    Dominaezzz

    Dominaezzz

    3 years ago
    Yeah data classses should be fine.