josephivie

    josephivie

    3 years ago
    But the runtime is missing things too, unfortunately. Like polymorphism, which is absolutely critical to what I'm doing right now.
    p

    pdvrieze

    3 years ago
    Polymorphism is sort of supported. The problem is serializer discovery. Javascript has no reflection/annotation support yet. It has no Class.forName. Basically the candidate types need to be registered in the context so that they can be found.
    josephivie

    josephivie

    3 years ago
    Is that so? I may be able to use it then, which I would honestly prefer… could you point me to how it works exactly then? I researched into it for a bit and all I found was a file in the JVM codebase:https://github.com/Kotlin/kotlinx.serialization/blob/master/runtime/jvm/src/main/kotlin/kotlinx/serialization/internal/Polymorphic.kt Which lead me to believe that it only worked on the JVM. My system requires registration too, so maybe I could slide my stuff over into it. Mirror would then become a temporary patch to serialization, which would be better for everyone. I’d prefer to stick to the standard, but I also need something that works within the next couple of months. Required for an upcoming project.