Hot reload: replacing a Script migrates instances and swaps behaviour (#75) #86
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/cinnabar#86
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#75
What to build
Hot reload is one call. Loading a Script under a name that is already loaded replaces it. On success the Script's classes replace their predecessors: Schemas are re-registered under the same names through Core's replacement path, existing instances migrate by field name, and the class tables' methods are swapped so the next
Updateruns the new code.Awakedoes not re-run on migrated instances. On any failure (compile error, error while defining) the previously loaded version of that Script, and every Schema it defined, stays in force. A Script that stops defining a class it used to define leaves that Schema registered; storage for it is not reclaimed.Acceptance criteria
Updateruns the new method bodyAwakedoes not run again on surviving instances;Startdoes not run again eithercomponent_is_alivestays trueUpdatekeeps running with instance data untouchedBlocked by