leptos-use icon indicating copy to clipboard operation
leptos-use copied to clipboard

Incorrect chrono version dependency

Open AndrolGenhald opened this issue 10 months ago • 1 comments

Currently only chrono 0.4 is required, however use_calender uses chrono::Weekday::days_since which was added in 0.4.38. This causes a compilation error if an earlier version of chrono is used.

AndrolGenhald avatar Feb 19 '25 18:02 AndrolGenhald

I see! Thanks for reporting

maccesch avatar Feb 19 '25 18:02 maccesch

I see that this was solved, and that the 0.16.0 release has:

chrono = "=0.4.40"

But I am getting errors like this in my workspace:

error: failed to select a version for `chrono`.
    ... required by package `leptos-use v0.16.0`
    ... which satisfies dependency `leptos-use = "^0.16.0"` of package `xxx v0.1.0 (path\xxx)`
versions that meet the requirements `=0.4.40` are: 0.4.40

all possible versions conflict with previously selected packages.

  previously selected package `chrono v0.4.41`
    ... which satisfies dependency `chrono = "^0.4.41"` of package `yyy v0.1.0 (path\yyy)`

failed to select a version for `chrono` which could resolve this conflict
Error: recursive dependency update failed

I don't know the best practices in rust, so pardon if I am out of line - but could you maybe do something like this instead:

chrono = ">=0.4.38, <0.5"

That way I can pick my own chrono version as well.

emilbonnek avatar Jun 15 '25 16:06 emilbonnek

Sorry for the troubles. The thing is, they released a breaking change in 0.4.41 that conflicts with time. I guess we could try sth like >=0.4.38, <0.4.41.

maccesch avatar Jun 16 '25 14:06 maccesch

Oh okay.

Actually I am realizing I am not really using chrono inside use_leptos at all, since I am not using use_calendar. Maybe you could even make chrono optional and gate it behind the use_calendar feature?

chrono = { version = "=0.4.40", optional = true }
use_calendar = ["dep:chrono"]

emilbonnek avatar Jun 16 '25 14:06 emilbonnek