Hello, if I’ve been building a Kotlin Multiplatfor...
# multiplatform
p
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?
a
Should be as simple as adding js() target and implementing your actual declarations there
d
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
a
If you are using a database, this might be a problem as well in JS.
b
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
❤️ 1
p
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
c
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