Open 0xdavid7 opened 11 months ago
compile
react-native-webassembly
bytes
Promise<Module>
function compile(bytes: BufferSource): Promise<Module>; /** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming) */
// threadman.js import * as WebAssembly from "react-native-webassembly"; ... export default async function buildThreadManager(wasm, singleThread) { const tm = new ThreadManager(); tm.memory = new WebAssembly.Memory({ initial: MEM_SIZE }); // This line uses the compile function const wasmModule = await WebAssembly.compile(wasm.code); tm.instance = await WebAssembly.instantiate(wasmModule, { env: { memory: tm.memory, }, }); }
Hey, thanks for reaching out.
Interesting. Um. Hm. Yeah we can probably do this.
Has this feature made any progress
Issue Description
I am trying to rebuild ffjavascript to run on React Native, and I need the
compile
function to be supported inreact-native-webassembly
.Currently, the WebAssembly in browser engine supports the
compile
function, which accepts abytes
parameter and returns aPromise<Module>
.I would like to request support for this function in
react-native-webassembly
to replace the following code in my project:Thank you so much! 🤩