-
Couldn't load subscription status.
- Fork 2
Open
Description
Currently the wasm is in a separate file and is loaded like this:
const path = require('path').join(__dirname, 'orchestrion_js_bg.wasm');
const bytes = require('fs').readFileSync(path);
const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);This will not be compatible with some bundlers which may be an issue in some use cases.
We could run a post-build script that inlined the wasm as a base64 string like this:
const bytes = Buffer.from('2.6MB-data-in~3.5MB-base64-string==', 'base64');
const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);Potential Issues
- The uncompressed package will be 33% larger
- Might impact startup performance
Metadata
Metadata
Assignees
Labels
No labels