Added
- Reload the app's code in place instead of restarting the server.
hanami servernow wraps the app in a Rack middleware that checks the app's source files once per request and reloads viaHanami::Slice#reloadbefore dispatching, so the process stays up and requests are served from freshly loaded code. Changes to Ruby files, YAML files (such as translations) and templates (in any format) inapp/,config/,lib/andslices/trigger a reload. (@afomera in #37, @timriley in #42) - Render errors raised while reloading on the hanami-webconsole error page, where hanami-webconsole is bundled and
config.render_detailed_errorsis enabled, instead of returning a bare 500. (@afomera in #37, @timriley in #40 and #41) - Warn, instead of silently doing nothing, when a changed file cannot be applied by a reload (
config/app.rb,Gemfile,Gemfile.lock,.envfiles,config/settings/*.yml). (@afomera in #37, @timriley in #42) - Put off a reload while a response is held open (such as a streamed response), and serve requests with the current code until it closes, instead of making every request wait for it. (@afomera in #37)
Changed
hanami installno longer generates aGuardfile. Code reloading now needs no per-app configuration, so you can delete theGuardfilefrom your app. (@afomera in #37)- Support Hanami CLI's move to Dry CLI 2. The
installandservercommands now use thestdoutandstderrstreams from Dry CLI, and no longer override#initialize. (@afomera in #38, @timriley in #39)