• alex.hart

    alex.hart

    4 years ago
    Yes this is totally possible. Just keep in mind that right now a lot of kotlin libraries don’t support the common platform, and explicitly target either the JVM or JS. If there are specific tools you’re looking to use (such as Rx) you’ll need to either keep your common logic completely synchronous and Rx free (and implement async in platform-jvm and platform-js) or do some wrapping.
    alex.hart
    gildor
    2 replies
    Copy to Clipboard
  • r

    roughike

    4 years ago
    Thanks for the response! So, for example, https://github.com/rozag/kozy-redux is written entirely in Kotlin, but it should also explicitly support the common platform somehow?
    r
    s
    3 replies
    Copy to Clipboard
  • alex.hart

    alex.hart

    4 years ago
    That’s perfectly fine. At the end of the day I believe you should be able to compile your common stuff into what’s more or less a node module (someone correct me if I’m wrong)
    alex.hart
    n
    2 replies
    Copy to Clipboard
  • a

    arocnies

    4 years ago
    On the note of libraries targeting multiplateforms: Dartlang shares this problem with Dart/Web, Dart/Server, and Dart/Flutter. Dart helps ease the pain of using and finding the right libraries with this site: https://pub.dartlang.org/ It would be great to have something similar for Kotlin where authors could tag their libraries for multiple platforms and provide documentation and links.
    a
    n
    8 replies
    Copy to Clipboard
  • s

    steamstreet

    4 years ago
    Having problems with all the latest stuff. I have a
    common
    module, a
    common-js
    and a
    common-jvm
    , and then another JVM module that depends on
    common-jvm
    . All compiles fine with Gradle, but the latest IntelliJ fails to compile, saying that it can’t find definitions, even though the source code is not marked red.
    s
    ilya.gorbunov
    2 replies
    Copy to Clipboard
  • x

    xdetant

    4 years ago
    to add parameterized tests
    x
    gildor
    4 replies
    Copy to Clipboard
  • egorand

    egorand

    4 years ago
    the IDE complains about accessing
    internal
    members of the common module from a platform module, but this seems to work - is this a known issue?
    egorand
    1 replies
    Copy to Clipboard
  • karelpeeters

    karelpeeters

    4 years ago
    Out of interest, why was it deprecated?
    karelpeeters
    ilya.gorbunov
    3 replies
    Copy to Clipboard
  • oshai

    oshai

    4 years ago
    I would like to make
    kotlin-logging
    multi platform (supports also js). After watching yole video about it I still have one open question about the concept: I will create such support the lib will have 2 artifacts one for jvm and one for js. How should Application developer with multiplatfom code depend on kotlin-logging? the jvm module will depend the jvm artifact, the js module will depend js artifact, but what should the common code depend on? third artifact for common? should it be an artifact only for compilation (because js will have same classes also for example)?
  • l

    lewik

    4 years ago
    @marcinmoskala Please read answer above. Looks like you need make "backend" depend on "common-jvm" and "common-jvm" depend on "common" (I think it's better merge kotlin-jvm and backend... may be)
    l
    marcinmoskala
    5 replies
    Copy to Clipboard