bevy_lunex icon indicating copy to clipboard operation
bevy_lunex copied to clipboard

Hot reloading thoughts

Open UkoeHB opened this issue 1 year ago • 0 comments

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.
  1. Track which UI branches use specific styles.
  • If a style changes in-file, rebuild the UI branches that use that style.
  1. 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).

UkoeHB avatar Nov 06 '23 03:11 UkoeHB