-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Feature gate render in UI (fix bevy_test feature) #16322
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 render in UI (fix bevy_test feature) #16322
Conversation
I think it makes sense to also fix bevy_text feature in this PR because there will be a lot of merge conflicts if split. |
After merge: PS C:\Users\BenjaminBrienen\source\bevy> cargo build -p bevy_ui --no-default-features
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.41s
PS C:\Users\BenjaminBrienen\source\bevy> cargo build -p bevy_ui --no-default-features --features bevy_text
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.39s
PS C:\Users\BenjaminBrienen\source\bevy> cargo build -p bevy_ui --no-default-features --features bevy_render
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.37s
PS C:\Users\BenjaminBrienen\source\bevy> cargo build -p bevy_ui --no-default-features --features bevy_render --features bevy_text
Compiling bevy_ui v0.15.0-dev (C:\Users\BenjaminBrienen\source\bevy\crates\bevy_ui)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.15s
PS C:\Users\BenjaminBrienen\source\bevy> cargo build -p bevy_ui
Compiling bevy_ui v0.15.0-dev (C:\Users\BenjaminBrienen\source\bevy\crates\bevy_ui)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 12.60s |
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.
I agree in principle but the diff here is extremely messy and needs to be reduced to a minimal set of changes.
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.
I like this change, but I think it needs some polishing. There's some formatting changes that I don't understand the reason for, and I believe reflection was removed from ImageNode
inadvertently.
I haven't looked at the changes yet, but I've wanted to have the UI layout and rendering separated for years. |
crates/bevy_ui/src/layout/mod.rs
Outdated
@@ -292,10 +293,11 @@ with UI components as a child of an entity without UI components, your UI layout | |||
} | |||
}); | |||
|
|||
for (camera_id, mut camera) in camera_layout_info.drain() { | |||
for (_camera_id, mut camera) in camera_layout_info.drain() { |
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.
for (_camera_id, mut camera) in camera_layout_info.drain() { | |
for (camera_id, mut camera) in camera_layout_info.drain() { |
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.
There still seems to be something weird with the "bevy_text" feature as well.
Feature gating all the text spawning commands in the testbed_ui
example by "bevy_text" and compiling without "bevy_text" enabled:
cargo run --example testbed_ui --no-default-features --features "android-game-activity android-game-activity android_shared_stdcxx animation bevy_asset bevy_audio bevy_color bevy_core_pipeline bevy_gilrs bevy_gizmos bevy_gltf bevy_mesh_picking_backend bevy_pbr bevy_picking bevy_remote bevy_render bevy_scene bevy_sprite bevy_sprite_picking_backend bevy_state bevy_ui bevy_ui_picking_backend bevy_window bevy_winit custom_cursor default_font hdr multi_threaded png smaa_luts sysinfo_plugin tonemapping_luts vorbis webgl2 x11"
results in errors like:
error[E0433]: failed to resolve: use of undeclared type `Text`
--> examples/testbed/ui.rs:74:33
|
74 | ... Text::new("Text Example"),
| ^^^^ use of undeclared type `Text`
I'll look into it, thanks. |
87ccfca
to
b94830d
Compare
I get a runtime error if I run this command |
|
30b7a9d
to
cc8084c
Compare
Cutting from the milestone: valuable, but not essential. At this point I expect this to be easier to redo from scratch: merge conflicts on this sort of work really really suck. |
Objective
Fixes #16313 and #16316 and #3815
Solution
Add a lot of feature gates. It looks awful. All configurations build with no warnings, though!
Testing