Hot reload on every layer
If I'm going to spend a year writing this thing, I want the iteration loop to feel instant. So every layer of the engine hot-reloads on save:
- UI / TSX -> the JSX bundle re-evals inside the wasm and the reactive runtime (written in TS) re-mounts the diffed tree. Same trick the desktop dev binary uses
- Native C code -> the game ships as a
.dylibnext to the shell binary. On every save, the shell re-dlopens the new dylib (with a generation-suffixed copy per load to defeat macOS dyld same-path pinning, that was a fun afternoon) - Shaders ->
.glsledits regenerate the.glsl.hheader,dev-watch.shfingerprints the UBO layout and decides between hot reload (shader body only) or full reload (struct changed) - Scenes ->
scene_reloadreads the.scene.jsonagain and reconciles entities in place. Move a ship, adjust a spawner, no restart - Audio assets ->
filewatchon the voice + track files, the running mix picks up the new note instantly
The whole loop is driven by a tiny dev-watch.sh that writes .reload-hot / .reload-full signal files. The engine watches those files and dispatches the right reload phase.
End result: I can have the game running, the music playing, and edit a shader, a C system, the JSX HUD, and a scene at the same time, watching the changes land without losing a frame :)
