Skip to content

Commit d38a1ec

Browse files
Mark bevy_ui_widgets as experimental for now (#20972)
# Objective - These are still going to undergo *extensive* change: users should be aware of what they're getting into. - Fixes #20957. ## Solution - [x] rename the feature - [x] remove from our default features - [x] add warning to crate docs - [x] add warning to release notes - [x] add warnings to examples ## Testing I've run both the `standard_widgets` and `standard_widgets_observers` examples succesfully.
1 parent 859a3cb commit d38a1ec

File tree

6 files changed

+40
-8
lines changed

6 files changed

+40
-8
lines changed

Cargo.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ default = [
136136
"bevy_color",
137137
"bevy_core_pipeline",
138138
"bevy_post_process",
139-
"bevy_ui_widgets",
140139
"bevy_anti_alias",
141140
"bevy_gilrs",
142141
"bevy_gizmos",
@@ -295,11 +294,14 @@ bevy_log = ["bevy_internal/bevy_log"]
295294
# Enable input focus subsystem
296295
bevy_input_focus = ["bevy_internal/bevy_input_focus"]
297296

298-
# Headless widget collection for Bevy UI.
299-
bevy_ui_widgets = ["bevy_internal/bevy_ui_widgets"]
297+
# Experimental headless widget collection for Bevy UI.
298+
experimental_bevy_ui_widgets = ["bevy_internal/bevy_ui_widgets"]
300299

301300
# Feathers widget collection.
302-
experimental_bevy_feathers = ["bevy_internal/bevy_feathers"]
301+
experimental_bevy_feathers = [
302+
"bevy_internal/bevy_feathers",
303+
"experimental_bevy_ui_widgets",
304+
]
303305

304306
# Enable passthrough loading for SPIR-V shaders (Only supported on Vulkan, shader capabilities and extensions must agree with the platform implementation)
305307
spirv_shader_passthrough = ["bevy_internal/spirv_shader_passthrough"]
@@ -4526,6 +4528,7 @@ hidden = true
45264528
name = "testbed_full_ui"
45274529
path = "examples/testbed/full_ui.rs"
45284530
doc-scrape-examples = true
4531+
required-features = ["experimental_bevy_ui_widgets"]
45294532

45304533
[package.metadata.example.testbed_full_ui]
45314534
hidden = true
@@ -4661,6 +4664,7 @@ wasm = false
46614664
name = "standard_widgets"
46624665
path = "examples/ui/standard_widgets.rs"
46634666
doc-scrape-examples = true
4667+
required-features = ["experimental_bevy_ui_widgets"]
46644668

46654669
[package.metadata.example.standard_widgets]
46664670
name = "Standard Widgets"
@@ -4672,6 +4676,7 @@ wasm = true
46724676
name = "standard_widgets_observers"
46734677
path = "examples/ui/standard_widgets_observers.rs"
46744678
doc-scrape-examples = true
4679+
required-features = ["experimental_bevy_ui_widgets"]
46754680

46764681
[package.metadata.example.standard_widgets_observers]
46774682
name = "Standard Widgets (w/Observers)"
@@ -4683,6 +4688,7 @@ wasm = true
46834688
name = "scrollbars"
46844689
path = "examples/ui/scrollbars.rs"
46854690
doc-scrape-examples = true
4691+
required-features = ["experimental_bevy_ui_widgets"]
46864692

46874693
[package.metadata.example.scrollbars]
46884694
name = "Scrollbars"

crates/bevy_ui_widgets/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
//! These widgets have no inherent styling, it's the responsibility of the user to add styling
33
//! appropriate for their game or application.
44
//!
5-
//! # State Management
5+
//! ## Warning: Experimental
6+
//!
7+
//! This crate is currently experimental and under active development.
8+
//! The API is likely to change substantially: be prepared to migrate your code.
9+
//!
10+
//! We are actively seeking feedback on the design and implementation of this crate, so please
11+
//! file issues or create PRs if you have any comments or suggestions.
12+
//!
13+
//! ## State Management
614
//!
715
//! Most of the widgets use external state management: this means that the widgets do not
816
//! automatically update their own internal state, but instead rely on the app to update the widget

docs/cargo_features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ The default feature set enables most of the expected features of a game engine,
4545
|bevy_ui|A custom ECS-driven UI framework|
4646
|bevy_ui_picking_backend|Provides an implementation for picking UI|
4747
|bevy_ui_render|Provides rendering functionality for bevy_ui|
48-
|bevy_ui_widgets|Headless widget collection for Bevy UI.|
4948
|bevy_window|Windowing layer|
5049
|bevy_winit|winit window and input backend|
5150
|custom_cursor|Enable winit custom cursor support|
@@ -93,6 +92,7 @@ The default feature set enables most of the expected features of a game engine,
9392
|dynamic_linking|Force dynamic linking, which improves iterative compile times|
9493
|embedded_watcher|Enables watching in memory asset providers for Bevy Asset hot-reloading|
9594
|experimental_bevy_feathers|Feathers widget collection.|
95+
|experimental_bevy_ui_widgets|Experimental headless widget collection for Bevy UI.|
9696
|experimental_pbr_pcss|Enable support for PCSS, at the risk of blowing past the global, per-shader sampler limit on older/lower-end GPUs|
9797
|exr|EXR image format support|
9898
|ff|Farbfeld image format support|

examples/ui/standard_widgets.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
//! This example illustrates how to create widgets using the `bevy_ui_widgets` widget set.
1+
//! This experimental example illustrates how to create widgets using the `bevy_ui_widgets` widget set.
2+
//!
3+
//! These widgets have no inherent styling, so this example also shows how to implement custom styles.
4+
//!
5+
//! The patterns shown here are likely to change substantially as the `bevy_ui_widgets` crate
6+
//! matures, so please exercise caution if you are using this as a reference for your own code.
27
38
use bevy::{
49
color::palettes::basic::*,

examples/ui/standard_widgets_observers.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
//! This example illustrates how to create widgets using the `bevy_ui_widgets` widget set.
1+
//! This experimental example illustrates how to create widgets using the `bevy_ui_widgets` widget set.
2+
//!
3+
//! The patterns shown here are likely to change substantially as the `bevy_ui_widgets` crate
4+
//! matures, so please exercise caution if you are using this as a reference for your own code.
25
36
use bevy::{
47
color::palettes::basic::*,

release-content/release-notes/headless-widgets.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ which can be added to any UI Node to get widget-like behavior. The standard widg
2727
sliders, scrollbars, checkboxes, radio buttons, and more. This set will likely be expanded in
2828
future releases.
2929

30+
While these widgets are usable today, and are a solid choice for creating your own widgets for your
31+
own game or application, they are still **experimental**.
32+
Expect breaking changes as we continue to iterate and improve on them!
33+
34+
We're as excited as you are for first-party widgets,
35+
and we've decided to ship these now precisely so people can try them out:
36+
real-world user feedback is vital for building and improving products.
37+
38+
If you've read this and are still excited to try them out, enable the `experimental_bevy_ui_widgets` feature.
39+
3040
## Standard Widgets
3141

3242
The `bevy_ui_widgets` crate provides implementations of unstyled widgets, such as buttons,

0 commit comments

Comments
 (0)