Skip to content

Commit

Permalink
Disable wasmbind feature by default
Browse files Browse the repository at this point in the history
This removes `wasmbind` from the default feature set, which stops chrono
from implicitly depending upon wasm-bindgen and js-sys. This is helpful
for a few reasons:

* It reduces the default dependency set by default for non-wasm
  projects, which shrinks the download size.

* Projects like Fuchsia have a policy where 3rd party crates need to be
  audited. While we don't use wasm-bindgen, we can't opt out of it by
  setting `default-features = false` because of [feature unification]
  ends up enabling chrono's default feature. See this [cargo issue]
  for more details. `wasm-bindgen` is large and complicated, so it's
  pretty expensive for us to update.

Fixes chronotope#1164

[feature unification]: https://doc.rust-lang.org/cargo/reference/features.html#feature-unification
[cargo issue]: rust-lang/cargo#4463
  • Loading branch information
erickt committed Feb 29, 2024
1 parent 999582e commit cc4c622
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ name = "chrono"

[features]
# Don't forget to adjust `ALL_NON_EXCLUSIVE_FEATURES` in CI scripts when adding a feature or an optional dependency.
default = ["clock", "std", "wasmbind"]
default = ["clock", "std"]
alloc = []
libc = []
winapi = ["windows-targets"]
Expand Down

0 comments on commit cc4c622

Please sign in to comment.