@jo yes, I have seen the documentation and the example you posted but I could only see 2 libraries imported using jsinterop, not how to use functions defined as external.
@olonho yes, I saw that file but it is not clear to me how to include JS functions. I know I can define them as external but then the application crashes at runtime. So far I only could mess up with the generated .wasm.js file to add into the “libraries” array entries for my JS functions that I defined as external but 1) I do not think this is the intended way to do that 2) It is a mess to convert the types
o
olonho
03/25/2018, 8:55 AM
Practically speaking, now jsinterop is mostly an internal tool. So there’s no intended way to use JS interop with external JS code
f
ftomassetti
03/25/2018, 8:57 AM
Ok, then I guess I am stuck to my trick: I load the script without specifying the wasm attribute, so it fails after having setup a few data structures. At that point I add to the libraries array a new element with my mappings and when I launch WebAssembly directly.
It works but it is just… awful 😄
o
olonho
03/25/2018, 10:50 AM
actually for us it is very interesting to know how do you plan to use K/N WASM in applications? We need this information to properly prioritize K/N WASM target (currently we assume that most web users would use Kotlin/JS, so WASM is not the top priority target)
f
ftomassetti
03/26/2018, 4:14 PM
In this case I need to create some examples for a presentation to a local meetup. In practice I plan to write applications using several languages (e.g., Rust & Kotlin) compiling all of them to WASM.
I understand this thing is not production ready but JS interoperability is really needed for even the most basic example
Oh, and I plan to publish an article on SuperKotlin.com, too 🙂