Closed bhelx closed 7 months ago
excellent!
Going to double check the size difference this creates. If it's too big i'm going to add a flag so that you have to opt into including the polyfills
This only partly works. Doesn't seem to be able to find TextEncoder when included as a dependency. need to do a little more work on this. Might be a good time to see if we can support ESM as i suspect that might help.
This is on hold but I'm going to come back to it after some refactors. Although it's nice to do all of this in JS, i think some of these should be in rust.
I think this is in a better spot now. Uses rust to do text encoding and decoding and it's just exposed in JS.
$ extism call plugin.wasm evalcode --wasi --input="new TextEncoder().encode('über')"
# => 195,188,98,101,114
Also i've gotten it work work with react so we know it seems to work in the real world
Will have some follow ups here but good enough to move forward
This adds a basic npm project which will be imported into core to polyfill globals that lots of JS programs expect.
Closes https://github.com/extism/js-pdk/issues/27