Hi friends! I'm new to WASM and want to learn abou...
# webassembly
s
Hi friends! I'm new to WASM and want to learn about its interoperability with Javascript For example, I want to port Vercel Analytics React library to Kotlin JS/WASM and I'm going to be using it in the #C06UAH52PA7 framework that supports writing common code for both JS and WASM. I'm sure the library will work for JS, but I'm not sure how WASM works at this moment. So any resources/guidance will be highly appreciated 🌟
r
I don't think you can use Vercel with Kilua's routing anyway. And without routing support you can just use Vercel in "HTML mode": https://vercel.com/docs/analytics/quickstart#add-the-script-tag-to-your-site
s
Ah, understood. That's unfortunate for large projects :( but I'll at least be able to get it to work on my single page web app. Thanks Robert 🙌
r
Still I'm not sure how it is supposed to work. There is no routing support for plain React apps as well. Only JS frameworks with SSR (next, astro etc.) are fully supported so perhaps this is also a server side library? Nevertheless, to stay on-topic, in general you can do exactly the same things with Kotlin/WasmJs as with Kotlin/JS. You can write almost the same js imports and external functions and use them the same way. And with Kilua you can do all this in common code.
s
Right.. that's one of the awesome things about Kilua 🌟 Not sure how that would translate if I just wanted to write a library Maybe this question is more suitable to be asked in the #C06UAH52PA7 channel