-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export an init
function
#1
Comments
A better workaround for the time being: // execute at start of module
const res = new HTMLRewriter().transform(new Response("Initialized wasm"));
console.log(await res.text()); |
The code this module is based on triggered the WASM initialization lazily as part of |
What I mean to say is there is a delay the first time you use it while it is loading the wasm. It would be good if you could load the wasm when your module starts (when using this in deno for example) to avoid the delay on first usage. |
Can you confirm that calling |
It works but feels hacky/like a workaround. A more explicit function would be preferable Edit: Only calling the constructor is enough to trigger it but it is not possible to await the initialisation which defeats the point. |
In order to allow pre-emptive initialisation of the wasm module to prevent an unwanted lag on the first request.
Current workaround is calling
new HtmlRewriter()
and adelay()
function, but this functionality should ideally be exported from the library.The text was updated successfully, but these errors were encountered: