Node fields as components
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## What problem does this solve or what need does it fill?
In Bevy 0.15, `Node`'s properties like `background_color` were converted into components, making them easy to override after node creation. However, properties like `grid_auto_rows` are not components, making it harder to override them after spawning. This inconsistency increases boilerplate when passing all style properties to helper functions, especially if only a few need to be modified.
## What solution would you like?
Make all style properties (like `grid_auto_rows`, `grid_row`, `grid_column`) components, as `background_color` is now. This would allow properties to be overridden after node creation.
## What alternative(s) have you considered?
An alternative is to pass all style properties explicitly, even if they aren’t overridden, which leads to unnecessary verbosity. Another approach is modifying node styles directly after creation, but this adds extra steps.
## Additional information
A similar thing happens with components that store more than one field like `TextFont`. If you wish to override only the font size, you have to override the entire component, providing the font file again.
Contributor guide
Research direction
No files or tests are named. Start by locating Node's style-property definitions and the existing background_color component handling, then compare them with grid_auto_rows, grid_row, and grid_column. Done means the style properties are consistently usable as components and can be overridden after spawning without passing unrelated values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100