Skip to content

Simplify bevy_reflect Features #19123

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions crates/bevy_a11y/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@ serialize = ["dep:serde", "bevy_ecs/serialize", "accesskit/serde"]
## Allows access to the `std` crate. Enabling this feature will prevent compilation
## on `no_std` targets, but provides access to certain additional features on
## supported platforms.
std = ["bevy_app/std", "bevy_ecs/std", "bevy_reflect/std"]
std = ["bevy_app/std", "bevy_ecs/std"]

## `critical-section` provides the building blocks for synchronization primitives
## on all platforms, including `no_std`.
critical-section = [
"bevy_app/critical-section",
"bevy_ecs/critical-section",
"bevy_reflect?/critical-section",
]
critical-section = ["bevy_app/critical-section", "bevy_ecs/critical-section"]

[dependencies]
# bevy
Expand Down
3 changes: 0 additions & 3 deletions crates/bevy_app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ error_panic_hook = []
## on `no_std` targets, but provides access to certain additional features on
## supported platforms.
std = [
"bevy_reflect?/std",
"bevy_ecs/std",
"dep:ctrlc",
"downcast-rs/std",
Expand All @@ -58,15 +57,13 @@ critical-section = [
"bevy_tasks/critical-section",
"bevy_ecs/critical-section",
"bevy_platform/critical-section",
"bevy_reflect?/critical-section",
]

## Enables use of browser APIs.
## Note this is currently only applicable on `wasm32` architectures.
web = [
"bevy_platform/web",
"bevy_tasks/web",
"bevy_reflect?/web",
"dep:wasm-bindgen",
"dep:web-sys",
"dep:console_error_panic_hook",
Expand Down
3 changes: 0 additions & 3 deletions crates/bevy_asset/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ bevy_app = { path = "../bevy_app", version = "0.16.0-dev", default-features = fa
bevy_tasks = { path = "../bevy_tasks", version = "0.16.0-dev", default-features = false, features = [
"web",
] }
bevy_reflect = { path = "../bevy_reflect", version = "0.16.0-dev", default-features = false, features = [
"web",
] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
notify-debouncer-full = { version = "0.5.0", default-features = false, optional = true }
Expand Down
3 changes: 0 additions & 3 deletions crates/bevy_audio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ rodio = { version = "0.20", default-features = false, features = [
bevy_app = { path = "../bevy_app", version = "0.16.0-dev", default-features = false, features = [
"web",
] }
bevy_reflect = { path = "../bevy_reflect", version = "0.16.0-dev", default-features = false, features = [
"web",
] }

[features]
mp3 = ["rodio/mp3"]
Expand Down
10 changes: 2 additions & 8 deletions crates/bevy_color/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,14 @@ encase = { version = "0.10", default-features = false, optional = true }

[features]
default = ["std", "bevy_reflect", "encase"]
std = [
"alloc",
"bevy_math/std",
"serde?/std",
"wgpu-types?/std",
"bevy_reflect?/std",
]
std = ["alloc", "bevy_math/std", "serde?/std", "wgpu-types?/std"]
alloc = ["bevy_math/alloc", "serde?/alloc"]
serialize = ["serde", "bevy_math/serialize"]
bevy_reflect = ["dep:bevy_reflect"]
wgpu-types = ["dep:wgpu-types"]
encase = ["dep:encase", "std"]
libm = ["bevy_math/libm"]
critical-section = ["bevy_reflect?/critical-section"]
critical-section = []

[lints]
workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_ecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ async_executor = ["std", "bevy_tasks/async_executor"]
## on `no_std` targets, but provides access to certain additional features on
## supported platforms.
std = [
"bevy_reflect?/std",
"bevy_tasks/std",
"bevy_utils/std",
"bitflags/std",
Expand All @@ -92,7 +91,6 @@ std = [
critical-section = [
"bevy_tasks/critical-section",
"bevy_platform/critical-section",
"bevy_reflect?/critical-section",
]

[dependencies]
Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ std = [
"bevy_ecs/std",
"bevy_math/std",
"bevy_utils/std",
"bevy_reflect/std",
"bevy_platform/std",
]

Expand All @@ -52,7 +51,6 @@ std = [
critical-section = [
"bevy_app/critical-section",
"bevy_ecs/critical-section",
"bevy_reflect?/critical-section",
"bevy_platform/critical-section",
]

Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_input_focus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ std = [
"bevy_app/std",
"bevy_ecs/std",
"bevy_math/std",
"bevy_reflect/std",
"bevy_input/std",
"bevy_window/std",
]
Expand All @@ -51,7 +50,6 @@ std = [
critical-section = [
"bevy_app/critical-section",
"bevy_ecs/critical-section",
"bevy_reflect?/critical-section",
"bevy_input/critical-section",
]

Expand Down
9 changes: 1 addition & 8 deletions crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ std = [
"bevy_input_focus?/std",
"bevy_math/std",
"bevy_platform/std",
"bevy_reflect/std",
"bevy_state?/std",
"bevy_time/std",
"bevy_transform/std",
Expand All @@ -314,7 +313,6 @@ critical-section = [
"bevy_input/critical-section",
"bevy_input_focus?/critical-section",
"bevy_platform/critical-section",
"bevy_reflect/critical-section",
"bevy_state?/critical-section",
"bevy_time/critical-section",
"bevy_utils/critical-section",
Expand Down Expand Up @@ -342,12 +340,7 @@ async_executor = [

# Enables use of browser APIs.
# Note this is currently only applicable on `wasm32` architectures.
web = [
"bevy_app/web",
"bevy_platform/web",
"bevy_reflect/web",
"bevy_tasks/web",
]
web = ["bevy_app/web", "bevy_platform/web", "bevy_tasks/web"]

[dependencies]
# bevy (no_std)
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_math/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ std = [
"approx?/std",
"rand?/std",
"rand_distr?/std",
"bevy_reflect?/std",
]
alloc = [
"itertools/use_alloc",
Expand Down
41 changes: 9 additions & 32 deletions crates/bevy_reflect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["bevy"]
rust-version = "1.85.0"

[features]
default = ["std", "smallvec", "debug"]
default = ["smallvec", "debug"]

# Features

Expand All @@ -26,7 +26,7 @@ functions = ["bevy_reflect_derive/functions"]
debug = ["debug_stack"]

## When enabled, keeps track of the current serialization/deserialization context for better error messages
debug_stack = ["std"]
debug_stack = ["bevy_platform/std"]

# Integrations

Expand All @@ -37,7 +37,7 @@ glam = ["dep:glam"]
hashbrown = ["dep:hashbrown"]

## Adds reflection support to `petgraph` types.
petgraph = ["dep:petgraph", "std"]
petgraph = ["dep:petgraph"]

## Adds reflection support to `smallvec` types.
smallvec = ["dep:smallvec"]
Expand All @@ -48,33 +48,8 @@ uuid = ["dep:uuid"]
## Adds reflection support to `wgpu-types` types.
wgpu-types = ["dep:wgpu-types"]

# Platform Compatibility

## Allows access to the `std` crate. Enabling this feature will prevent compilation
## on `no_std` targets, but provides access to certain additional features on
## supported platforms.
std = [
"bevy_utils/std",
"erased-serde/std",
"downcast-rs/std",
"serde/std",
"glam?/std",
"smol_str?/std",
"uuid?/std",
"bevy_platform/std",
"wgpu-types?/std",
]

## `critical-section` provides the building blocks for synchronization primitives
## on all platforms, including `no_std`.
critical-section = [
"bevy_platform/critical-section",
"bevy_utils/critical-section",
]

## Enables use of browser APIs.
## Note this is currently only applicable on `wasm32` architectures.
web = ["bevy_platform/web", "uuid?/js"]
## Adds reflection support to `smol_str` types.
smol_str = ["dep:smol_str"]

[dependencies]
# bevy
Expand Down Expand Up @@ -105,13 +80,15 @@ assert_type_match = "0.1.1"
smallvec = { version = "1.11", default-features = false, optional = true }
glam = { version = "0.29.3", default-features = false, features = [
"serde",
"nostd-libm",
], optional = true }
petgraph = { version = "0.7", features = ["serde-1"], optional = true }
petgraph = { version = "0.7", features = [
"serde-1",
], default-features = false, optional = true }
smol_str = { version = "0.2.0", default-features = false, features = [
"serde",
], optional = true }
uuid = { version = "1.13.1", default-features = false, optional = true, features = [
"v4",
"serde",
] }
variadics_please = "1.1"
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_reflect/src/impls/smallvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,5 +234,4 @@ where
}
}

#[cfg(feature = "functions")]
crate::func::macros::impl_function_traits!(SmallVec<T>; <T: SmallArray + TypePath + Send + Sync> where T::Item: FromReflect + MaybeTyped + TypePath);
crate::impls::maybe_impl_functions_traits!(SmallVec<T>; <T: SmallArray + TypePath + Send + Sync> where T::Item: FromReflect + MaybeTyped + TypePath);
Loading