https://kotlinlang.org logo
Join SlackCommunities
Powered by
# mirror
  • j

    josephivie

    02/01/2019, 11:48 PM
    set the channel description: Support and discussion for Mirror, a multiplatform reflection plugin and runtime.
  • j

    josephivie

    02/01/2019, 11:49 PM
    Mirror can be found at https://github.com/lightningkite/mirror-kotlin.
  • j

    josephivie

    02/03/2019, 11:09 AM
    An issue has been found with Native - I don't know how it compiled in the first place, but a fix should be incoming early Monday.
  • j

    josephivie

    02/03/2019, 11:10 AM
    The fix should also enable the use of all the native platforms that KotlinX serialization supports.
  • j

    josephivie

    02/04/2019, 8:52 PM
    New version released!
  • j

    josephivie

    02/04/2019, 8:53 PM
    This fixes issues with Native and adds other native platforms.
  • j

    josephivie

    02/04/2019, 8:53 PM
    In terms of development, the build scripts have been greatly improved
  • p

    patjackson52

    02/27/2019, 9:31 PM
    Any examples or docs for use with polymorphism? Particularly using internal discrimators
  • p

    Patrick Jackson

    02/27/2019, 10:26 PM
    @josephivie ^^^
  • j

    josephivie

    02/27/2019, 10:49 PM
    @Patrick Jackson Right now, it's built to use the name of the class itself without the package. If you want to use alternate names for your classes, you could modify the name index after setup. I'm going to add a function for that probably tonight - I'm glad to take such feature requests as long as they're not overly complicated. https://github.com/lightningkite/mirror-kotlin/blob/master/mirror-runtime/src/commonMain/kotlin/com/lightningkite/mirror/info/MirrorClassMirror.kt#L15
  • j

    josephivie

    02/27/2019, 10:52 PM
    Might add that it uses
    {"type":"YourClass", "value":{}}
  • j

    josephivie

    02/27/2019, 10:52 PM
    I'll look into adding some more stuff for that as well, so that you can write your discriminator manually.
  • j

    josephivie

    02/28/2019, 9:20 AM
    @channel New version released! 0.1.8 You can now use
    polymorphicSerializer=path.to.my.PolymorphicMirror
    to set your own polymorphic serializer! It must, however, conform to these standards: - It must have a header of
    abstract class MyPolymorphicMirror<T : Any> : MirrorClass<T>()
    - It can use
    MirrorRegistry
    to get information about names for classes I still have to add a whole bunch of documentation and tests for it, but it should work now. This also fixes a lot of issues with generating mirrors across multiple packages.
  • j

    josephivie

    02/28/2019, 9:22 AM
    mirror-server
    is also being worked on - a system for sending typed request objects to and from a ktor server.
  • p

    Patrick Jackson

    02/28/2019, 1:35 PM
    great! Still unclear on how to implement this but I'll take a look.
  • j

    josephivie

    02/28/2019, 6:31 PM
    Other clarification I missed - it will not work on the type
    Any
    . There's unfortunately no way I've found to make it overrideable without hurting performance and clearness.
  • j

    Justin

    09/30/2019, 7:05 PM
    Would Mirror provide a solution to the problem I’ve described in #javascript? https://kotlinlang.slack.com/archives/C0B8L3U69/p1569868026112600