bevy_lunex
bevy_lunex copied to clipboard
Hot reloading thoughts
Here are some preliminary thoughts about how to implement hot-reloading.
- 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.
- Track which UI branches use specific styles.
- If a style changes in-file, rebuild the UI branches that use that style.
- 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).