Make bevy_app's optional bevy_reflect dependency actually optional (#4846)

# Objective

- Make bevy_app's optional bevy_reflect dependency actually optional
- Because bevy_ecs has a default dependency on bevy_reflect, bevy_app includes bevy_reflect transitively even with default-features=false, despite the optional dependency indicating that it was intended to be able to leave out bevy_reflect.

## Solution

- Make bevy_app not enable bevy_ecs's default features, and then use [the `dep:` syntax](https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies) introduced in 1.60 to make the default bevy_reflect feature enable bevy_ecs's bevy_reflect feature/dependency.

---

## Changelog

- bevy_app no longer enables bevy_ecs's `bevy_reflect` feature when included without its own `bevy_reflect` feature (which is on by default).
This commit is contained in:
Christopher Durham 2022-05-26 02:04:22 +00:00
parent 644bd5dbc6
commit 589c52afe5

View File

@ -12,11 +12,12 @@ keywords = ["bevy"]
trace = []
bevy_ci_testing = ["serde", "ron"]
default = ["bevy_reflect"]
bevy_reflect = ["dep:bevy_reflect", "bevy_ecs/bevy_reflect"]
[dependencies]
# bevy
bevy_derive = { path = "../bevy_derive", version = "0.8.0-dev" }
bevy_ecs = { path = "../bevy_ecs", version = "0.8.0-dev" }
bevy_ecs = { path = "../bevy_ecs", version = "0.8.0-dev", default-features = false }
bevy_reflect = { path = "../bevy_reflect", version = "0.8.0-dev", optional = true }
bevy_utils = { path = "../bevy_utils", version = "0.8.0-dev" }