viridia / bevy_reactor

Fine-grained reactivity framework for Bevy.
100 stars 4 forks source link

Bevy reactor workspace refactor #15

Closed darmie closed 5 months ago

darmie commented 5 months ago

This addresses the issue raised in https://github.com/viridia/bevy_reactor/issues/13.

A bevy_reactor_plugin crate can host all the system functions. This means ViewHandle can be owned in bevy_reactor_view crate and still be usable in the run_reaction system function owned by the bevy_reactor_plugin crate.

All the new crates created so far:

  1. bevy_reactor_core
  2. bevy_reactor_view
  3. bevy_reactor_style
  4. bevy_reactor_plugin

The example project builds fine and works as expected.

viridia commented 5 months ago

This doesn't really solve the problem of being able to separate the core signal stuff. Signals are useless without reactions, which means that run_reactions must be installed if you want to use signals. And because run_reactions depends on View, it means that you can't install the plugin without also installing the view crate. So while the code might live in different crates, the crates aren't independent.

The real goal is to allow people who have no interest in UI to still use signals for things like game logic. This means being able to install the signal core without requiring them to install any other crates.

darmie commented 5 months ago

Got you!

darmie commented 5 months ago

Closing this PR pending when I have a real solution.