@josephg brought up a cool idea in #374 to expose napi to wasm. This would allow shipping abi stable binaries that are also platform independent(!!)
my initial exploration shows that at most our in-core changes are basically adding __attribute__((__import_module__("napi"))) to NAPI_EXTERN if __wasm32 is defined.
We could ship the bindings themselves as a separate module or include them in core, but they aren't actually too complex:
napi_create_array: (envPtr, resultPtr) => {
this.refreshMemory();
this.writeValue(resultPtr, this.store([]));
return NAPI_OK;
},
At that point, you can do this:

@josephg brought up a cool idea in #374 to expose napi to wasm. This would allow shipping abi stable binaries that are also platform independent(!!)
my initial exploration shows that at most our in-core changes are basically adding
__attribute__((__import_module__("napi")))toNAPI_EXTERNif__wasm32is defined.We could ship the bindings themselves as a separate module or include them in core, but they aren't actually too complex:
At that point, you can do this:
