Is there any guidance on creating a multi-platform...
# javascript
n
Is there any guidance on creating a multi-platform Kotlin library (JVM and JS) so that Javascript developers can easily interface with it while programming in pure Javascript? I noticed that KotlinJS generates a lot of ugly Suffixes on functions like
create_puj7f4$
even though there is only one
create
function and since
@JsName
is not available in a platform-common project, I am not sure what I can do to prevent that.
k
The workaround is to use
expect/actual
typealias annotations, e.g. declare an
expect
typealias for
MyJsName
in your common project and then in your js project write
actual typealias MyJsName = kotlin.js.JsName
https://youtrack.jetbrains.com/issue/KT-18882 to track progress on non workaround solutions
n
I'll try that. Thanks!
n
Does JS have namespaces? If it does then it would make Kotlin JS interop a bit easier.
n
JS does not have namespaces afaik