diff --git a/Cargo.toml b/Cargo.toml index f2b292fe..ed1e4f3e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,11 +27,11 @@ unsafe_op_in_unsafe_fn = "warn" unused_qualifications = "warn" [workspace.dependencies] -bevy = { git = "https://github.com/bevyengine/bevy.git", rev = "85eceb022da0326b47ac2b0d9202c9c9f01835bb", features = [ +bevy = { git = "https://github.com/bevyengine/bevy.git", rev = "909b02e9de418fcf3b8960e98c3de423505eadd5", features = [ "wayland", ] } -bevy_derive = { git = "https://github.com/bevyengine/bevy.git", rev = "85eceb022da0326b47ac2b0d9202c9c9f01835bb" } -bevy_macro_utils = { git = "https://github.com/bevyengine/bevy.git", rev = "85eceb022da0326b47ac2b0d9202c9c9f01835bb" } +bevy_derive = { git = "https://github.com/bevyengine/bevy.git", rev = "909b02e9de418fcf3b8960e98c3de423505eadd5" } +bevy_macro_utils = { git = "https://github.com/bevyengine/bevy.git", rev = "909b02e9de418fcf3b8960e98c3de423505eadd5" } thiserror = "1" serde = { version = "1", features = ["derive"] } tracing-test = "0.2.5" diff --git a/bevy_widgets/bevy_field_forms/examples/nickname.rs b/bevy_widgets/bevy_field_forms/examples/nickname.rs index 9a6ae54e..4cf05f3b 100644 --- a/bevy_widgets/bevy_field_forms/examples/nickname.rs +++ b/bevy_widgets/bevy_field_forms/examples/nickname.rs @@ -1,6 +1,6 @@ //! This example demonstrates how to use the `ValidatedInputFieldPlugin` to create a validated input field for a character name. -use bevy::{prelude::*, utils::HashSet}; +use bevy::{platform_support::collections::HashSet, prelude::*}; use bevy_field_forms::{ input_field::{InputField, InputFieldPlugin, Validable, ValidationChanged, ValidationState}, validate_highlight::SimpleBorderHighlight, diff --git a/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/hierarchy.rs b/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/hierarchy.rs index 6f59fa63..36cb70b1 100644 --- a/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/hierarchy.rs +++ b/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/hierarchy.rs @@ -1,7 +1,7 @@ use core::marker::PhantomData; use bevy::ecs::{ - component::{ComponentHooks, ComponentId, Immutable, StorageType}, + component::{ComponentHooks, HookContext, Immutable, StorageType}, prelude::*, world::DeferredWorld, }; @@ -51,14 +51,10 @@ impl Component for WithChild { /// A hook that runs whenever [`WithChild`] is added to an entity. /// /// Generates a [`WithChildCommand`]. -fn with_child_hook( - mut world: DeferredWorld<'_>, - entity: Entity, - _component_id: ComponentId, -) { +fn with_child_hook(mut world: DeferredWorld<'_>, context: HookContext) { // Component hooks can't perform structural changes, so we need to rely on commands. world.commands().queue(WithChildCommand { - parent_entity: entity, + parent_entity: context.entity, _phantom: PhantomData::, }); } @@ -160,12 +156,11 @@ impl + Send + Sync + 'static> Component /// Generates a [`WithChildrenCommand`]. fn with_children_hook + Send + Sync + 'static>( mut world: DeferredWorld<'_>, - entity: Entity, - _component_id: ComponentId, + context: HookContext, ) { // Component hooks can't perform structural changes, so we need to rely on commands. world.commands().queue(WithChildrenCommand { - parent_entity: entity, + parent_entity: context.entity, _phantom: PhantomData::<(B, I)>, }); } diff --git a/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/maybe.rs b/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/maybe.rs index 45bfbfbd..1421325b 100644 --- a/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/maybe.rs +++ b/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/maybe.rs @@ -1,7 +1,7 @@ use core::marker::PhantomData; use bevy::ecs::{ - component::{ComponentHooks, ComponentId, Immutable, StorageType}, + component::{ComponentHooks, HookContext, Immutable, StorageType}, prelude::*, world::DeferredWorld, }; @@ -90,10 +90,10 @@ impl Default for Maybe { /// A hook that runs whenever [`Maybe`] is added to an entity. /// /// Generates a [`MaybeCommand`]. -fn maybe_hook(mut world: DeferredWorld<'_>, entity: Entity, _component_id: ComponentId) { +fn maybe_hook(mut world: DeferredWorld<'_>, context: HookContext) { // Component hooks can't perform structural changes, so we need to rely on commands. world.commands().queue(MaybeCommand { - entity, + entity: context.entity, _phantom: PhantomData::, }); } diff --git a/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/template.rs b/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/template.rs index ef3ff2ae..41e65855 100644 --- a/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/template.rs +++ b/bevy_widgets/bevy_i-cant-believe-its-not-bsn/src/template.rs @@ -1,6 +1,7 @@ use std::collections::{HashMap, HashSet}; use std::mem; +use bevy::ecs::component::HookContext; use bevy::ecs::{ component::ComponentId, prelude::*, system::IntoObserverSystem, world::DeferredWorld, }; @@ -258,23 +259,23 @@ impl From for Callback { } } -fn insert_callback(mut world: DeferredWorld, entity_id: Entity, _component: ComponentId) { - let mut callback = world.get_mut::(entity_id).unwrap(); +fn insert_callback(mut world: DeferredWorld, context: HookContext) { + let mut callback = world.get_mut::(context.entity).unwrap(); let Some(mut observer) = mem::take(&mut callback.observer) else { return; }; - if let Some(parent_id) = world.get::(entity_id).map(ChildOf::get) { + if let Some(parent_id) = world.get::(context.entity).map(ChildOf::get) { observer.watch_entity(parent_id); } let mut commands = world.commands(); - let mut entity_commands = commands.entity(entity_id); + let mut entity_commands = commands.entity(context.entity); entity_commands.remove::(); entity_commands.insert(observer); } -fn remove_callback(mut world: DeferredWorld, entity_id: Entity, _component: ComponentId) { +fn remove_callback(mut world: DeferredWorld, context: HookContext) { let mut commands = world.commands(); - commands.entity(entity_id).remove::(); + commands.entity(context.entity).remove::(); } // ----------------------------------------------------------------------------- diff --git a/bevy_widgets/bevy_text_editing/src/editable_text_line.rs b/bevy_widgets/bevy_text_editing/src/editable_text_line.rs index 3080c006..3a590b9e 100644 --- a/bevy_widgets/bevy_text_editing/src/editable_text_line.rs +++ b/bevy_widgets/bevy_text_editing/src/editable_text_line.rs @@ -3,7 +3,7 @@ mod input; mod render; -use bevy::{prelude::*, utils::HashSet}; +use bevy::{platform_support::collections::HashSet, prelude::*}; use bevy_clipboard::ClipboardPlugin; use bevy_focus::{FocusPlugin, Focusable, SetFocus}; diff --git a/crates/bevy_bsn/src/construct_impls.rs b/crates/bevy_bsn/src/construct_impls.rs index 48553663..01fa82a5 100644 --- a/crates/bevy_bsn/src/construct_impls.rs +++ b/crates/bevy_bsn/src/construct_impls.rs @@ -183,17 +183,20 @@ impl Component for ConstructTextFont { type Mutability = Immutable; fn register_component_hooks(hooks: &mut ComponentHooks) { - hooks.on_insert(|mut world, entity, _component_id| { - let constructable = world.get::(entity).unwrap().clone(); - world.commands().entity(entity).insert(TextFont { + hooks.on_insert(|mut world, context| { + let constructable = world + .get::(context.entity) + .unwrap() + .clone(); + world.commands().entity(context.entity).insert(TextFont { font: constructable.font.into(), font_size: constructable.font_size, font_smoothing: constructable.font_smoothing, line_height: constructable.line_height, }); }); - hooks.on_remove(|mut world, entity, _component_id| { - if let Some(mut entity) = world.commands().get_entity(entity) { + hooks.on_remove(|mut world, context| { + if let Some(mut entity) = world.commands().get_entity(context.entity) { entity.remove::(); } }); diff --git a/crates/bevy_editor_cam/src/extensions/dolly_zoom.rs b/crates/bevy_editor_cam/src/extensions/dolly_zoom.rs index 80b74755..2f458bdc 100644 --- a/crates/bevy_editor_cam/src/extensions/dolly_zoom.rs +++ b/crates/bevy_editor_cam/src/extensions/dolly_zoom.rs @@ -8,11 +8,11 @@ use std::time::Duration; use bevy::app::prelude::*; use bevy::ecs::prelude::*; use bevy::math::prelude::*; +use bevy::platform_support::collections::HashMap; use bevy::platform_support::time::Instant; use bevy::reflect::prelude::*; use bevy::render::{camera::ScalingMode, prelude::*}; use bevy::transform::prelude::*; -use bevy::utils::HashMap; use bevy::window::RequestRedraw; use crate::prelude::{motion::CurrentMotion, EditorCam, EnabledMotion}; diff --git a/crates/bevy_editor_cam/src/extensions/look_to.rs b/crates/bevy_editor_cam/src/extensions/look_to.rs index 0de6a3b1..61d9d803 100644 --- a/crates/bevy_editor_cam/src/extensions/look_to.rs +++ b/crates/bevy_editor_cam/src/extensions/look_to.rs @@ -6,10 +6,10 @@ use std::{f32::consts::PI, time::Duration}; use bevy::app::prelude::*; use bevy::ecs::prelude::*; use bevy::math::{prelude::*, DQuat, DVec3}; +use bevy::platform_support::collections::HashMap; use bevy::platform_support::time::Instant; use bevy::reflect::prelude::*; use bevy::transform::prelude::*; -use bevy::utils::HashMap; use bevy::window::RequestRedraw; use crate::prelude::*; diff --git a/crates/bevy_editor_cam/src/input.rs b/crates/bevy_editor_cam/src/input.rs index 66a40716..0ccb2808 100644 --- a/crates/bevy_editor_cam/src/input.rs +++ b/crates/bevy_editor_cam/src/input.rs @@ -5,10 +5,10 @@ use bevy::input::{ prelude::*, }; use bevy::math::{prelude::*, DVec2, DVec3}; +use bevy::platform_support::collections::HashMap; use bevy::reflect::prelude::*; use bevy::render::{camera::CameraProjection, prelude::*}; use bevy::transform::prelude::*; -use bevy::utils::hashbrown::HashMap; use bevy::window::PrimaryWindow; use bevy::{app::prelude::*, picking::pointer::PointerInput}; use bevy::{ecs::prelude::*, picking::pointer::PointerAction}; diff --git a/crates/bevy_pane_layout/src/registry.rs b/crates/bevy_pane_layout/src/registry.rs index 31c6b336..dca70dc0 100644 --- a/crates/bevy_pane_layout/src/registry.rs +++ b/crates/bevy_pane_layout/src/registry.rs @@ -2,8 +2,8 @@ use bevy::{ ecs::system::{BoxedSystem, SystemId}, + platform_support::collections::HashMap, prelude::*, - utils::HashMap, }; use crate::{PaneLayoutSet, PaneRootNode}; diff --git a/crates/bevy_undo/src/lib.rs b/crates/bevy_undo/src/lib.rs index f2ef29de..3f2a6d70 100644 --- a/crates/bevy_undo/src/lib.rs +++ b/crates/bevy_undo/src/lib.rs @@ -27,7 +27,7 @@ //! use bevy::prelude::*; //! use bevy_undo::*; //! use std::sync::Arc; -//! use bevy::utils::hashbrown::HashMap; +//! use bevy::platform_support::collections::HashMap; //! //! fn main() { //! App::new() @@ -134,7 +134,7 @@ #![allow(clippy::type_complexity)] use std::sync::Arc; -use bevy::{prelude::*, utils::hashbrown::HashMap}; +use bevy::{platform_support::collections::HashMap, prelude::*}; const MAX_REFLECT_RECURSION: i32 = 10; const AUTO_UNDO_LATENCY: i32 = 2; @@ -1094,7 +1094,7 @@ pub struct AutoUndoStorage { impl Default for AutoUndoStorage { fn default() -> Self { Self { - storage: HashMap::new(), + storage: HashMap::default(), } } }