Skip to content

feat: re-export taffy crate so users can name taffy types without a separate dependency#191

Merged
ccbrown merged 1 commit into
ccbrown:mainfrom
Ai-chan-0411:feat/reexport-taffy
Apr 15, 2026
Merged

feat: re-export taffy crate so users can name taffy types without a separate dependency#191
ccbrown merged 1 commit into
ccbrown:mainfrom
Ai-chan-0411:feat/reexport-taffy

Conversation

@Ai-chan-0411
Copy link
Copy Markdown
Contributor

Background

While exploring MeasureFunc, I ran into the problem described in #189 — the callback signature requires taffy::Size, taffy::AvailableSpace, and taffy::Style, but none of those types are currently accessible through iocraft::. Trying to write an implementation like:

fn my_measure(
    known: taffy::Size<Option<f32>>,
    available: taffy::Size<taffy::AvailableSpace>,
    style: &taffy::Style,
) -> taffy::Size<f32> {
    ...
}

…forces users to add taffy separately to Cargo.toml just to name the return type, which is awkward when iocraft already bundles it internally.

Change

Following the suggestion in the issue, this PR adds a single line:

pub use taffy;

to packages/iocraft/src/lib.rs. Users can now write iocraft::taffy::Size<f32> instead of depending on taffy directly.

Testing

The change is a one-line re-export. Existing tests all pass and the MeasureFunc type signature is unmodified — this purely exposes what was already an internal dependency.

Users who implement MeasureFunc need to reference taffy types such as
taffy::Size, taffy::AvailableSpace, and taffy::Style directly. Previously
this required adding taffy as a separate dependency. Adding pub use taffy
lets users access these types via iocraft::taffy::Size etc. without
a redundant Cargo dependency.

Closes ccbrown#189
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.71%. Comparing base (090d2bb) to head (becf3ad).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #191   +/-   ##
=======================================
  Coverage   87.71%   87.71%           
=======================================
  Files          35       35           
  Lines        5526     5526           
  Branches     5526     5526           
=======================================
  Hits         4847     4847           
  Misses        570      570           
  Partials      109      109           

Impacted file tree graph

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

@ccbrown ccbrown added the enhancement New feature or request label Apr 15, 2026
@ccbrown ccbrown merged commit ac23e6d into ccbrown:main Apr 15, 2026
5 checks passed
@ccbrown
Copy link
Copy Markdown
Owner

ccbrown commented Apr 15, 2026

Thank you!

@github-actions github-actions Bot mentioned this pull request Apr 10, 2026
@Ai-chan-0411
Copy link
Copy Markdown
Contributor Author

Thank you for merging! I appreciate the quick review and merge. This makes taffy type handling much more ergonomic for users of iocraft.

@robn
Copy link
Copy Markdown

robn commented Apr 17, 2026

Oh neat, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants