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

Move minijinja-contrib to jiff #694

Open
mitsuhiko opened this issue Feb 2, 2025 · 3 comments
Open

Move minijinja-contrib to jiff #694

mitsuhiko opened this issue Feb 2, 2025 · 3 comments
Labels
decision-needed A decision needs to be made

Comments

@mitsuhiko
Copy link
Owner

I am not using jiff for my own uses and having minijinja-contrib use time and time-tz is an extra dep. I also expect that in general jiff is going to win out so I need some sort of strategy to move over.

The main blocker is that the format in which time formats strings is incompatible with jiff. The format that the time crate accepts is [hour]:[minute]:[second] instead of %H:%M:%S.

The most trivial option would be different feature flags, another option would be to implement the format strings from the time crate for jiff. Unclear is also what the future of string formatting in jiff is. For instance this PR already changes some behavior: BurntSushi/jiff#147 and locale support is not really planned: BurntSushi/jiff#4

@mitsuhiko mitsuhiko added the decision-needed A decision needs to be made label Feb 2, 2025
@BurntSushi
Copy link

Unclear is also what the future of string formatting in jiff is.

I don't have any immediate plans to expand it substantially. The idea with the strtime API is to match the prevailing convention. (And the change I made was toward that end. Hopefully I don't need to change anything else.) I think it's unlikely that Jiff will get support for time's bespoke formatting DSL. What is the issue with migrating? Is time's DSL exposed in your API? (It looks like it isn't.)

As for locale support, what are you doing now? I don't think time has locale support. My plan here is to push folks toward using icu (with routines for doing the necessary datetime conversions), because locale support is a huge can of worms that I think is better for the icu folks to own.

For instance this PR already changes some behavior

To respond to what I think is the implied question of "how much churn can I expect," I'll say that a jiff 0.2 release is imminent. And unless anything severe comes up, my plan is to release jiff 1.0 this summer and then commit to it indefinitely.

@BurntSushi
Copy link

Oh I see, the labels short and medium and what not are just convenience things. But you do actually expose the full time DSL. Yeah, that's a tough one. Owch.

@mitsuhiko
Copy link
Owner Author

It was a mistake to expose the time crate like that for sure. Maybe the first step would be to just parse down strftime in the contrib crate and map it to the format string from time, and deprecate the other one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision-needed A decision needs to be made
Projects
None yet
Development

No branches or pull requests

2 participants