diff --git a/Cargo.toml b/Cargo.toml index 0c160b3aea..f4a12ca6da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -173,11 +173,8 @@ picking = ["bevy_picking", "mesh_picking", "sprite_picking", "ui_picking"] default_app = [ "async_executor", "bevy_asset", - "bevy_input_focus", "bevy_log", "bevy_state", - "bevy_window", - "custom_cursor", "reflect_auto_register", ] @@ -194,6 +191,7 @@ default_platform = [ "webgl2", "x11", "wayland", + "custom_cursor", "sysinfo_plugin", ] @@ -208,6 +206,7 @@ common_api = [ "bevy_shader", "bevy_material", "bevy_text", + "bevy_window", "hdr", "png", ] @@ -252,7 +251,7 @@ common_api = [ ] # COLLECTION: Features used to build UI Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer. -ui_api = ["default_app", "common_api", "bevy_ui"] +ui_api = ["default_app", "common_api", "bevy_input_focus", "bevy_ui"] # COLLECTION: Bevy's built-in UI renderer, built on top of `bevy_render`. ui_bevy_render = [ diff --git a/docs/cargo_features.md b/docs/cargo_features.md index 8dcf77c0ba..f2438b311c 100644 --- a/docs/cargo_features.md +++ b/docs/cargo_features.md @@ -41,14 +41,14 @@ collections to build your own "profile" equivalent, without needing to manually |audio-all-formats|Enables audio features and all supported formats. **Feature set:** `bevy_audio`, `aac`, `flac`, `mp3`, `mp4`, `vorbis`, `wav`.| |scene|Features used to compose Bevy scenes. **Feature set:** `bevy_world_serialization`, `bevy_scene`.| |picking|Enables picking with all backends. **Feature set:** `bevy_picking`, `mesh_picking`, `sprite_picking`, `ui_picking`.| -|default_app|The core pieces that most apps need. This serves as a baseline feature set for other higher level feature collections (such as "2d" and "3d"). It is also useful as a baseline feature set for scenarios like headless apps that require no rendering (ex: command line tools, servers, etc). **Feature set:** `async_executor`, `bevy_asset`, `bevy_input_focus`, `bevy_log`, `bevy_state`, `bevy_window`, `custom_cursor`, `reflect_auto_register`.| -|default_platform|These are platform support features, such as OS support/features, windowing and input backends, etc. **Feature set:** `std`, `bevy_gilrs`, `bevy_winit`, `bevy_clipboard`, `default_font`, `multi_threaded`, `webgl2`, `x11`, `wayland`, `sysinfo_plugin`.| -|common_api|Default scene definition features. Note that this does not include an actual renderer, such as bevy_render (Bevy's default render backend). **Feature set:** `bevy_animation`, `bevy_camera`, `bevy_color`, `bevy_gizmos`, `bevy_image`, `bevy_mesh`, `bevy_shader`, `bevy_material`, `bevy_text`, `hdr`, `png`.| +|default_app|The core pieces that most apps need. This serves as a baseline feature set for other higher level feature collections (such as "2d" and "3d"). It is also useful as a baseline feature set for scenarios like headless apps that require no rendering (ex: command line tools, servers, etc). **Feature set:** `async_executor`, `bevy_asset`, `bevy_log`, `bevy_state`, `reflect_auto_register`.| +|default_platform|These are platform support features, such as OS support/features, windowing and input backends, etc. **Feature set:** `std`, `bevy_gilrs`, `bevy_winit`, `bevy_clipboard`, `default_font`, `multi_threaded`, `webgl2`, `x11`, `wayland`, `custom_cursor`, `sysinfo_plugin`.| +|common_api|Default scene definition features. Note that this does not include an actual renderer, such as bevy_render (Bevy's default render backend). **Feature set:** `bevy_animation`, `bevy_camera`, `bevy_color`, `bevy_gizmos`, `bevy_image`, `bevy_mesh`, `bevy_shader`, `bevy_material`, `bevy_text`, `bevy_window`, `hdr`, `png`.| |2d_api|Features used to build 2D Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer. **Feature set:** `common_api`, `bevy_sprite`.| |2d_bevy_render|Bevy's built-in 2D renderer, built on top of `bevy_render`. **Feature set:** `2d_api`, `bevy_render`, `bevy_core_pipeline`, `bevy_post_process`, `bevy_sprite_render`, `bevy_gizmos_render`.| |3d_api|Features used to build 3D Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer. **Feature set:** `common_api`, `bevy_light`, `bevy_mikktspace`, `ktx2`, `morph_animation`, `morph`, `smaa_luts`, `tonemapping_luts`, `zstd_rust`.| |3d_bevy_render|Bevy's built-in 3D renderer, built on top of `bevy_render`. **Feature set:** `3d_api`, `bevy_render`, `bevy_core_pipeline`, `bevy_gizmos_render`, `bevy_anti_alias`, `bevy_gltf`, `bevy_pbr`, `bevy_post_process`, `gltf_animation`.| -|ui_api|Features used to build UI Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer. **Feature set:** `default_app`, `common_api`, `bevy_ui`.| +|ui_api|Features used to build UI Bevy apps (does not include a render backend). You generally don't need to worry about this unless you are using a custom renderer. **Feature set:** `default_app`, `common_api`, `bevy_input_focus`, `bevy_ui`.| |ui_bevy_render|Bevy's built-in UI renderer, built on top of `bevy_render`. **Feature set:** `ui_api`, `bevy_render`, `bevy_core_pipeline`, `bevy_ui_render`.| |default_no_std|Recommended defaults for no_std applications. **Feature set:** `libm`, `critical-section`, `bevy_color`, `bevy_state`.| diff --git a/release-content/migration-guides/cargo_default_app_collection.md b/release-content/migration-guides/cargo_default_app_collection.md new file mode 100644 index 0000000000..b91d4d2cb7 --- /dev/null +++ b/release-content/migration-guides/cargo_default_app_collection.md @@ -0,0 +1,39 @@ +--- +title: "`bevy_window`, `bevy_input_focus`, `custom_cursor` features moved to alternate feature collections" +pull_requests: [22488] +--- + +In Bevy 0.18, [feature collections were introduced](https://bevy.org/learn/migration-guides/0-17-to-0-18/#cargo-feature-collections). The `bevy_window`, `bevy_input_focus`, & `custom_cursor` features were included in the `default_app` collection. + +In Bevy 0.19, these have been moved from `default_app`: + +|Feature |is included in... | +|:----------------:|:-----------------| +|`bevy_window` |`common_api` | +|`bevy_input_focus`|`ui_api` | +|`custom_cursor` |`default_platform`| + +This change was made because: + +- the `default_app` collection is for core functionality that most apps will need. Scene definition for windowing is not usually required, and +- apps that don't use windowing (ex: command line tools, servers, etc) can compile fewer dependencies. + +If you were relying on these being included in `default_app`, you can cherry-pick them into your `Cargo.toml` feature list: + +```toml +# 0.18 +bevy = { version = "0.18", default-features = false, features = [ "default_app" ] } + +# 0.19 +bevy = { version = "0.19", default-features = false, features = [ + "default_app", + "bevy_window", + "bevy_input_focus", + "custom_cursor" +] } +``` + +If you already depend on a high-level profile (`2d`, `3d`, `ui`), or a mid-level collection ending in '`_render`' or '`_api`', then you do not need to make any changes. + +--- +I've erred on the side of hopefully-longer-than-it-needs-to-be.