Skip to content

Commit

Permalink
rename wasm-bindgen feature to js
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Oct 29, 2021
1 parent 9c07eb0 commit cd9786f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 84 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -91,9 +91,12 @@ jobs:

- name: Install
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Default features
run: wasm-pack test --node -- --features "wasm-bindgen v1 v3 v4 v5"
run: wasm-pack test --node

- name: Version features
run: wasm-pack test --node -- --features "js v1 v3 v4 v5"

embedded:
name: Build / Embedded
Expand Down
71 changes: 0 additions & 71 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions Cargo.toml
Expand Up @@ -55,12 +55,11 @@ repository = "uuid-rs/uuid"
default = ["std"]
guid = ["winapi"]
std = []
stdweb = ["getrandom", "getrandom/js"]
v1 = ["atomic"]
v3 = ["md-5"]
v4 = ["getrandom"]
v5 = ["sha-1"]
wasm-bindgen = ["getrandom", "getrandom/js"]
js = ["getrandom", "getrandom/js"]

# Private
[dependencies.getrandom]
Expand Down
6 changes: 2 additions & 4 deletions README.md
Expand Up @@ -49,10 +49,8 @@ various pieces of functionality:
You need to enable one of the following Cargo features together with the
`v4` feature if you're targeting `wasm32-unknown-unknown` target:

* `stdweb` - enables support for `OsRng` on `wasm32-unknown-unknown` via
`stdweb` combined with `cargo-web`
* `wasm-bindgen` - `wasm-bindgen` enables support for `OsRng` on
`wasm32-unknown-unknown` via [`wasm-bindgen`]
* `js` - enables support for randomness on
`wasm32-unknown-unknown` via [`getrandom`]

Alternatively, you can provide a custom `getrandom` implementation yourself
via [`getrandom::register_custom_getrandom`](https://docs.rs/getrandom/0.2.2/getrandom/macro.register_custom_getrandom.html).
Expand Down
14 changes: 9 additions & 5 deletions src/lib.rs
Expand Up @@ -68,11 +68,16 @@
//!
//! ## WebAssembly
//!
//! For WebAssembly, enable one of the following features depending
//! on your JavaScript interop toolchain of choice:
//! For WebAssembly, enable the `js` feature along with `v4` for a
//! source of randomness:
//!
//! * `stdweb` - for [`stdweb`] combined with [`cargo-web`]
//! * `wasm-bindgen` - for [`wasm-bindgen`]
//! ```toml
//! [dependencies]
//! uuid = { version = "0.8", features = ["v4", "js"] }
//! ```
//!
//! You don't need the `js` feature to use `uuid` in WebAssembly if you're
//! not enabling other features too.
//!
//! ## Embedded
//!
Expand Down Expand Up @@ -158,7 +163,6 @@
//!
//! [`wasm-bindgen`]: https://crates.io/crates/wasm-bindgen
//! [`cargo-web`]: https://crates.io/crates/cargo-web
//! [`stdweb`]: https://crates.io/crates/stdweb
//! [`Uuid`]: struct.Uuid.html
//! [`Uuid::new_v1`]: struct.Uuid.html#method.new_v1
//! [`Uuid::new_v3`]: struct.Uuid.html#method.new_v3
Expand Down

0 comments on commit cd9786f

Please sign in to comment.