Skip to content

Commit af90fa0

Browse files
WASM support (#26)
* feat(wasm): add wasm-js feature flag pass flag to the getrandom crate add feature documentation * chore: fix Clippy lints about crate docs indentation --------- Co-authored-by: Alejandro González <me@alegon.dev>
1 parent f07c5ef commit af90fa0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/vorbis_rs/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ getrandom = { version = "0.3.0", features = ["std"], optional = true }
3333
[features]
3434
default = ["stream-serial-rng"]
3535
stream-serial-rng = ["dep:getrandom"]
36+
wasm-js = ["getrandom?/wasm_js"]
3637

3738
[package.metadata.docs.rs]
3839
rustdoc-args = ["--cfg", "docsrs"]

packages/vorbis_rs/src/lib.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@
2020
//! # Features
2121
//!
2222
//! - `stream-serial-rng` (enabled by default): adds the [`VorbisEncoderBuilder::new`] convenience
23-
//! method, which automatically configures such a builder with suitable random
24-
//! Ogg stream serial numbers. This feature pulls dependencies on random number
25-
//! generation crates.
23+
//! method, which automatically configures such a builder with suitable random
24+
//! Ogg stream serial numbers. This feature pulls dependencies on random number
25+
//! generation crates.
26+
//! - `wasm-js`: enhances the ergonomics of using `vorbis_rs` when targeting JavaScript environments
27+
//! with WebAssembly. Currently, this enables the `wasm_js` feature flag on
28+
//! [`getrandom`](https://crates.io/crates/getrandom), opting into its [WebAssembly
29+
//! support](https://docs.rs/getrandom/latest/getrandom/#webassembly-support) for JavaScript
30+
//! environments, but the concrete effects of this flag may change at any point in the future.
2631
//!
2732
//! # Examples
2833
//!

0 commit comments

Comments
 (0)