extism / js-pdk

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

Conform to W3C spec for console.log, error, etc #70

Closed bhelx closed 3 months ago

bhelx commented 5 months ago

As mentioned in the comments in #68, we do not conform to the full spec for console.log and the other methods on console. We should refactor it to be compliant. There are two paths:

  1. write some more rust code to emulate how
  2. expose the underlying IO functions and implement the console object in the js layer

For path number 2 you'd expose extism log functions as global js functions like this: https://github.com/extism/js-pdk/blob/2d72d29c172a8cf597033cd6c975a7bbb35ec579/crates/core/src/prelude/src/index.js#L8

then you'd implement the console object and it's methods in javascript

bhelx commented 3 months ago

Closed by #80