https://kotlinlang.org logo
#serialization
Title
# serialization
e

Edouard Goossens

07/20/2018, 7:58 PM
I’m building a JS module from Kotlin that uses serialization. This module is used by a “pure” JS (React Native) project (built with npm). It seems the kotlinx-serialization-runtime-js npm package has been deprecated. What is the recommended way of specifying the JS project’s dependency on the js serialization runtime library? Thanks!
Yeah I read that it should but actually it doesn’t... The compiler should output my index.js, kotlin.js and kotlinx-serialization-runtime-js.js ... but for some reason it only outputs index.js (I’ll investigate why). The index.js module file produced by the compiler does
Copy code
require("kotlinx-serialization-runtime-js")
so how can I make sure it always finds it? Ultimately I want to be able to export my module as an npm package so it should either specify it’s dependency on kotlin libs as npm packages (probably the preferred way?) or bundle the runtime libs in the package?
s

sandwwraith

07/21/2018, 11:50 AM
I think for now you can bundle it. I’ll investigate on how to properly publish this library to npm. That
kotlinx-serialization-runtime-js
from npm was published unofficially by someone, so I don’t know if he’s going to update it. Probably you can do similar thing, publish it unofficially.
e

Edouard Goossens

07/28/2018, 12:13 PM
ok thanks
3 Views