Okay, so I’ve been trying to create a build with Kotlin2Js and with Multiplatform with some common code and some Js and JVM specific code.
It is unclear to me what the recommended approach is, because it appears to be changing. Looking at the docs on multiplatform it clearly favours the multiplatform module. However, the KotlinJS docs show a preference to kotlin2js. Looking to a lot of blog posts in the past week it appears that most people use Kotlin2Js.
Also, the documentation on multiplatform is lacking, since a lot of the magic Kotlin Gradle DSL is very difficult to find. There are multiple ways of defining source sets and dependencies. Delegated properties are used, but they must match the names of the source sets, which seems awkwardly ‘magic’ to me.
What is the state of multiplatform vs kotlin2js and what is the recommended approach if starting today with developing a JVM backend and JS frontend?
I also just found out about the
kotlin-frontend-plugin. It is not mentioned anywhere in the docs on the Kotlin website. Is this an official plugin? if so, is it experimental?
A lot of questions, but it is difficult to find a proper source of answers.