-
Notifications
You must be signed in to change notification settings - Fork 3
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 wasm support for both web and node environment #1
Conversation
Cargo.toml
Outdated
getrandom = { version = "0.2", features = ["js"] } | ||
serde-wasm-bindgen = "0.4" | ||
wasm-bindgen = "0.2.95" | ||
serde_bytes = "0.11" |
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.
Let's make them optional and enable them by the feature js
.
pub struct VerifiedReport { | ||
pub status: String, | ||
pub advisory_ids: Vec<String>, | ||
pub report: Report, | ||
} | ||
|
||
#[wasm_bindgen] |
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.
#[wasm_bindgen] | |
#[cfg(feature = "js")] | |
#[wasm_bindgen] |
AFAIK, the reqwest supports running in browser. Is there any problem to export the |
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.
Great work. Thanks a lot.
Here are the changes to reviewed comments:
|
This is PR is going to adding wasm support for both web and node envrionment by compile the library to
wasm-unknow-unknown
target.Note that
js
feature should be enabled and due to tls not been supportted by WASM,get_collateral
will be disabled at the time