bevy/crates/bevy_reflect/src
Gino Valente 99c9218b56
bevy_reflect: Feature-gate function reflection (#14174)
# 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
2024-07-14 15:55:31 +00:00
..
enums bevy_reflect: Feature-gate function reflection (#14174) 2024-07-14 15:55:31 +00:00
func Fix intra-doc links and make CI test them (#14076) 2024-07-11 13:08:31 +00:00
impls bevy_reflect: Feature-gate function reflection (#14174) 2024-07-14 15:55:31 +00:00
path Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
serde Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
array.rs bevy_reflect: Feature-gate function reflection (#14174) 2024-07-14 15:55:31 +00:00
attributes.rs Fix intra-doc links and make CI test them (#14076) 2024-07-11 13:08:31 +00:00
fields.rs bevy_reflect: Custom attributes (#11659) 2024-05-20 19:30:21 +00:00
from_reflect.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
lib.rs bevy_reflect: Feature-gate function reflection (#14174) 2024-07-14 15:55:31 +00:00
list.rs bevy_reflect: Feature-gate function reflection (#14174) 2024-07-14 15:55:31 +00:00
map.rs bevy_reflect: Feature-gate function reflection (#14174) 2024-07-14 15:55:31 +00:00
reflect.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
std_traits.rs
struct_trait.rs bevy_reflect: Feature-gate function reflection (#14174) 2024-07-14 15:55:31 +00:00
tuple_struct.rs bevy_reflect: Feature-gate function reflection (#14174) 2024-07-14 15:55:31 +00:00
tuple.rs bevy_reflect: Feature-gate function reflection (#14174) 2024-07-14 15:55:31 +00:00
type_info.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
type_path.rs Add on_unimplemented Diagnostics to Most Public Traits (#13347) (#13662) 2024-06-04 00:31:34 +00:00
type_registry.rs Apply Clippy lints regarding lazy evaluation and closures (#14015) 2024-07-01 15:54:40 +00:00
utility.rs Finish the work on try_apply (#12646) 2024-05-08 14:26:01 +00:00