-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Feature-gate all references to bevy_text
in bevy_ui
#11391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
system extract_uinodes
should not be behind the bevy_text
feature, it can work without changes without bevy_text
I believe I fixed this in b236ab5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is... less bad. Not the prettiest but it'll do.
I'm considering moving all of the #[cfg(feature = "bevy_text")]
fn build_text_interop(app: &mut App) {
app.add_systems(...);
// etc.
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a reasonable way to contain the current dependencies.
…1391) # Objective - `bevy_ui` fails to compile without `bevy_text` being enabled. - Fixes bevyengine#11363. ## Solution - Add `#[cfg(feature = "bevy_text")]` to all items that require it. I think this change is honestly a bit ugly, but I can't see any other way around it. I considered making `bevy_text` required, but we agreed [on Discord](https://discord.com/channels/691052431525675048/743663673393938453/1196868117486379148) that there were some use cases for `bevy_ui` without `bevy_text`. If you have any ideas that decreases the amount of `#[cfg(...)]`s and `#[allow(...)]`s, that would be greatly appreciated. This was tested by running the following commands: ```shell $ cargo clippy -p bevy_ui $ cargo clippy -p bevy_ui -F bevy_text $ cargo run -p ci ``` --- ## Changelog - Fixed `bevy_ui` not compiling without `bevy_text`.
Objective
bevy_ui
fails to compile withoutbevy_text
being enabled.bevy_ui
does not compile withoutbevy_text
feature #11363.Solution
#[cfg(feature = "bevy_text")]
to all items that require it.I think this change is honestly a bit ugly, but I can't see any other way around it. I considered making
bevy_text
required, but we agreed on Discord that there were some use cases forbevy_ui
withoutbevy_text
. If you have any ideas that decreases the amount of#[cfg(...)]
s and#[allow(...)]
s, that would be greatly appreciated.This was tested by running the following commands:
Changelog
bevy_ui
not compiling withoutbevy_text
.