WasmJS Limitations
WasmJS support is experimental and has several limitations:
- Custom Types Required: You need to provide your own types and functions
- Runtime Not Included: The plugin doesn't provide runtime support for WasmJS
- Type Restrictions: WasmJS has restrictions on various types that may affect your implementation
Example of custom WasmJS setup:
// You need to provide these yourself
fun <T> runInAsync(block: suspend () -> T): AsyncResult<T> = AsyncResult(block)
class AsyncResult<T>(val block: suspend () -> T) {
@OptIn(DelicateCoroutinesApi::class)
fun toPromise(): Promise<JsAny?> {
return GlobalScope.promise { block() }
}
}