chrono icon indicating copy to clipboard operation
chrono copied to clipboard

add wasm-bindgen conversion impls to Datetime

Open demhadais opened this issue 2 months ago • 7 comments

This pull request adds the conversion impls for wasm-bindgen crate's traits to enable usage in structs annotated with #[wasm_bindgen]

demhadais avatar Oct 07 '25 14:10 demhadais

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 90.90%. Comparing base (ebc808e) to head (9949fed). :warning: Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1750      +/-   ##
==========================================
- Coverage   90.90%   90.90%   -0.01%     
==========================================
  Files          39       39              
  Lines       16254    16254              
==========================================
- Hits        14776    14775       -1     
- Misses       1478     1479       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Oct 07 '25 14:10 codecov[bot]

Closes #1749

demhadais avatar Oct 08 '25 15:10 demhadais

Per the recommendations on BurntSushi/jiff#424, I just want to alert the maintainers of chrono that the module these traits live in (wasm-bindgen::convert) is unstable and internal. Implementing these traits could pose semver compatibility issues.

demhadais avatar Oct 08 '25 18:10 demhadais

(Please squash any changes from feedback into the original commit.)

djc avatar Oct 09 '25 11:10 djc

@djc done! Thanks for the feedback. Again, I'd just like to alert you that the traits I've implemented are specifically marked as unstable, which poses semver issues. In practice, I'm not sure how much of an actual issue it will be, but I figured I'd reiterate in case you didn't see it last time.

demhadais avatar Oct 14 '25 06:10 demhadais

Ah, sorry, I missed your last comment on that. I think I'm still willing to take this, although I want an extra opt-in Cargo feature (let's call it wasm-bindgen-unstable) and will basically ignore any breakage from this.

djc avatar Oct 14 '25 07:10 djc

Sounds good to me! This will be incredibly useful for me so I'm happy this is going through.

demhadais avatar Oct 14 '25 20:10 demhadais