Repository navigation
Add grill run --hot and grill reload for Lua hot reload - #87
Merged
Merged
Conversation
run --hot builds with -luaHotReload, starts the compiler's hot reload session for _build and then launches the map. reload rebuilds with the hot run's map and --dev and writes the next payload through the session's send, printing the payload and warnings, or the reasons and exit code 1 when the edit is refused or no hot run was started. Payloads go to CustomMapData in the Warcraft III documents folder, --custom-map-data or wurst.customMapDataPath. Jass projects are rejected (JHCR is the Jass tool).
The game keeps the map it runs open, and each grill reload builds the map again into the same file. A hot run now launches a copy in _build/grill/hot-run.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The compiler can hot reload a running Lua map (
-luaHotReload,LuaHotReloadSession), but only the VS Code hot run drives it. Projects built with grill have no way to start a hot session or send an edit.Behaviour
grill run --hot [map]builds the map with-luaHotReload, starts the compiler's hot reload session for_build(LuaHotReloadSession start, which also removes the payloads of an earlier session), and then launches Warcraft III with a copy of the built map in_build/grill/hot-run. The game keeps the map it runs open, and each reload builds the map again, so the two must be different files. If the session cannot be started (for example an installed compiler without hot reload), the game is not launched.grill reload [map]builds the project again with the map and--devsetting of the hot run (recorded in_build/grill/hot-run.properties) unless another map is named, then runsLuaHotReloadSession send. It prints the payload and the compiler's warnings, or the compiler's refusal reasons and exits with 1. Without a hot session it exits with 1 and points togrill run --hot. Because grill uses the same_build/luaHotReloadsession and CustomMapData folder as the language server, a reload continues the numbering of a hot run started from VS Code and the other way round.--custom-map-data <dir>, then the VS Code settingwurst.customMapDataPath, thenCustomMapDatain the Warcraft III documents folder.Validation
HotReloadTests(stand-in compiler and session class; the launch is replaced, nothing starts the game) and the full WurstSetup suite pass on Windows.doAfterclosure); the launch went to a stub executable via--wc3-path:run --hotwrote_build/luaHotReload/manifest.jsonandsession.json, launched the copy, and the reload afterwards rebuilt_build/<map>.w3xwhile the copy stayed unchanged.CustomMapData/Wurst/hotreload-1.pld, byte-identical to the payload (and session state) thatLuaHotReloadSession sendproduced for the same baseline and manifest. Further reloads continued at 2, 3 and 4.Not verified: the launch itself and payload pick-up in the game. Also, the compiler's
-buildadds the build-only+opt/+inlinelines ofwurst_run.args, which its default file contains, and then rejects-luaHotReloadwith-inline/-opt. Until that is fixed in the compiler,run --hotandreloadneed awurst_run.argswithout those lines.