mirror of
https://github.com/bevyengine/bevy
synced 2024-12-20 18:13:10 +00:00
99c9218b56
# Objective Function reflection requires a lot of macro code generation in the form of several `all_tuples!` invocations, as well as impls generated in the `Reflect` derive macro. Seeing as function reflection is currently a bit more niche, it makes sense to gate it all behind a feature. ## Solution Add a `functions` feature to `bevy_reflect`, which can be enabled in Bevy using the `reflect_functions` feature. ## Testing You can test locally by running: ``` cargo test --package bevy_reflect ``` That should ensure that everything still works with the feature disabled. To test with the feature on, you can run: ``` cargo test --package bevy_reflect --features functions ``` --- ## Changelog - Moved function reflection behind a Cargo feature (`bevy/reflect_functions` and `bevy_reflect/functions`) - Add `IntoFunction` export in `bevy_reflect::prelude` ## Internal Migration Guide > [!important] > Function reflection was introduced as part of the 0.15 dev cycle. This migration guide was written for developers relying on `main` during this cycle, and is not a breaking change coming from 0.14. Function reflection is now gated behind a feature. To use function reflection, enable the feature: - If using `bevy_reflect` directly, enable the `functions` feature - If using `bevy`, enable the `reflect_functions` feature
34 lines
849 B
TOML
34 lines
849 B
TOML
[package]
|
|
name = "bevy_reflect_derive"
|
|
version = "0.15.0-dev"
|
|
edition = "2021"
|
|
description = "Derive implementations for bevy_reflect"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[lib]
|
|
proc-macro = true
|
|
|
|
[features]
|
|
default = []
|
|
# When enabled, allows documentation comments to be processed by the reflection macros
|
|
documentation = []
|
|
# Enables macro logic related to function reflection
|
|
functions = []
|
|
|
|
[dependencies]
|
|
bevy_macro_utils = { path = "../../bevy_macro_utils", version = "0.15.0-dev" }
|
|
|
|
syn = { version = "2.0", features = ["full"] }
|
|
proc-macro2 = "1.0"
|
|
quote = "1.0"
|
|
uuid = { version = "1.1", features = ["v4"] }
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[package.metadata.docs.rs]
|
|
rustdoc-args = ["-Zunstable-options", "--cfg", "docsrs"]
|
|
all-features = true
|