From 131a8656cd92f333f1c42345e9a5f16558d548fd Mon Sep 17 00:00:00 2001 From: bstriker Date: Thu, 14 May 2026 20:03:23 -0400 Subject: [PATCH 1/7] chore(deps): update Bevy dependencies to 0.19 --- Cargo.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4d60356a..6592a5a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,14 +46,14 @@ bevy_auto_plugin_shared = { version = "0.10.0", path = "crates/bevy_auto_plugin_ bevy_auto_plugin_proc_macros = { version = "0.10.0", path = "crates/bevy_auto_plugin_proc_macros" } internal_test_util = { path = "crates/internal_test_util" } internal_test_proc_macro = { path = "crates/internal_test_proc_macro" } -bevy = { version = "0.18", default-features = false, features = ["bevy_state"] } -bevy_app = { version = "0.18", default-features = false } -bevy_state = { version = "0.18", default-features = false } -bevy_reflect = { version = "0.18", default-features = false } -bevy_reflect_derive = { version = "0.18", default-features = false } -bevy_internal = { version = "0.18", default-features = false } -bevy_ecs = { version = "0.18", default-features = false } -bevy_ecs_macros = { version = "0.18", default-features = false } +bevy = { version = "0.19", default-features = false, features = ["bevy_state"] } +bevy_app = { version = "0.19", default-features = false } +bevy_state = { version = "0.19", default-features = false } +bevy_reflect = { version = "0.19", default-features = false } +bevy_reflect_derive = { version = "0.19", default-features = false } +bevy_internal = { version = "0.19", default-features = false } +bevy_ecs = { version = "0.19", default-features = false } +bevy_ecs_macros = { version = "0.19", default-features = false } proc-macro2 = "1" syn = { version = "2", features = ["full", "extra-traits", "visit-mut"] } quote = "1" From d0ea87db1dac2f01b717820b586f099cbde876a4 Mon Sep 17 00:00:00 2001 From: bstriker Date: Thu, 14 May 2026 20:08:43 -0400 Subject: [PATCH 2/7] chore(clippy): satisfy linter --- .../src/__private/auto_plugin_registry.rs | 4 ++-- .../src/syntax/extensions/generics.rs | 5 ++--- .../src/syntax/validated/non_empty_path.rs | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/bevy_auto_plugin_shared/src/__private/auto_plugin_registry.rs b/crates/bevy_auto_plugin_shared/src/__private/auto_plugin_registry.rs index 53abc5c6..0f9f2c50 100644 --- a/crates/bevy_auto_plugin_shared/src/__private/auto_plugin_registry.rs +++ b/crates/bevy_auto_plugin_shared/src/__private/auto_plugin_registry.rs @@ -65,7 +65,7 @@ pub static AUTO_PLUGIN_REGISTRY_BEFORE_BUILD: LazyLock = Laz let mut registry = registry .into_iter() .map(|(type_id, mut entries)| { - entries.sort_by(|a, b| a.0.cmp(&b.0)); + entries.sort_by_key(|a| a.0); let mut build_fns = Vec::with_capacity(entries.len()); for (_, build_fn) in entries { build_fns.push(build_fn); @@ -111,7 +111,7 @@ pub static AUTO_PLUGIN_REGISTRY_AFTER_BUILD: LazyLock = Lazy let mut registry = registry .into_iter() .map(|(type_id, mut entries)| { - entries.sort_by(|a, b| a.0.cmp(&b.0)); + entries.sort_by_key(|a| a.0); let mut build_fns = Vec::with_capacity(entries.len()); for (_, build_fn) in entries { build_fns.push(build_fn); diff --git a/crates/bevy_auto_plugin_shared/src/syntax/extensions/generics.rs b/crates/bevy_auto_plugin_shared/src/syntax/extensions/generics.rs index a4d7e8a0..8ff4e42c 100644 --- a/crates/bevy_auto_plugin_shared/src/syntax/extensions/generics.rs +++ b/crates/bevy_auto_plugin_shared/src/syntax/extensions/generics.rs @@ -43,11 +43,10 @@ pub fn inject_send_sync_static(generics: &mut syn::Generics) { }) => { // e.g. ?Sized — ignore } - TypeParamBound::Lifetime(lt) => { - if lt == &Lifetime::new("'static", lt.apostrophe) { + TypeParamBound::Lifetime(lt) + if lt == &Lifetime::new("'static", lt.apostrophe) => { has_static = true; } - } _ => {} } } diff --git a/crates/bevy_auto_plugin_shared/src/syntax/validated/non_empty_path.rs b/crates/bevy_auto_plugin_shared/src/syntax/validated/non_empty_path.rs index c12febed..b9745e9e 100644 --- a/crates/bevy_auto_plugin_shared/src/syntax/validated/non_empty_path.rs +++ b/crates/bevy_auto_plugin_shared/src/syntax/validated/non_empty_path.rs @@ -29,7 +29,7 @@ impl NonEmptyPath { Self(path) } pub fn into_last_ident(self) -> Ident { - self.0.segments.into_iter().last().expect("non-empty path").ident + self.0.segments.into_iter().next_back().expect("non-empty path").ident } pub fn last_ident(&self) -> &Ident { &self.0.segments.last().expect("non-empty path").ident From 5652664dd11752dfa2c1888e880e58869063a26c Mon Sep 17 00:00:00 2001 From: bstriker Date: Thu, 14 May 2026 20:10:27 -0400 Subject: [PATCH 3/7] chore(format): apply rustfmt --- .../src/syntax/extensions/generics.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/bevy_auto_plugin_shared/src/syntax/extensions/generics.rs b/crates/bevy_auto_plugin_shared/src/syntax/extensions/generics.rs index 8ff4e42c..f6b9f772 100644 --- a/crates/bevy_auto_plugin_shared/src/syntax/extensions/generics.rs +++ b/crates/bevy_auto_plugin_shared/src/syntax/extensions/generics.rs @@ -43,10 +43,9 @@ pub fn inject_send_sync_static(generics: &mut syn::Generics) { }) => { // e.g. ?Sized — ignore } - TypeParamBound::Lifetime(lt) - if lt == &Lifetime::new("'static", lt.apostrophe) => { - has_static = true; - } + TypeParamBound::Lifetime(lt) if lt == &Lifetime::new("'static", lt.apostrophe) => { + has_static = true; + } _ => {} } } From 6dbe982999eb65b23a5e668e0bdd5cba301f8951 Mon Sep 17 00:00:00 2001 From: bstriker Date: Mon, 22 Jun 2026 09:24:39 -0400 Subject: [PATCH 4/7] chore(docs): update CHANGELOG and compatibility table in README --- CHANGELOG.md | 4 ++++ README.md | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b75af692..17ff9680 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -168,3 +168,7 @@ - Accept `generics = <...>` as shorthand for `generics(...)` in attributes (feature: `compat_generics_angles`). - This feature will eventually be removed unless a petition is opened. - Add optional `default_plugin` feature to allow omitting `plugin = ...` when a default plugin is set via `#[auto_plugin(default_plugin)]`. + +--- +## v0.11.0 +- Update to bevy 0.19 diff --git a/README.md b/README.md index c65486c6..e6cd9fd9 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,12 @@ The following examples demonstrate how common Bevy patterns can be expressed mor ## Bevy Compatibility | bevy_auto_plugin | Bevy | -| --- | --- | -| 0.9.x - 0.10.x | 0.18 | -| 0.6.x - 0.8.x | 0.17 | -| 0.2.x - 0.5.x | 0.16 | -| 0.1.x | 0.15 | +|------------------|------| +| 0.11.x | 0.19 | +| 0.9.x - 0.10.x | 0.18 | +| 0.6.x - 0.8.x | 0.17 | +| 0.2.x - 0.5.x | 0.16 | +| 0.1.x | 0.15 | ## Examples From b0dea71867b18fa90d71dc79c80def26b72f1f01 Mon Sep 17 00:00:00 2001 From: bstriker Date: Mon, 22 Jun 2026 10:13:28 -0400 Subject: [PATCH 5/7] chore(tests): relocate `test_auto_bind_plugin_inner` to bottom --- .../__private/expand/attr/auto_bind_plugin.rs | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/crates/bevy_auto_plugin_shared/src/__private/expand/attr/auto_bind_plugin.rs b/crates/bevy_auto_plugin_shared/src/__private/expand/attr/auto_bind_plugin.rs index be6d5d01..c9448a02 100644 --- a/crates/bevy_auto_plugin_shared/src/__private/expand/attr/auto_bind_plugin.rs +++ b/crates/bevy_auto_plugin_shared/src/__private/expand/attr/auto_bind_plugin.rs @@ -38,35 +38,6 @@ pub fn auto_bind_plugin_outer(attr: MacroStream, input: MacroStream) -> MacroStr .unwrap_or_else(|err| compile_error_with!(err, og_input)) } -#[cfg(test)] -mod tests { - use super::*; - use internal_test_proc_macro::xtest; - use quote::quote; - #[xtest] - fn test_auto_bind_plugin_inner() { - let attr = quote!(plugin = Test); - let input = quote! { - #[derive(Component, Reflect)] - #[reflect(Component)] - #[auto_register_type] - #[some::path::auto_name] - struct FooComponent; - }; - assert_eq!( - auto_bind_plugin_outer(attr, input).to_string(), - quote! { - # [derive (Component , Reflect)] - # [reflect (Component)] - # [auto_register_type (plugin = Test)] - # [some::path::auto_name (plugin = Test)] - struct FooComponent ; - } - .to_string() - ); - } -} - pub fn attrs_inject_plugin_param( attrs: &mut Vec, plugin: &syn::Path, @@ -193,3 +164,33 @@ fn list_has_key(ml: &syn::MetaList, key: &str) -> bool { Err(_) => false, } } + +#[cfg(test)] +mod tests { + use super::*; + use internal_test_proc_macro::xtest; + use quote::quote; + + #[xtest] + fn test_auto_bind_plugin_inner() { + let attr = quote!(plugin = Test); + let input = quote! { + #[derive(Component, Reflect)] + #[reflect(Component)] + #[auto_register_type] + #[some::path::auto_name] + struct FooComponent; + }; + assert_eq!( + auto_bind_plugin_outer(attr, input).to_string(), + quote! { + # [derive (Component , Reflect)] + # [reflect (Component)] + # [auto_register_type (plugin = Test)] + # [some::path::auto_name (plugin = Test)] + struct FooComponent ; + } + .to_string() + ); + } +} From 77a9442ca1282d6834043d5fc42141881590be0c Mon Sep 17 00:00:00 2001 From: bstriker Date: Mon, 22 Jun 2026 11:51:47 -0400 Subject: [PATCH 6/7] chore(release): remove deprecated APIs for 0.11.0 --- CHANGELOG.md | 3 + MIGRATIONS.md | 10 +- .../__private/expand/derive/auto_plugin.rs | 36 +----- .../actions/auto_insert_resource.rs | 103 +++--------------- .../src/macro_api/attributes/auto_plugin.rs | 16 --- .../actions/auto_insert_resource.md | 2 - .../proc_attributes/rewrites/auto_resource.md | 6 +- src/lib.rs | 7 -- .../e2e/ui/auto_insert_resource_deprecated.rs | 18 --- .../ui/auto_insert_resource_deprecated.stderr | 18 --- 10 files changed, 30 insertions(+), 189 deletions(-) delete mode 100644 tests/e2e/ui/auto_insert_resource_deprecated.rs delete mode 100644 tests/e2e/ui/auto_insert_resource_deprecated.stderr diff --git a/CHANGELOG.md b/CHANGELOG.md index 17ff9680..3f4997d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -172,3 +172,6 @@ --- ## v0.11.0 - Update to bevy 0.19 +- Remove deprecated `auto_add_event` alias; use `auto_add_message`. +- Remove deprecated `#[auto_plugin]` args `generics(...)`, `impl_generic_auto_plugin_trait`, and `impl_generic_plugin_trait`. +- Remove deprecated `init(...)` and `resource(...)` args from `auto_insert_resource`; use `insert(...)`. diff --git a/MIGRATIONS.md b/MIGRATIONS.md index b9807144..bf6ae0a6 100644 --- a/MIGRATIONS.md +++ b/MIGRATIONS.md @@ -65,4 +65,12 @@ - Removed `generics` from `auto_init_state` and `auto_state` - There should be no valid use cases for this but if you have one and were using it please open an issue. ## v0.8 to v0.9 -- Deprecated (compiler error) `resource` in favor of `insert` in `auto_insert_resource` \ No newline at end of file +- Deprecated (compiler error) `resource` in favor of `insert` in `auto_insert_resource` + +## v0.10 to v0.11 +- Bevy support moved from 0.18 to 0.19. +- Removed `auto_add_event`; use `auto_add_message`. +- Removed `#[auto_plugin]` params `generics(...)`, `impl_generic_auto_plugin_trait`, and `impl_generic_plugin_trait`. + - Use `impl_plugin_trait` when you want the derive to implement Bevy's `Plugin`. + - `AutoPlugin` is always implemented when deriving `AutoPlugin`. +- Removed `init(...)` and `resource(...)` from `auto_insert_resource`; use `insert(...)`. diff --git a/crates/bevy_auto_plugin_shared/src/__private/expand/derive/auto_plugin.rs b/crates/bevy_auto_plugin_shared/src/__private/expand/derive/auto_plugin.rs index 5e731636..5f4c8b96 100644 --- a/crates/bevy_auto_plugin_shared/src/__private/expand/derive/auto_plugin.rs +++ b/crates/bevy_auto_plugin_shared/src/__private/expand/derive/auto_plugin.rs @@ -1,6 +1,5 @@ use crate::util::macros::parse_macro_input2; use proc_macro2::TokenStream as MacroStream; -use syn::spanned::Spanned; pub fn expand_derive_auto_plugin(input: MacroStream) -> MacroStream { use crate::{ @@ -21,38 +20,6 @@ pub fn expand_derive_auto_plugin(input: MacroStream) -> MacroStream { params }; - let mut compile_warnings = quote! {}; - - #[allow(deprecated)] - if params.auto_plugin.impl_generic_auto_plugin_trait.is_present() { - compile_warnings.extend( - syn::Error::new( - params.auto_plugin.impl_generic_auto_plugin_trait.span(), - "always implemented - remove `impl_generic_auto_plugin_trait`", - ) - .to_compile_error(), - ) - } - - #[allow(deprecated)] - if params.auto_plugin.impl_generic_plugin_trait.is_present() { - compile_warnings.extend( - syn::Error::new( - params.auto_plugin.impl_generic_plugin_trait.span(), - "use `impl_plugin_trait` instead", - ) - .to_compile_error(), - ) - } - - #[allow(deprecated)] - for generics in ¶ms.auto_plugin.generics { - compile_warnings.extend( - syn::Error::new(generics.span(), "no longer needed - remove `generics(...)`") - .to_compile_error(), - ) - } - let ident = ¶ms.ident; // `Test` let generics = ¶ms.generics; // `` let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); @@ -79,7 +46,7 @@ pub fn expand_derive_auto_plugin(input: MacroStream) -> MacroStream { #[cfg(feature = "default_plugin")] if params.auto_plugin.default_plugin.is_present() { if !params.generics.params.is_empty() { - compile_warnings.extend( + output.extend( syn::Error::new( params.auto_plugin.default_plugin.span(), "`default_plugin` is not supported for generic plugins; use a concrete wrapper type", @@ -96,7 +63,6 @@ pub fn expand_derive_auto_plugin(input: MacroStream) -> MacroStream { } quote! { - #compile_warnings #output } } diff --git a/crates/bevy_auto_plugin_shared/src/macro_api/attributes/actions/auto_insert_resource.rs b/crates/bevy_auto_plugin_shared/src/macro_api/attributes/actions/auto_insert_resource.rs index 57ff220b..e02b9dac 100644 --- a/crates/bevy_auto_plugin_shared/src/macro_api/attributes/actions/auto_insert_resource.rs +++ b/crates/bevy_auto_plugin_shared/src/macro_api/attributes/actions/auto_insert_resource.rs @@ -3,42 +3,28 @@ use crate::{ syntax::ast::any_expr::AnyExprCallClosureMacroPath, }; use darling::FromMeta; -use proc_macro2::{ - Span, - TokenStream, -}; +use proc_macro2::TokenStream; use quote::{ ToTokens, quote, - quote_spanned, }; use std::hash::Hash; -use syn::{ - parse_quote, - spanned::Spanned, -}; +use syn::parse_quote; #[derive(FromMeta, Default, Debug, Clone, PartialEq, Hash)] #[darling(derive_syn_parse, and_then = Self::validate)] pub struct InsertResourceArgs { - // TODO: after removing legacy fields, remove _resolved, make insert required pub insert: Option, - pub resource: Option, - pub init: Option, - #[darling(skip)] - _resolved: Option, } #[derive(Debug, Clone)] pub struct MetaExpr { value: AnyExprCallClosureMacroPath, - span: Span, } impl MetaExpr { pub fn from_value(value: AnyExprCallClosureMacroPath) -> Self { - let span = value.span(); - Self { value, span } + Self { value } } } @@ -54,12 +40,6 @@ impl Hash for MetaExpr { } } -impl MetaExpr { - fn span(&self) -> Span { - self.span - } -} - impl AsRef for MetaExpr { fn as_ref(&self) -> &AnyExprCallClosureMacroPath { &self.value @@ -69,12 +49,7 @@ impl AsRef for MetaExpr { impl FromMeta for MetaExpr { fn from_meta(item: &syn::Meta) -> darling::Result { let value = AnyExprCallClosureMacroPath::from_meta(item).map_err(|e| e.with_span(item))?; - let span = match item { - syn::Meta::Path(path) => path.span(), - syn::Meta::List(list) => list.path.span(), - syn::Meta::NameValue(nv) => nv.path.span(), - }; - Ok(Self { value, span }) + Ok(Self { value }) } fn from_nested_meta(item: &darling::ast::NestedMeta) -> darling::Result { @@ -83,7 +58,7 @@ impl FromMeta for MetaExpr { darling::ast::NestedMeta::Lit(lit) => { let value = AnyExprCallClosureMacroPath::from_value(lit).map_err(|e| e.with_span(lit))?; - Ok(Self { value, span: item.span() }) + Ok(Self { value }) } } } @@ -91,33 +66,19 @@ impl FromMeta for MetaExpr { impl InsertResourceArgs { pub fn from_insert(insert: AnyExprCallClosureMacroPath) -> Self { - Self { insert: Some(MetaExpr::from_value(insert)), ..Default::default() } + Self { insert: Some(MetaExpr::from_value(insert)) } } fn validate(self) -> darling::Result { - Ok(Self { _resolved: Some(Self::resolve_resource(&self)?.clone()), ..self }) + if self.insert.is_none() { + return Err(darling::Error::missing_field("insert")); + } + Ok(self) } fn resolve_resource(&self) -> darling::Result<&AnyExprCallClosureMacroPath> { - if let Some(resolved) = self._resolved.as_ref() { - Ok(resolved) - } else { - match (self.insert.as_ref(), self.resource.as_ref(), self.init.as_ref()) { - (Some(insert), Some(_), _) | (Some(insert), _, Some(_)) => { - Err(darling::Error::custom( - "insert is mutually exclusive with init and resource, use only insert", - ) - .with_span(&insert.span())) - } - (Some(res), None, None) => Ok(res.as_ref()), - (None, Some(_), Some(_)) => Err(darling::Error::custom( - "resource and init are mutually exclusive, use only one", - )), - (None, None, None) => { - Err(darling::Error::custom("missing field: insert (or legacy init/resource)")) - } - (None, Some(res), None) => Ok(res.as_ref()), - (None, None, Some(res)) => Ok(res.as_ref()), - } - } + self.insert + .as_ref() + .map(AsRef::as_ref) + .ok_or_else(|| darling::Error::missing_field("insert")) } } @@ -138,22 +99,6 @@ impl EmitAppMutationTokens for InsertResourceAppMutEmitter { tokens: &mut TokenStream, app_param: &syn::Ident, ) -> syn::Result<()> { - let base = &self.args.args.base; - if base.insert.is_none() { - if let Some(init) = &base.init { - emit_deprecated_insert_resource_warning( - tokens, - init.span(), - "auto_insert_resource(init(...)) is deprecated; use insert(...) instead. Planned for removal in 0.11.0 or bevy 0.19 (whichever comes last).", - ); - } else if let Some(resource) = &base.resource { - emit_deprecated_insert_resource_warning( - tokens, - resource.span(), - "auto_insert_resource(resource(...)) is deprecated; use insert(...) instead. Planned for removal in 0.11.0 or bevy 0.19 (whichever comes last).", - ); - } - } let resource = self.args.args.base.resolve_resource().map_err(syn::Error::from)?; let concrete_paths = self.args.concrete_paths()?; let placeholder_path = if self.args.args.generics().is_empty() { @@ -179,20 +124,6 @@ impl EmitAppMutationTokens for InsertResourceAppMutEmitter { } } -fn emit_deprecated_insert_resource_warning( - tokens: &mut TokenStream, - span: proc_macro2::Span, - message: &'static str, -) { - tokens.extend(quote_spanned! { span=> - { - #[deprecated(note = #message)] - fn __bevy_auto_plugin_deprecated_auto_insert_resource() {} - __bevy_auto_plugin_deprecated_auto_insert_resource(); - } - }); -} - impl ToTokens for InsertResourceAttrEmitter { fn to_tokens(&self, tokens: &mut TokenStream) { let mut args = self.args.args.extra_args(); @@ -200,12 +131,6 @@ impl ToTokens for InsertResourceAttrEmitter { if let Some(insert) = &base.insert { let insert = insert.as_ref(); args.push(quote! { insert = #insert }); - } else if let Some(init) = &base.init { - let init = init.as_ref(); - args.push(quote! { init = #init }); - } else { - let resource = base.resource.as_ref().map(|res| res.as_ref()); - args.push(quote! { resource = #resource }); } tokens.extend(quote! { #(#args),* diff --git a/crates/bevy_auto_plugin_shared/src/macro_api/attributes/auto_plugin.rs b/crates/bevy_auto_plugin_shared/src/macro_api/attributes/auto_plugin.rs index 5c47e217..3fa2ef2d 100644 --- a/crates/bevy_auto_plugin_shared/src/macro_api/attributes/auto_plugin.rs +++ b/crates/bevy_auto_plugin_shared/src/macro_api/attributes/auto_plugin.rs @@ -18,25 +18,9 @@ use syn::{ #[derive(FromMeta, Debug, Default, Clone)] #[darling(derive_syn_parse, default)] pub struct AutoPluginStructOrEnumArgs { - #[deprecated( - since = "0.8.0", - note = "no longer needed - remove `generics(...)`. Planned for removal in 0.11.0 or bevy 0.19 (whichever comes last)." - )] - #[darling(multiple)] - pub generics: Vec, pub impl_plugin_trait: Flag, #[cfg(feature = "default_plugin")] pub default_plugin: Flag, - #[deprecated( - since = "0.8.0", - note = "always implemented - remove `impl_generic_auto_plugin_trait`. Planned for removal in 0.11.0 or bevy 0.19 (whichever comes last)." - )] - pub impl_generic_auto_plugin_trait: Flag, - #[deprecated( - since = "0.8.0", - note = "always implemented - remove `impl_generic_plugin_trait`. Planned for removal in 0.11.0 or bevy 0.19 (whichever comes last)." - )] - pub impl_generic_plugin_trait: Flag, } #[derive(FromMeta, Debug, Default, Clone, PartialEq)] diff --git a/docs/proc_attributes/actions/auto_insert_resource.md b/docs/proc_attributes/actions/auto_insert_resource.md index f6285513..c159a27e 100644 --- a/docs/proc_attributes/actions/auto_insert_resource.md +++ b/docs/proc_attributes/actions/auto_insert_resource.md @@ -4,8 +4,6 @@ Automatically inserts a resource with a specific value into the app. - `plugin = PluginType` - Required unless the `default_plugin` feature is enabled and `#[auto_plugin(default_plugin)]` is in scope. Specifies which plugin should insert this resource. - `after_build` - Optional. Injects this macro's tokens at the end of the plugin build instead of the start. - `insert(Value)` - Required. Specifies the resource value to insert. -- `init(Value)` - Legacy. Same as `insert(Value)`; emits a deprecation warning. -- `resource(Value)` - Legacy. Same as `insert(Value)`; emits a deprecation warning. - `generics(T1, T2, ...)` - Optional. Specifies concrete types for generic parameters. When provided, the resource will be inserted with these specific generic parameters. Note: Clippy will complain if you have duplicate generic type names. For those you can use named generics: `generics(T1 = ..., T2 = ...)`. diff --git a/docs/proc_attributes/rewrites/auto_resource.md b/docs/proc_attributes/rewrites/auto_resource.md index 535c3be8..ee889f5a 100644 --- a/docs/proc_attributes/rewrites/auto_resource.md +++ b/docs/proc_attributes/rewrites/auto_resource.md @@ -19,12 +19,12 @@ Automatically registers a resource to be added to the app. Same as having: ``` - #[auto_insert_resource(init(Value))] + #[auto_insert_resource(insert(Value))] ``` or ``` - #[auto_insert_resource(init(Value1))] - #[auto_insert_resource(init(Value2))] + #[auto_insert_resource(insert(Value1))] + #[auto_insert_resource(insert(Value2))] ``` # Example diff --git a/src/lib.rs b/src/lib.rs index f1abe96a..5f1302ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -191,13 +191,6 @@ pub mod prelude { #[doc = include_str!("../docs/proc_attributes/actions/auto_add_message.md")] pub use bevy_auto_plugin_proc_macros::auto_add_message; - #[doc = include_str!("../docs/proc_attributes/actions/auto_add_plugin.md")] - #[deprecated( - since = "0.6.0", - note = "Use `auto_add_message` instead. Planned for removal in 0.11.0 or bevy 0.19 (whichever comes last)." - )] - pub use bevy_auto_plugin_proc_macros::auto_add_message as auto_add_event; - #[doc = include_str!("../docs/proc_attributes/actions/auto_add_plugin.md")] pub use bevy_auto_plugin_proc_macros::auto_add_plugin; diff --git a/tests/e2e/ui/auto_insert_resource_deprecated.rs b/tests/e2e/ui/auto_insert_resource_deprecated.rs deleted file mode 100644 index f868f54e..00000000 --- a/tests/e2e/ui/auto_insert_resource_deprecated.rs +++ /dev/null @@ -1,18 +0,0 @@ -#![deny(warnings)] - -use bevy_auto_plugin::prelude::*; -use bevy_ecs::prelude::*; - -#[derive(AutoPlugin)] -#[auto_plugin(impl_plugin_trait)] -struct TestPlugin; - -#[auto_insert_resource(plugin = TestPlugin, init(LegacyInit(1)))] -#[derive(Resource, Debug, PartialEq)] -struct LegacyInit(usize); - -#[auto_insert_resource(plugin = TestPlugin, resource(LegacyResource(2)))] -#[derive(Resource, Debug, PartialEq)] -struct LegacyResource(usize); - -fn main() {} diff --git a/tests/e2e/ui/auto_insert_resource_deprecated.stderr b/tests/e2e/ui/auto_insert_resource_deprecated.stderr deleted file mode 100644 index cabdd005..00000000 --- a/tests/e2e/ui/auto_insert_resource_deprecated.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: use of deprecated function `_auto_plugin_auto_insert_resource__952af647c60cf233::{closure#1}::__bevy_auto_plugin_deprecated_auto_insert_resource`: auto_insert_resource(init(...)) is deprecated; use insert(...) instead. Planned for removal in 0.11.0 or bevy 0.19 (whichever comes last). - --> tests/e2e/ui/auto_insert_resource_deprecated.rs:10:45 - | -10 | #[auto_insert_resource(plugin = TestPlugin, init(LegacyInit(1)))] - | ^^^^ - | -note: the lint level is defined here - --> tests/e2e/ui/auto_insert_resource_deprecated.rs:1:9 - | - 1 | #![deny(warnings)] - | ^^^^^^^^ - = note: `#[deny(deprecated)]` implied by `#[deny(warnings)]` - -error: use of deprecated function `_auto_plugin_auto_insert_resource__3509499b01e31dbf::{closure#1}::__bevy_auto_plugin_deprecated_auto_insert_resource`: auto_insert_resource(resource(...)) is deprecated; use insert(...) instead. Planned for removal in 0.11.0 or bevy 0.19 (whichever comes last). - --> tests/e2e/ui/auto_insert_resource_deprecated.rs:14:45 - | -14 | #[auto_insert_resource(plugin = TestPlugin, resource(LegacyResource(2)))] - | ^^^^^^^^ From f8b944e693d9f7558d9b1d6984ddc6ee7ec4c325 Mon Sep 17 00:00:00 2001 From: bstriker Date: Mon, 22 Jun 2026 09:37:07 -0400 Subject: [PATCH 7/7] chore(release): bump version to 0.11.0 --- Cargo.toml | 6 +++--- crates/bevy_auto_plugin_proc_macros/Cargo.toml | 2 +- crates/bevy_auto_plugin_shared/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6592a5a4..a367b149 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_auto_plugin" -version = "0.10.0" +version = "0.11.0" authors = ["Brett Striker "] repository = "https://github.com/StrikeForceZero/bevy_auto_plugin" license = "MIT OR Apache-2.0" @@ -42,8 +42,8 @@ _wasm = [ members = ["crates/*"] [workspace.dependencies] -bevy_auto_plugin_shared = { version = "0.10.0", path = "crates/bevy_auto_plugin_shared" } -bevy_auto_plugin_proc_macros = { version = "0.10.0", path = "crates/bevy_auto_plugin_proc_macros" } +bevy_auto_plugin_shared = { version = "0.11.0", path = "crates/bevy_auto_plugin_shared" } +bevy_auto_plugin_proc_macros = { version = "0.11.0", path = "crates/bevy_auto_plugin_proc_macros" } internal_test_util = { path = "crates/internal_test_util" } internal_test_proc_macro = { path = "crates/internal_test_proc_macro" } bevy = { version = "0.19", default-features = false, features = ["bevy_state"] } diff --git a/crates/bevy_auto_plugin_proc_macros/Cargo.toml b/crates/bevy_auto_plugin_proc_macros/Cargo.toml index f06aa689..4fb27782 100644 --- a/crates/bevy_auto_plugin_proc_macros/Cargo.toml +++ b/crates/bevy_auto_plugin_proc_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_auto_plugin_proc_macros" -version = "0.10.0" +version = "0.11.0" authors = ["Brett Striker "] repository = "https://github.com/StrikeForceZero/bevy_auto_plugin/crates/bevy_auto_plugin_proc_macros" license = "MIT OR Apache-2.0" diff --git a/crates/bevy_auto_plugin_shared/Cargo.toml b/crates/bevy_auto_plugin_shared/Cargo.toml index bae01afd..15f99a81 100644 --- a/crates/bevy_auto_plugin_shared/Cargo.toml +++ b/crates/bevy_auto_plugin_shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_auto_plugin_shared" -version = "0.10.0" +version = "0.11.0" authors = ["Brett Striker "] repository = "https://github.com/StrikeForceZero/bevy_auto_plugin/crates/bevy_auto_plugin_shared" license = "MIT OR Apache-2.0"