zotero / citeproc-rs

CSL processor in Rust.

Home Page:https://cormacrelf.github.io/citeproc-wasm-demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wasm bindings initialization with an ArrayBuffer

adomasven opened this issue · comments

It used to be able to initialize the citeproc web bindings by passing an ArrayBuffer to the initialization function, but that's no longer the case since the last few updates. If you pass an ArrayBuffer it tries to await it. The initialization function expects a string input that it then can fetch, but fetch is unavailable in the environment in which we run citeproc-rs in Zotero. Could the previous functionality be restored, or is this change part of the outside bindgen code?

Disregard, this might actually work fine as it used to (although I'm not sure why, since the wasm binding code calls await on an ArrayBuffer at one point)

Yeah in my fork I changed it to await init(Promise.resolve(xhr.response)) after I read the binding.