loke
12/29/2023, 8:43 AMjs()
quite a lot in order to access the JS runtime features, such as Javascript bignums, or getting access to Javascript weak references using js("new WeakRef(...))
. Am I to assume that none of these things are available in wasm, and I have to find workarounds for every use of js()
that I have in the code?Robert Jaros
12/29/2023, 8:45 AMjs()
in wasmJs
target:
https://kotlinlang.org/docs/wasm-js-interop.html#kotlin-functions-with-javascript-code
It's just a bit more limited.Vampire
12/29/2023, 10:39 AMVampire
12/29/2023, 10:40 AMRobert Jaros
12/29/2023, 10:41 AMRobert Jaros
12/29/2023, 10:42 AMloke
12/29/2023, 10:49 AMVampire
12/29/2023, 10:51 AMturansky
12/29/2023, 2:40 PMloke
12/29/2023, 3:11 PMturansky
12/29/2023, 3:22 PMturansky
12/29/2023, 3:24 PM// from string
val a: BigInt = "33453545".n
// from number
val b: BigInt = 33453545.n
turansky
12/29/2023, 3:25 PMloke
12/29/2023, 4:19 PMloke
12/30/2023, 3:13 PM:array:wasmJsMain: Could not find org.jetbrains.kotlin-wrappers:js:.
loke
12/30/2023, 3:13 PMturansky
12/30/2023, 3:28 PMwasmJs
target support right nowloke
12/30/2023, 4:16 PMMike Dawson
12/30/2023, 4:37 PMloke
12/30/2023, 4:40 PMloke
12/30/2023, 4:42 PMMike Dawson
12/30/2023, 4:43 PMloke
12/30/2023, 4:44 PMloke
12/30/2023, 4:45 PMMike Dawson
12/30/2023, 4:50 PMloke
12/30/2023, 4:52 PMMike Dawson
12/30/2023, 4:53 PMMike Dawson
12/30/2023, 4:55 PMloke
12/30/2023, 5:43 PMloke
12/30/2023, 5:44 PMexpect
stuff to deal with the inconsistent behaviour of %
though.loke
12/30/2023, 5:59 PMsuresh
12/31/2023, 6:30 AMWe have no@turansky are there any plans to add it for kotlin-wrappers in near future?target support right nowwasmJs
turansky
12/31/2023, 11:02 AMRobert Jaros
12/31/2023, 11:19 AMjs
and wasmJs
. In practice it would require moving all external declarations to common source set, which requires really a lot of work and compromises. I've done this for basic DOM wrappers in my Kilua project and it was a painful experience 😉turansky
12/31/2023, 11:48 AMRobert Jaros
12/31/2023, 11:56 AMloke
12/31/2023, 2:04 PMturansky
12/31/2023, 2:06 PMturansky
12/31/2023, 2:06 PMjs.core
package is what you needturansky
12/31/2023, 2:07 PMjso
• Record
• recordOf
turansky
12/31/2023, 2:10 PMjs()
dark magic is for very rare cases required.
Most of such cases we hide in Kotlin Wrappers.
I have zero js()
calls in projects, which use Kotlin Wrappers. 😉loke
12/31/2023, 2:44 PMturansky
12/31/2023, 2:45 PMturansky
12/31/2023, 2:46 PM