Skip to content
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
11 changes: 0 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4033,17 +4033,6 @@ description = "Demonstrates nested transformed UI clipping"
category = "UI (User Interface)"
wasm = true

[[example]]
name = "relative_cursor_position"
path = "examples/ui/relative_cursor_position.rs"
doc-scrape-examples = true

[package.metadata.example.relative_cursor_position]
name = "Relative Cursor Position"
description = "Showcases the RelativeCursorPosition component"
category = "UI (User Interface)"
wasm = true

[[example]]
name = "render_ui_to_texture"
path = "examples/ui/render_ui_to_texture.rs"
Expand Down
8 changes: 0 additions & 8 deletions crates/bevy_asset/src/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,14 +680,6 @@ macro_rules! uuid_handle {
}};
}

#[deprecated = "Use uuid_handle! instead"]
#[macro_export]
macro_rules! weak_handle {
($uuid:expr) => {
$crate::uuid_handle!($uuid)
};
}

/// Errors preventing the conversion of to/from an [`UntypedHandle`] and a [`Handle`].
#[derive(Error, Debug, PartialEq, Clone)]
#[non_exhaustive]
Expand Down
21 changes: 0 additions & 21 deletions crates/bevy_asset/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,6 @@ impl<A: Asset> AssetId<A> {
/// and by convention (where appropriate) assets should support this pattern.
pub const DEFAULT_UUID: Uuid = Uuid::from_u128(200809721996911295814598172825939264631);

/// This asset id _should_ never be valid. Assigning a value to this in [`Assets`](crate::Assets) will
/// produce undefined behavior, so don't do it!
#[deprecated(
since = "0.20.0",
note = "Use `Option<AssetId>` if possible. `AssetId::default` may also work, but note that the default can map to a valid asset."
)]
pub const INVALID_UUID: Uuid = Uuid::from_u128(108428345662029828789348721013522787528);

/// Returns an [`AssetId`] with [`Self::INVALID_UUID`], which _should_ never be assigned to.
#[deprecated(
since = "0.20.0",
note = "Use `Option<AssetId>` if possible. `AssetId::default` may also work, but note that the default can map to a valid asset."
)]
#[inline]
pub const fn invalid() -> Self {
Self::Uuid {
#[expect(deprecated, reason = "deprecated function uses deprecated constant")]
uuid: Self::INVALID_UUID,
}
}

/// Converts this to an "untyped" / "generic-less" [`Asset`] identifier that stores the type information
/// _inside_ the [`UntypedAssetId`].
#[inline]
Expand Down
23 changes: 0 additions & 23 deletions crates/bevy_ecs/src/query/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,19 +463,6 @@ impl Access {
&self.archetypal
}

/// Returns the set of components with read access,
/// or an error if the access is unbounded.
///
/// This includes components with write access, since write access also allows you to read the
/// component.
#[deprecated(since = "0.20.0", note = "use `reads_and_writes().as_finite_set()")]
pub fn try_reads_and_writes(&self) -> Result<&ComponentIdSet, UnboundedAccessError> {
self.reads.as_finite_set().ok_or(UnboundedAccessError {
writes_inverted: self.writes.is_unbounded(),
reads_inverted: self.reads.is_unbounded(),
})
}

/// Returns the set of components with read or write access.
///
/// This includes components with write access, since write access also allows you to read the
Expand All @@ -484,16 +471,6 @@ impl Access {
&self.reads
}

/// Returns the set of components with write access,
/// or an error if the access is unbounded.
#[deprecated(since = "0.20.0", note = "use `writes().as_finite_set()")]
pub fn try_writes(&self) -> Result<&ComponentIdSet, UnboundedAccessError> {
self.writes.as_finite_set().ok_or(UnboundedAccessError {
writes_inverted: self.writes.is_unbounded(),
reads_inverted: self.reads.is_unbounded(),
})
}

/// Returns the set of components with write access.
pub fn writes(&self) -> &InvertibleComponentIdSet {
&self.writes
Expand Down
19 changes: 2 additions & 17 deletions crates/bevy_ecs/src/world/deferred_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ use crate::{
lifecycle::{DiscardEvent, HookContext, InsertEvent, DISCARD, INSERT},
message::{Message, MessageId, Messages, WriteBatchIds},
observer::TriggerContext,
prelude::{Component, QueryState},
query::{QueryData, QueryFilter},
prelude::Component,
relationship::RelationshipHookMode,
resource::Resource,
system::{Commands, Query},
system::Commands,
world::{error::EntityMutableFetchError, EntityFetcher, WorldEntityFetch},
};

Expand Down Expand Up @@ -444,20 +443,6 @@ impl<'w> DeferredWorld<'w> {
(fetcher, commands)
}

/// Returns [`Query`] for the given [`QueryState`], which is used to efficiently
/// run queries on the [`World`] by storing and reusing the [`QueryState`].
///
/// # Panics
/// If state is from a different world then self
#[inline]
#[deprecated(since = "0.19.0", note = "use `QueryState::query_mut`")]
pub fn query<'s, D: QueryData, F: QueryFilter>(
&mut self,
state: &'s mut QueryState<D, F>,
) -> Query<'_, 's, D, F> {
state.query_mut(self)
}

/// Gets a mutable reference to the resource of the given type
///
/// # Panics
Expand Down
3 changes: 0 additions & 3 deletions crates/bevy_pbr/src/extended_material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,3 @@ impl<B: Material, E: MaterialExtension> Material for ExtendedMaterial<B, E> {
)
}
}

#[deprecated = "Use `bevy_render::combined_bind_group::CombinedBindGroupData` instead"]
pub type MaterialExtensionBindGroupData<B, E> = cbg::CombinedBindGroupData<B, E>;
22 changes: 0 additions & 22 deletions crates/bevy_reflect/src/enums/dynamic_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,6 @@ impl DynamicEnum {
&mut self.variant
}

/// Create a [`DynamicEnum`] from an existing one.
///
/// This is functionally the same as [`DynamicEnum::from_ref`] except it takes an owned value.
#[deprecated(
since = "0.20.0",
note = "Use `DynamicEnum::try_from` instead, which returns a Result."
)]
pub fn from<TEnum: Enum>(value: TEnum) -> Self {
Self::try_from(value).unwrap()
}

/// Create a [`DynamicEnum`] from an existing one.
///
/// This is functionally the same as [`DynamicEnum::try_from_ref`] except it takes an owned value.
Expand All @@ -191,17 +180,6 @@ impl DynamicEnum {
Self::try_from_ref(&value)
}

/// Create a [`DynamicEnum`] from an existing one.
///
/// This is functionally the same as [`DynamicEnum::from`] except it takes a reference.
#[deprecated(
since = "0.20.0",
note = "Use `DynamicEnum::try_from_ref` instead, which returns a Result."
)]
pub fn from_ref<TEnum: Enum + ?Sized>(value: &TEnum) -> Self {
Self::try_from_ref(value).unwrap()
}

/// Create a [`DynamicEnum`] from an existing one.
///
/// This is functionally the same as [`DynamicEnum::try_from`] except it takes a reference.
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_scene/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ use syn::{parse_macro_input, DeriveInput};
/// | `CompA { name }` | Component with Rust's "field assignment shorthand". Evaluates to `CompA { name: name.into() }` |
/// | `MyEnum::Variant` | Enum Component `MyEnum` with the `Variant` variant |
/// | `component` | Insert the component value from a variable `component` |
/// | `template_value(CompA::from_str("foo"))` | Insert the component value by immediately calling the constructor |
/// | `template(\|context\| { ... })` | Register a function/closure returning a Template (eg. Component). Its passed [`context`] allowing World access |
/// | `~MyType`<br>`~MyType {name: var}` | Type implementing [`Template`], the prefix is used to distinguish it from Components which use [`FromTemplate`]|
/// | **Including Scenes** | |
Expand Down
5 changes: 4 additions & 1 deletion crates/bevy_scene/macros/src/scene_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ pub(crate) fn derive_scene_component(ast: &mut DeriveInput) -> TokenStream {
(
#scene_impl,
<#bevy_scene::InitTemplate::<<#struct_name #type_generics as #bevy_ecs::template::FromTemplate>::Template> as #FQDefault>::default(),
#bevy_scene::template_value(#bevy_scene::SceneComponentInfo::new::<#struct_name #type_generics>(true)),
#bevy_scene::InsertTemplate {
type_id: ::core::any::TypeId::of::<#bevy_scene::SceneComponentInfo>(),
template: ::std::boxed::Box::new(#bevy_scene::SceneComponentInfo::new::<#struct_name #type_generics>(true)),
},
)
}
}
Expand Down
7 changes: 3 additions & 4 deletions crates/bevy_scene/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,11 +887,10 @@
///
/// This includes the most common types in this crate, re-exported for your convenience.
pub mod prelude {
#[expect(deprecated, reason = "easier migrations")]
pub use crate::{
bsn, bsn_list, on, template_value, CommandsSceneExt, EntityCommandsSceneExt,
EntityWorldMutSceneExt, PatchFromTemplate, PatchTemplate, Scene, SceneComponent, SceneList,
ScenePatchInstance, SpawnListSystem, SpawnSystem, WorldSceneExt,
bsn, bsn_list, on, CommandsSceneExt, EntityCommandsSceneExt, EntityWorldMutSceneExt,
PatchFromTemplate, PatchTemplate, Scene, SceneComponent, SceneList, ScenePatchInstance,
SpawnListSystem, SpawnSystem, WorldSceneExt,
};
}

Expand Down
15 changes: 0 additions & 15 deletions crates/bevy_scene/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,21 +284,6 @@ where
/// ```
pub struct TemplatePatch<F: FnOnce(&mut T, &mut ResolveContext), T>(pub F, pub PhantomData<T>);

/// Returns a [`Scene`] that completely overwrites the current value of a [`Template`] `T` with the given `value`.
/// The `value` is cloned each time the [`Template`] is built.
#[deprecated(
since = "0.20.0",
note = "You can generally just remove the template_value wrapper function now. If that doesn't work, wrap it in `~{}`"
)]
pub fn template_value<T: Template<Output: Component> + Send + Sync + 'static>(
value: T,
) -> InsertTemplate {
InsertTemplate {
type_id: TypeId::of::<T>(),
template: Box::new(value),
}
}

/// A helper function that returns a [`TemplatePatch`] [`Scene`] for something that implements [`FromTemplate`].
/// It will use [`FromTemplate::Template`] as the "patched template".
pub trait PatchFromTemplate {
Expand Down
49 changes: 2 additions & 47 deletions crates/bevy_ui/src/accessibility.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#[expect(
deprecated,
reason = "Should be removed after 0.20 is released when Button is removed."
)]
use crate::prelude::Button;
use crate::{
experimental::UiChildren,
prelude::Label,
Expand All @@ -18,7 +13,7 @@ use bevy_ecs::{
hierarchy::ChildOf,
lifecycle::HookContext,
prelude::Entity,
query::{Changed, With, Without},
query::{Changed, With},
reflect::ReflectComponent,
schedule::{IntoScheduleConfigs, SystemSet},
system::{Commands, Query},
Expand Down Expand Up @@ -91,47 +86,9 @@ fn sync_bounds_and_transforms(
}
}

#[expect(
deprecated,
reason = "Should be removed after 0.20 is released when Button is removed."
)]
fn button_changed(
mut commands: Commands,
mut query: Query<(Entity, Option<&mut AccessibilityNode>), Changed<Button>>,
ui_children: UiChildren,
mut text_reader: TextUiReader,
) {
for (entity, accessible) in &mut query {
let label = calc_label(&mut text_reader, ui_children.iter_ui_children(entity));
if let Some(mut accessible) = accessible {
accessible.set_role(Role::Button);
if let Some(name) = label {
accessible.set_label(name);
} else {
accessible.clear_label();
}
} else {
let mut node = Node::new(Role::Button);
if let Some(label) = label {
node.set_label(label);
}
commands
.entity(entity)
.try_insert(AccessibilityNode::from(node));
}
}
}

#[expect(
deprecated,
reason = "Should remove the `Without<Button>` after 0.20 is released when Button is removed."
)]
fn image_changed(
mut commands: Commands,
mut query: Query<
(Entity, Option<&mut AccessibilityNode>),
(Changed<ImageNode>, Without<Button>),
>,
mut query: Query<(Entity, Option<&mut AccessibilityNode>), Changed<ImageNode>>,
ui_children: UiChildren,
mut text_reader: TextUiReader,
) {
Expand Down Expand Up @@ -242,11 +199,9 @@ impl Plugin for AccessibilityPlugin {
app.add_systems(
PostUpdate,
(
button_changed,
image_changed,
label_changed,
sync_bounds_and_transforms
.after(button_changed)
.after(image_changed)
.after(label_changed),
)
Expand Down
Loading
Loading