Skip to content

Conversation

joyeecheung
Copy link
Member

This uses the synchronous WebAssembly APIs to compile the WASM part synchronously, which allows users to initialize the library and parse synchronously with WASM without having to resort to the JS version. This would be useful for Node.js core to use the WASM version in paths that require synchronous initialization (it currently always uses the JS version for that).

@joyeecheung joyeecheung requested a review from guybedford August 22, 2024 11:00
const initPromise = Promise.resolve();

module.exports.init = () => initPromise;
module.exports.initSync = () => {};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why dist/lexer.js was never documented in the README, despite being what Node.js core has been using. But anyway this is added to lexer.js for parity.

This uses the synchronous WebAssembly APIs to compile the WASM
part synchronously, which allows users to initialize the library
and parse synchronously with WASM without having to resort
to the JS version. This would be useful for Node.js core to
use the WASM version in paths that require synchronous
initialization (it currently always uses the JS version for that).
@guybedford guybedford merged commit 5bb8cc3 into nodejs:main Aug 25, 2024
1 check failed
@guybedford
Copy link
Collaborator

I'm not sure why CI has suddenly stopped triggering for this repo, but I tested locally and released this in 1.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants