XAML hot reloading: Stop crashing Smugleaf's game (and Sloth's) #5406
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This draft exists in two files. The XamlX part is here.)
The hot reloading code has these four underlying problems:
Two people have complained about these problems:
I think we have a few non-mutually exclusive options to address this:
If we do any of options 2, 3 and 4, we can log to WARN instead of INFO, as no failures are expected.
Note that failures will still occur in cases where people type broken code into their editor and save it -- I cannot guarantee that anybody's code will compile when the hot reloader sees it, and will continue to do my best to not take down the process when it happens.
This draft is an implementation of option 4. (Options 2 and 3 are trivial.) I personally think option 1 is the most reasonable -- ultimately I have no control of how XamlX signals errors -- but I leave the decision of what to do in the hands of the maintainers.