Skip to content
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

Add version to quickjs provider wasm file #320

Open
jianghong opened this issue Apr 25, 2023 · 0 comments
Open

Add version to quickjs provider wasm file #320

jianghong opened this issue Apr 25, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@jianghong
Copy link
Contributor

We want to expose the version set in the Javy Core crate's Cargo.toml as part of the javy_quickjs_provider.wasm file so third-party developers using the module can inspect the version of the module and confirm it is the version they are expecting.

An ideal implementation would encode the major, minor, and patch versions inside a single i64 exported by the Wasm module. Less ideally would be three separate exports for major, minor, and patch versions. And if that approach doesn't work, then use a custom section.

Using an export of a single i64 is ideal because it minimizes code size and is easy for consuming code to retrieve (that is, they do not need to use wasmparser). We should be able to use a single i64 by reserving different ranges of bits in the i64 for different parts of the version and use bit shifting to encode the three components of the version and on the calling side, bit shifting to decode the three parts of the version.

@jianghong jianghong added the enhancement New feature or request label Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant