Skip to content

Commit

Permalink
slim down bevy features
Browse files Browse the repository at this point in the history
  • Loading branch information
inodentry committed Feb 26, 2022
1 parent df92de1 commit fa2f7b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exclude = ["examples/*.gif", ".github"]

[dependencies]
interpolation = "0.2"
bevy = { version = "0.6", default-features = false, features = [ "render" ] }
bevy = { version = "0.6", default-features = false, features = [ "bevy_render", "bevy_sprite", "bevy_ui", "bevy_text" ] }

This comment has been minimized.

Copy link
@djeedai

djeedai Mar 5, 2022

@inodentry that looks like a nice change to merge, I didn't realize that render was in turn a set of features. How can I test that this is the minimal set and that it doesn't break anything? Did you guess that list or is there a reliable way to come up with it?

This comment has been minimized.

Copy link
@inodentry

inodentry Mar 7, 2022

Author

For the purposes of your crate, just include the bevy features you need to compile. If you are using types from specific bevy crates, you need to enable those. Bevy's own configuration will make sure things don't break in users' projects. If you look through Bevy's Cargo.toml files, you will see how all the features are defined there. They should be set up in a way that you can't break things if you accidentally miss something.

If you want to make the configuration of your crate as flexible as possible, I suggest you go one step further than my change here. You can put your impls for bevy UI stuff behind a cargo feature of your own, and that way bevy_ui and bevy_text also don't need to be in this list, unless your own bevy_ui feature is enabled. :) You could even make the bevy_render and bevy_sprite dependencies optional.

I can imagine this would be useful, for example, to a user that only cares about Bevy's Transforms, and isn't using the Bevy renderer. There are plenty of people out there using just the core of Bevy and/or replacing the renderer with some external non-Bevy solution. :)

This comment has been minimized.

Copy link
@djeedai

djeedai Mar 18, 2022

FYI : djeedai#9 (currently broken due to rust nightly bug, waiting 24h for fixed nightly compiler to see if my CI passes).


[dev-dependencies]
bevy-inspector-egui = "0.8"
Expand Down

0 comments on commit fa2f7b2

Please sign in to comment.