Hot reload: replacing a Script migrates instances and swaps behaviour (#86) #98
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/cinnabar!98
Loading…
Reference in a new issue
No description provided.
Delete branch "hot-reload-86"
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?
Closes #86.
Component.defineno longer registers with Core while the chunk runs. Each define is queued and the batch commits only once the chunk completes, so a Script that fails while defining its second class leaves every Schema it defined last time in force. The methods table swaps on commit, so the nextUpdateruns the new body while migrated instances keep their Handles and never re-runAwakeorStart.A field the old Schema did not carry is written with the default from the new define across every instance in every Scene, instead of the zero Core's migration leaves. A field spelled like the started bit is refused at define time, which closes the last Core-side refusal a define could reach; only an out-of-memory failure can now fail a commit partway.
Tests in
tests/luau/reload_test.odincover every acceptance criterion.