Repository: chronotope/chrono (language: rust)

Issue:
Disable wasmbind feature by default
When compiling a dependency that transitively includes chrono for a wasm32 target, chrono implicitly pulls in wasm_bindgen. However, this is not desirable if you are not using wasm bindgen, but compiling for a plain wasm target. wasm_bindgen imposes requirements on the output wasm file, e.g. imports it needs from the JS environment, which might not always be available. Assuming that all wasm32-unknown-unknown targets are using wasm_bindgen is not a safe assumption.

If chrono was a direct dependency, I could turn off the default features, but since it is a transitive dependency this is not possible. Therefore I think it should be turned off by default. Turning _on_ features in transitive dependencies is possible via [feature unification](https://doc.rust-lang.org/cargo/reference/features.html#feature-unification). You'd make chrono a direct dependency and add the wasmbind feature, and it will also be enabled for other dependencies. However the opposite is not possible.


Discussion / hints:
The problem is that this would be a breaking change for users that rely on the `wasmbind` feature. Maybe something to consider for 0.5?

Fix patch:
diff --git a/Cargo.toml b/Cargo.toml
index 1e5182d961..b73af200f6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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"]


Test patch: