Skip to content

feat: add optional jiff as chrono replacement - #1120

Open
tziemek wants to merge 1 commit into
oxidecomputer:mainfrom
tziemek:feat/jiff-feature
Open

tziemek wants to merge 1 commit into
oxidecomputer:mainfrom
tziemek:feat/jiff-feature

Conversation

@tziemek

@tziemek tziemek commented Nov 24, 2026

Copy link
Copy Markdown

resolves #1111

date and date-time string formats are now mapped to a date library chosen by Cargo feature. chrono stays the default, so existing output is unchanged. jiff is available as an alternative, and it takes precedence when both are enabled. With neither feature, dates are plain Strings.

Changes:

  • typify-impl has chrono (default) and jiff marker features. typify emits the paths and never links either crate, so these only select which path is generated
  • typify, typify-macro, and cargo-typify forward the features.
  • Workspace entries for typify, typify-impl, and typify-macro now set default-features = false. Cargo doesn't allow a member to override default-features on an inherited dependency, so this is the only way to let each crate choose.

Remarks:

  • The jiff types omit JsonSchema. schemars 0.8, which typify uses, has no jiff impl.
  • A type that requires JsonSchema and holds a jiff date is refused when rendered, with an error naming ::jiff::Timestamp.
  • chrono golden files only run under chrono
  • workspace-inherited crates must now pick features!
  • jiffs Timestamp is not chronos DateTime, API differs

@tziemek
tziemek marked this pull request as ready for review November 24, 2026 10:24
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.

Replacement for chrono

1 participant