Chriscbr / codespan-wasm

WebAssembly bindings for the Rust codespan-reporting crate
https://www.npmjs.com/package/codespan-wasm
MIT License
4 stars 0 forks source link

make `emitDiagnostic` sync (not async) #1

Closed yoav-steinberg closed 1 year ago

yoav-steinberg commented 1 year ago

I don't see why emitDiagnostic should be async, as it's basically calling codespan-reporting's underlying sync function. In my specific case I wanted to call emitDiagnostic in a js sync function that's being called back from within a wasm sync call:

js ---> call something in wasm and pass a callback to it ---> calls the js callback from within wasm ---> my sync callback can't call emitDiagnostic because it's async.

Chriscbr commented 1 year ago

I think it it should be possible, if I recall correctly I was just running into some weird webpack errors when I used a regular import.

Chriscbr commented 1 year ago

@yoav-steinberg Fixed in v0.4.0 🎉

yoav-steinberg commented 1 year ago

perfect! thanks.