update docs

This commit is contained in:
eugineerd 2025-07-16 13:02:16 +00:00
parent ca6827e7b9
commit 5dd2e99c7c
2 changed files with 11 additions and 13 deletions

View File

@ -853,7 +853,8 @@ pub fn impl_type_path(input: TokenStream) -> TokenStream {
} }
/// Collects and loads type registrations when using `auto_register_static` feature. /// Collects and loads type registrations when using `auto_register_static` feature.
/// The steps to using it correctly require the following: ///
/// Correctly using this macro requires following:
/// 1. This macro must be called **last** during compilation. This can be achieved by putting your main function /// 1. This macro must be called **last** during compilation. This can be achieved by putting your main function
/// in a separate crate or restructuring your project to be separated into `bin` and `lib`, and putting this macro in `bin`. /// in a separate crate or restructuring your project to be separated into `bin` and `lib`, and putting this macro in `bin`.
/// Any automatic type registrations using `#[derive(Reflect)]` within the same crate as this macro are not guaranteed to run. /// Any automatic type registrations using `#[derive(Reflect)]` within the same crate as this macro are not guaranteed to run.

View File

@ -463,14 +463,6 @@
//! typically require manual monomorphization (i.e. manually specifying the types the generic method can //! typically require manual monomorphization (i.e. manually specifying the types the generic method can
//! take). //! take).
//! //!
//! ## Manual Registration
//!
//! Since Rust doesn't provide built-in support for running initialization code before `main`,
//! there is no way for `bevy_reflect` to automatically register types into the [type registry] by default
//! (see `auto_register` feature if this functionality is required).
//! This means types must manually be registered, including their desired monomorphized
//! representations if generic.
//!
//! # Features //! # Features
//! //!
//! ## `bevy` //! ## `bevy`
@ -520,14 +512,19 @@
//! which enables capturing the type stack when serializing or deserializing a type //! which enables capturing the type stack when serializing or deserializing a type
//! and displaying it in error messages. //! and displaying it in error messages.
//! //!
//! ## `auto_register` //! ## `auto_register_inventory`/`auto_register_static`
//! //!
//! | Default | Dependencies | //! | Default | Dependencies |
//! | :-----: | :-------------------------------: | //! | :-----: | :-------------------------------: |
//! | ❌ | [`bevy_reflect_derive/auto_register`] | //! | ✅ | [`bevy_reflect_derive/auto_register_inventory`] |
//! | ❌ | [`bevy_reflect_derive/auto_register_static`] |
//! //!
//! This feature enables automatic registration of types that derive [`Reflect`] //! These features enable automatic registration of types that derive [`Reflect`].
//! for supported platforms (Linux, macOS, iOS, FreeBSD, Android, Windows, WebAssembly) using the `inventory` crate. //!
//! - `auto_register_inventory` uses `inventory` to collect types on supported platforms (Linux, macOS, iOS, FreeBSD, Android, Windows, WebAssembly).
//! - `auto_register_static` uses platform-independent way to collect types, but requires additional setup and might
//! slow down compilation, so it should only be used on platforms not supported by `inventory`.
//! See documentation for [`load_type_registrations`] macro for more info
//! //!
//! When this feature is enabled `bevy_reflect` will automatically collects all types that derive [`Reflect`] on app startup, //! When this feature is enabled `bevy_reflect` will automatically collects all types that derive [`Reflect`] on app startup,
//! and [`TypeRegistry::register_derived_types`] can be used to register these types at any point in the program. //! and [`TypeRegistry::register_derived_types`] can be used to register these types at any point in the program.