bevyengine / bevyengine/bevy-website
0.11 Migration: Missing requirement for `Default` on `#[reflect(ignore)]` field.
- Dominant language
- JavaScript
- Stars
- 249
- Forks
- 450
- Avg merge
- 16h 20m
- Merged PRs (30d)
- 6
Description
The migration doesn't mention a fairly complex change.
So I had this struct:
```rust
#[derive(Component, Reflect)]
pub struct Hook {
pub file_path: String,
pub state: State,
#[reflect(ignore)]
pub hook: Box,
}
```
Now bevy requires a `Default` impl for `hook`, but it's not possible to provide such a thing. I guess I could replace it by a `Option>` but then I've something nullable where it should never be. Furthermore, there is no possible sensible defaults for this.
Contributor guide
Research direction
Start by reviewing the Bevy 0.11 migration documentation and the behavior of #[reflect(ignore)] fields. Document that such fields now require a Default implementation, including the limitation shown by the non-defaultable closure field, and make clear what users need to account for during migration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100