Paul Dhaliwal

08/11/2021, 4:39 PM
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

David Herman

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

Arkadii Ivanov

08/11/2021, 6:21 PM
If you are using a database, this might be a problem as well in JS.

Big Chungus

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 to check
❤️ 1

Paul Dhaliwal

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.
🎉 1


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