Hi, guys. Thanks a lot for your answers for many d...
# javascript
i
Hi, guys. Thanks a lot for your answers for many different questions above. Search in Slack is much more helpful than google 🙂 I'm struggling with running a small react app which is a gradle module of a bigger project. I see that intellij generates multiple source sets for multiplatform what looks weird for me because it can be multiple frontends, so now I use just gradle mudules and kotlin("js") plugin inside one of modules It's ok if I work with the module as with an independent project but when it is a module then the plugin creates build folder on root project level. Should that case work properly now? Are there some examples (using the latest kotlin js plugin within a module of a project)? Gradle 6.0.1 kotlin.js (kotlin("js") plugin ) 1.3.61
t
Should that case work properly now?
Yes
Are there some examples (using the latest kotlin js plugin within a module of a project)?
Do you need example with React? Or simple Kotlin/JS will be fine?
f
I thought kotlin js is deprecated
🚫 2
based on latest KotlinConf talks
p
kotlin2js and kotlin frontend plugins are deprecated
f
ah sorry I thought when he was talking about kotlin js plugin he was talking about kotlin2js
t
Live example (6 Kotlin/JS modues) - https://github.com/turansky/yfiles-kotlin
i
@fkrauthan sorry if I confused you, I meant kotlin.js (not kotlin2js). I'm aware of deprecated ones (I've already watched the talk) and I don't use neither kotlin2js nor kotlin frontend plugins. @viacurry thanks for your links, it seems that I do similar things. I tried to reproduce the problem in a simplified case. I've realised that my problem was misunderstanding of .js files naming. My thought was that it is kind of fully qualified name of module + .js (with parent modules) but it is just module name config is pretty much the same https://github.com/ivan-osipov/yet-another-counter-but-fully-in-kotlin/blob/master/frontend/public-viewer/build.gradle.kts thanks
t
If you need deterministic naming, then you need declare root project name explicitly.
n
that usecase.. a react module which is a subproject and depends on the common module of the rest of the project.. is what i am building atm.. using the "new" kotlin.js plugin my frontend project is react, the backend is jvm and the backend project then depends on the
bundle
task of the frontend plugin to package it into the jar if you are interested.. poke me and i can walk you through it.. or at least as much as i understand of it.. hehe PS: but for me it also generates the
build/js
folder in the project root, not sure if this would mess up if there were multiple js based subprojects