I am trying to use the create-react-kotlin-app. I ...
# javascript
w
I am trying to use the create-react-kotlin-app. I want to send data between the app and the server. Kotlin x-serialization is not supported. Is there a more Kotlin-ish way to send data between the Kotlin JS code and the Kotlin JVM code?
g
Why kotlinx.serialization is not supported?
w
I couldn't add it as a dependency because it's not available as a npm package.
I will have a look at creating a npm package tonight. I'm a novice to JS but I'll give it a crack.
g
Do you use Gradle to build your project?
Because I am not sure that kotlinx.serialzation works without Gradle/maven build plugin
Anyway, you still can create Json using JS API and send it to your server
w
Ok cheers
I will try and add gradle and see if that works.
n
I use create-react-kotlin-app tool and interested in how to use kotlinx.serialzation lib too.
s
@Nail Khafizov It is not supported yet by create-react-kotlin-app: https://youtrack.jetbrains.com/issue/CRKA-84
n
I do not hurry, but what do you advise - Wait or look for workarounds?
s
@Nail Gilaziev Projects created using create-react-kotlin-app currently compiled through CLI compiler, which is not fast (compiler daemon not used, and incremental compilation not supported). So, at this time gradle is preferred way. Although we are thinking about improving webpack plugin to support daemon and incremental compilation (even in watch mode).
n
ok, I will try to learn how to configure project with gradle. CRKA is easy to start. but with gragle is not clear where to start.
s
n
Thanks a lot!
s
@Nail Gilaziev The example in answer above looks tricky. I created minimal example here https://github.com/snrostov/gradle-kotlin-react-app. You can clone it and run via
./gradlew run
.
👍 1