Skip to content

bevy_asset, bevy_state, and bevy_log feature gates - #16

Open
Totobird-Creations wants to merge 5 commits into
mintlu8:mainfrom
Totobird-Creations:feature_gate_bevy
Open

bevy_asset, bevy_state, and bevy_log feature gates#16
Totobird-Creations wants to merge 5 commits into
mintlu8:mainfrom
Totobird-Creations:feature_gate_bevy

Conversation

@Totobird-Creations

Copy link
Copy Markdown

Title pretty much explains it.
This adds the bevy_asset, bevy_state, and bevy_log crate features which gate the bevy features with the same names.

@mintlu8

mintlu8 commented Mar 15, 2026

Copy link
Copy Markdown
Owner

That's too many feature flags than what I would like. Is there any reason bevy_defer would be used with such a barebones version of bevy?

I can understand removing bevy_asset, since its a somewhat large dependency.

@Totobird-Creations

Copy link
Copy Markdown
Author

bevy_asset is definitely the main one. Like you said, large dependency, and some headless applications don't care to have it.

bevy_state, I don't use in a lot of my Bevy projects. One I'm working on is a non-game, long-running application that has no reason to keep track of a "global state". bevy_defer is still being used in this project because there are several async tasks which need access to the world.

Gating bevy_log is debatable. I decided to include it for completeness.

The point of this PR is to allow people to disable anything they don't need, that isn't essential. The bevy library does this for the bevy_* crates.
You're probably correct in saying that most people will keep these flags enabled, but having the option is the point.

@mintlu8

mintlu8 commented Mar 16, 2026

Copy link
Copy Markdown
Owner

The point of this PR is to allow people to disable anything they don't need, that isn't essential. The bevy library does this for the bevy_* crates. You're probably correct in saying that most people will keep these flags enabled, but having the option is the point.

The problem is more feature flags makes things harder to test since you can't really spam all the feature flag combinations in ci.

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.

2 participants