Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable wasmbind feature by default #1472

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

erickt
Copy link
Contributor

@erickt erickt commented Feb 29, 2024

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.

While I'd love to land this in the main branch, it's technically a breaking issue since downstream dependencies are probably not enabling the wasmbind feature if they need it.

Fixes #1164

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
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.34%. Comparing base (999582e) to head (cc4c622).

Additional details and impacted files
@@           Coverage Diff           @@
##            0.5.x    #1472   +/-   ##
=======================================
  Coverage   94.34%   94.34%           
=======================================
  Files          37       37           
  Lines       17009    17009           
=======================================
  Hits        16047    16047           
  Misses        962      962           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@djc djc merged commit a7cfa8c into chronotope:0.5.x Feb 29, 2024
35 checks passed
@djc
Copy link
Member

djc commented Feb 29, 2024

Thanks!

@erickt erickt deleted the remove-wasmbind-by-default branch March 4, 2024 17:57
@amitu
Copy link

amitu commented Mar 10, 2024

I would like to know the plan for releasing 0.5. I need this feature, and if its expected to land shortly I can wait, but if its going to take long I would consider removing chrono and try to compile my project somehow else.

@pitdicker
Copy link
Collaborator

If you are in a position to remove chrono, you probably are also in the position to use it without default features?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants