Skip to content

Commit e1230fd

Browse files
Remove re-exports of cosmic_text types (#19516)
# Objective As discussed in #19285, we do a poor job at keeping the namespace tidy and free of duplicates / user-conflicting names in places. `cosmic_text` re-exports were the worst offender. ## Solution Remove the re-exports completely. While the type aliases were quite thoughtful, they weren't used in any of our code / API.
1 parent 5df9c53 commit e1230fd

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

crates/bevy_text/src/text.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
pub use cosmic_text::{
2-
self, FamilyOwned as FontFamily, Stretch as FontStretch, Style as FontStyle,
3-
Weight as FontWeight,
4-
};
5-
61
use crate::{Font, TextLayoutInfo, TextSpanAccess, TextSpanComponent};
72
use bevy_asset::Handle;
83
use bevy_color::Color;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Removed `cosmic_text` re-exports
3+
pull_requests: [TODO]
4+
---
5+
6+
Previously, `bevy_text` re-exported the entirety of `cosmic_text` while renaming a few of the most confusing re-exports,
7+
using the following code.
8+
9+
```rust
10+
pub use cosmic_text::{
11+
self, FamilyOwned as FontFamily, Stretch as FontStretch, Style as FontStyle, Weight as FontWeight,
12+
};
13+
```
14+
15+
These re-exports commonly conflicted with other types (like `Query`!), leading to messy autocomplete errors.
16+
Ultimately, these are largely an implementation detail, and were not widely used.
17+
18+
We've completely removed these re-exports (including the renamed types): if you need to use these types, please rely on them directly from `cosmic_text`, being sure that the version number you are using matches the version used by your version of `bevy_text`.

0 commit comments

Comments
 (0)