bevyengine / bevyengine/bevy

Event Reflection

Open
#18,511 3 comments 0 reactions 0 assignees View on GitHub
A-ECS A-Reflection C-Usability D-Modest S-Waiting-on-SME X-Contentious
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?

Support/Enforce reflection for events.

Otherwise the only way to dynamically interact with these things, is to manually register every event you'd want your app to interact with through the type registry yourself, but not all of them will implement reflection.

## What solution would you like?

- `App::add_event` should bound `T: Reflect` and register the involved types with the type registry (`Events`, `T`, etc..).
OR
- have `#[derive(Event)]#[event(Reflect)]` (or just a special `ReflectEvent` type data) macro functionality and implement it around bevy (less stringent, but also less likely to be useful).
OR
- Implement a sort of sub-genre of reflection specifically for events (only require ability to construct them, find them by name etc)

Contributor guide

Open the contributing guide

Research direction

Start by reading App::add_event, the Event and Reflect derive functionality, and the type registry references in the issue. Compare the proposed approaches—bounding events by Reflect, adding event derive support, or introducing event-specific reflection—and define which event types and construction or lookup behavior must be supported before implementation.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.