extism / js-pdk

Write Extism plugins in JavaScript & TypeScript
42 stars 16 forks source link

ESM Support #56

Open bhelx opened 3 months ago

bhelx commented 3 months ago

QuickJS does support ESM. Also the quickjs bindings give us a way to eval an ES Module https://docs.rs/quickjs-wasm-rs/3.0.0/quickjs_wasm_rs/struct.JSContextRef.html#method.eval_module

We should switch to ESM and maybe even remove CJS support. That will also require changing the README and some of the instructions. It will probably have an impact on the polyfill code too.