bytestring-net / bevy_lunex

Blazingly fast path based retained layout engine for Bevy entities, built around vanilla Bevy ECS.
https://bytestring-net.github.io/bevy_lunex/
Apache License 2.0
478 stars 18 forks source link

Hot reloading thoughts #11

Open UkoeHB opened 9 months ago

UkoeHB commented 9 months ago

Here are some preliminary thoughts about how to implement hot-reloading.

  1. Add extra inner id to widgets.
    • Widget paths point to widgets with the highest current inner ids (among widgets with the same name).
    • Widgets that don't have the highest current inner id are garbage collected.
    • When rebuilding a UI branch, increment the inner id of the branch root widget and all its descendents.
  2. Track which UI branches use specific styles.
    • If a style changes in-file, rebuild the UI branches that use that style.
  3. Track which function calls generate which UI branches.
    • When the file-tracker identifies that a hot-reload-marked function has changed, rebuild the UI branches that were generated by that function (i.e. call that function again).