Allow Initialization of Plugin from WebAssembly.Module
Closed this issue · 1 comments
wikiwong commented
This was done in the "legacy" browser SDK here: extism/extism@e1a5b01
It allows Extism to be used in a wider variety of contexts (such as Cloudflare workers)
chrisdickinson commented
This should be pretty straightforward:
- in
src/interfaces.ts
: Add a newManifestWasmModule
, patterned after the existing interfaces, then add it to theManifestWasm
union type. - Somewhat trickier: changing the signature of
toWasmModuleData
insrc/manifest.ts
. Instead of stopping the resolution of manifest input at array buffers, it should use those arraybuffers to create modules viaWebAssembly.compile
.- This is "trickier" in the sense that you'll have to do some refactoring across the rest of the codebase to put this in place.
src/foreground-plugin.ts
,src/background-plugin.ts
, andsrc/worker.ts
will need to be modified to acceptWebAssembly.Module
instances.