Hey, I’ve been in a cave for a while. I have a pop...
# javascript
b
Hey, I’ve been in a cave for a while. I have a popular Kotlin script and I would like to make a web app around it, but I enjoy TypeScript/NextJS/etc. Is it possible (and recommended) to compile my Kotlin library into JS and use together in a Turborepo project? I just need the “run” method, so it is kind of simple. I could as well just invoke GPT-4 and ask to translate my code to TS, but I don’t want to erase Kotlin from my project that targets Kotlin.
r
if its pure kotlin and doesn't require any java dependencies under-the-hood, then yeah! Kotlin JS will output a javascript file you can consume from JS in any form. Require it, and call your function. May have a little fusiness with how Kotlin packages look in JS, but nothing that you can't work around fairly easily.
b
Pure Kotlin
👍 1
Should I use gradle and etc in the build process to compile to a JS module?
When I built that I used kts which I'm not sure even still exists lol
r
that's probably long-term the safest way to go with it.
b
Thanks!