Repository navigation
feat: automatic development hot reload watcher - #22
Merged
HMH-3080 merged 1 commit intoOct 24, 2026
Merged
Conversation
Implements automatic source code reloading in development mode. Watches source directories, debounces rapid edits, rebuilds the application into isolated binary targets, and restarts the server only after a successful build. Keeps the previous server running uninterrupted on compilation failures while rendering compiler diagnostics. Adds CLI flags (-p, -b, -e, -w, --no-watch, --delay, --entry) and config.reload settings. Closes Arab-Open-Source#3
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.
Summary
Implements a built-in Development Hot Reload system (
Altair::CLI::Watcher) for Altair applications, directly resolving #3.Features
src/,views/andconfig/by default.200msdefault) before triggering a single rebuild..altair/bin/server_aandserver_b). If compilation fails, the previous server process continues running without interruption, and formatted diagnostics are rendered inline.-p,--port PORT-b,--bind HOST/-h,--host HOST-e,--env ENV-w,--watch(enabled by default in development)--no-watch(disables watcher, runs server in-process)--delay DURATION(e.g.200ms,500ms,1s)--entry PATH(explicit entrypoint)config.reloadas well as file-basedconfig/altair.ymlorconfig/watch.yml..git/,lib/,bin/,tmp/,log/,node_modules/,.altair/, sqlite database files (.db,.sqlite3,.db-wal,.db-shm,.db-journal), and editor swap files.Verification
crystal spec: 1049 examples passing (0 failures, 0 errors, 36 pending).crystal tool format --check src spec examples: Clean.Closes #3