K.wasm + js
Questions for those interested in using Kotlin/Wasm with JavaScript:
⢠Are you primarily interested in calling JavaScript code from Kotlin, calling Kotlin from JavaScript, or both?
⢠Additionally, if you have tried the current JS interop system, which use-cases that interest you the most are not yet covered?
Thanks!
s
Stefan Oltmann
12/15/2023, 11:11 PM
1: Calling JS Code from Kotlin where a pure Kotlin KMP library is (yet) missing
2: Can I name unit tests with resources as a use case? š
ā 1
a
andylamax
12/16/2023, 12:18 AM
1. Calling Javascript from Kotlin
2. Native support of @JsExport from common code is a use case that is currently not supported
3. A common abstraction layer of definitions for kotlin/js and kotlin/wasm. One that works well with JsAny for both platforms
1. Calling JS from Kotlin
2. Catching JS exceptions in Kotlin.
3. Stdlib types like
Promise
as regular commonized Kotlin types, not using
JsAny
.
ā 1
s
Stefan Oltmann
12/17/2023, 1:05 PM
I wish for a lot more extension functions to make this easier.
These should be provided by stdlib:
ā¢
fun Uint8Array.toByteArray(): ByteArray
ā¢
fun ByteArray.toUint8Array(): Uint8Array
ā¢
fun ByteArray.toBlob(mimeType: String): org.w3c.files.Blob
For a beginner it's not obvious how to implement them and now that I know how to do it i just copy & paste them around. This is a clear indication (to me) that it should come with the standard library.