Skip to content

Commit

Permalink
add depependencies: js-sys wasm-bindgen web-sys
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluis committed Nov 30, 2024
1 parent 6a49414 commit 33df4a2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 8 deletions.
28 changes: 24 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ publish = true
bench = false


[features] # 197/300 (103 remaining), 84 visible, 113 hidden
[features] # 200/300 (100 remaining), 87 visible, 113 hidden
# ==============================================================================
# https://doc.rust-lang.org/cargo/reference/features.html

Expand Down Expand Up @@ -117,8 +117,9 @@ alloc = [ # enables `alloc` functionality
]
std = [ # disables `no_std` compatibility and enables `std` functionality
"alloc",
"atomic?/std", "bytemuck?/extern_crate_std", "jiff?/std", "log?/std",
"memchr?/std", "rand_core?/std", "wide?/std",
"atomic?/std", "bytemuck?/extern_crate_std", "jiff?/std", "js-sys?/std",
"log?/std", "memchr?/std", "rand_core?/std", "wasm-bindgen?/std", "web-sys?/std",
"wide?/std",
]
no_std = [] # enables functionality incompatible with or substitute of `std`

Expand Down Expand Up @@ -539,6 +540,7 @@ dep_bytemuck = ["dep:bytemuck"] # *
dep_const_str = ["dep:const-str"] # text::str
dep_hashbrown = ["dep:hashbrown", "alloc"] # data::collections
dep_jiff = ["dep:jiff", "alloc"] # sys::time
dep_js_sys = ["dep:js-sys"] # CHECK
dep_libm = ["dep:libm"] # num::float
dep_log = ["dep:log"] # sys::log
dep_memchr = ["dep:memchr"] # text
Expand All @@ -550,10 +552,12 @@ dep_rodio = ["dep:rodio"] # sys::sound
dep_tinyaudio = ["dep:tinyaudio"] # sys::sound
dep_unicode_segmentation = ["dep:unicode-segmentation"] # text
dep_unicode_width = ["dep:unicode-width"] # text
dep_wasm_bindgen = ["dep:wasm-bindgen"] # CHECK
dep_web_sys = ["dep:web-sys"] # CHECK
dep_wide = ["dep:wide"] # *


[dependencies] # 19 (2 required, 17 optional)
[dependencies] # 22 (2 required, 20 optional)
# ==============================================================================
# https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html
#
Expand Down Expand Up @@ -604,6 +608,12 @@ optional = true # safe ± (few & checked)
default-features = false # 10 https://docs.rs/crate/jiff/latest/features
# features = [""] # https://docs.rs/jiff/0.1.14/jiff/#crate-features

[dependencies.js-sys] # https://crates.io/crates/js-sys
version = "0.3.74" # ✗ https://github.com/rustwasm/wasm-bindgen/commits/main/crates/js-sys
optional = true # unsafe
default-features = false # 2 https://docs.rs/crate/js-sys/latest/features
# deps: once-cell, wasm-bindgen/std

[dependencies.libm] # https://crates.io/crates/libm
version = "0.2.11" # ✓ https://github.com/rust-lang/libm/blob/master/CHANGELOG.md
optional = true # unsafe
Expand Down Expand Up @@ -663,6 +673,16 @@ optional = true # safe
default-features = false # 7 https://docs.rs/crate/unicode-width/latest/features
# features = ["cjk"]

[dependencies.wasm-bindgen] # https://crates.io/crates/wasm-bindgen
version = "0.2.97" # ✓ https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md
optional = true # unsafe
default-features = false # 10 https://docs.rs/crate/wasm-bindgen/latest/features

[dependencies.web-sys] # https://crates.io/crates/web-sys
version = "0.3.74" # ✗ https://github.com/rustwasm/wasm-bindgen/commits/main/crates/web-sys
optional = true # unsafe (unsafe dependencies)
default-features = false # 1657 https://docs.rs/crate/web-sys/latest/features

[dependencies.wide] # https://crates.io/crates/wide
version = "0.7.26" # ✗ https://github.com/Lokathor/wide/commits/main/
optional = true # unsafe
Expand Down
2 changes: 1 addition & 1 deletion DOCS/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The format is based on [Keep a Changelog], and this project adheres to
- macros: `assert_const!`, `cfg_if!`.
- traits: `ConstBool`.
- optional dependencies:
- `jiff`, `rayon`, `rodio`, `tinyaudio`.
- `jiff`, `js-sys`, `rayon`, `rodio`, `tinyaudio`, `wasm-bindgen`, `web-sys`.
- re-export:
- items from: `core::{cell, num, ops, result}`, `std::{backtrace, fmt}`.
- fns: `array_from_fn`, `array_from_mut`, `array_from_ref`.
Expand Down
5 changes: 3 additions & 2 deletions build/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ mod reflection {
flags: &["_dep_·"],
features: &[
"dep_atomic", "dep_bytemuck", "dep_const_str", "dep_hashbrown", "dep_jiff",
"dep_libm", "dep_log", "dep_memchr", "dep_miniquad",
"dep_js_sys", "dep_libm", "dep_log", "dep_memchr", "dep_miniquad",
"dep_portable_atomic", "dep_rand_core", "dep_rayon", "dep_rodio", "dep_tinyaudio",
"dep_unicode_segmentation", "dep_unicode_width", "dep_wide",
"dep_unicode_segmentation", "dep_unicode_width", "dep_wasm_bindgen", "dep_web_sys",
"dep_wide",
]
};

Expand Down
12 changes: 11 additions & 1 deletion src/_dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ reexport! { optional_crate (unsafe) "dep_hashbrown", "hashbrown", hashbrown,
reexport! { optional_crate (safe) "dep_jiff", "jiff", jiff,
doc: "A high level datetime library that is secure and performant."
}
reexport! { optional_crate (unsafe) "dep_js_sys", "js-sys", js_sys,
doc: "Bindings for all JS global objects and functions in all JS environments."
}
reexport! { optional_crate (unsafe) "dep_libm", "libm", libm,
doc: "A port of [`MUSL`](https://musl.libc.org/)'s libm to Rust."
}
Expand All @@ -73,12 +76,19 @@ reexport! { optional_crate (unsafe) "dep_tinyaudio", "tinyaudio", tinyaudio,
doc: "A cross-platform, easy-to-use, low-level, audio output library.",
features: "alloc"
}
reexport! { optional_crate (safe) "dep_unicode_segmentation", "unicode-segmentation", unicode_segmentation,
reexport! { optional_crate (safe)
"dep_unicode_segmentation", "unicode-segmentation", unicode_segmentation,
doc: "Split strings on Grapheme Clusters, Words or Sentences."
}
reexport! { optional_crate (safe) "dep_unicode_width", "unicode-width", unicode_width,
doc: "Determine displayed width of `char` and `str` types."
}
reexport! { optional_crate (unsafe) "dep_wasm_bindgen", "wasm-bindgen", wasm_bindgen,
doc: "Easy support for interacting between JS and Rust."
}
reexport! { optional_crate (unsafe) "dep_web_sys", "web-sys", web_sys,
doc: "Bindings for all Web APIs."
}
reexport! { optional_crate (unsafe) "dep_wide", "wide", wide,
doc: "SIMD-compatible data types."
}

0 comments on commit 33df4a2

Please sign in to comment.