Hello, if I’ve been building a Kotlin Multiplatform Mobile library up until now, and I decide to start adding JS support, is it as simple as adding js() target in the Kotlin block of the build file? Or will there be complications since I started with the KMM template instead of the KMP template?
08/11/2021, 5:52 PM
Should be as simple as adding js() target and implementing your actual declarations there
08/11/2021, 6:11 PM
One issue I recall running into adding js to a project was I had made some threading assumptions in my design that didn't work in the single-threaded JS world
It wasn't a deal breaker, I just needed to step back and think about the API a bit
08/11/2021, 6:21 PM
If you are using a database, this might be a problem as well in JS.
08/11/2021, 6:29 PM
Also check if your MPP dependencies (if any) support js target. If they're from maven central you can use kamp.petuska.dev to check
08/11/2021, 6:49 PM
Excellent thanks! We’ve been carful to avoid any libraries that didn’t support JS, as we knew this would be a possibility. So far everything seems to be working correctly by simply adding the js target.
08/12/2021, 6:30 PM
It's really nice to see that currently there are enough multiplatform libraries that scenarios like this actually happen in the real world, it's not just a sales pitch about it being easy