-
Notifications
You must be signed in to change notification settings - Fork 12
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
Remove top-level await #268
Conversation
@@ -23,13 +21,11 @@ let workerPromise; | |||
*/ | |||
let numWorkers = undefined; | |||
|
|||
let isInitialized = false; | |||
async function initializeBindings() { | |||
wasm = plonkWasm(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this here to make the initial loading time even faster (< 20ms)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any use in returning from the function early if wasm
is already defined? Let's say we accidentally call initializeBindings()
twice, does that mean we have to wait for loading twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's very important! I moved the early return logic into snarky.web.js, through which this function will always be called
companion for o1-labs/o1js#1583