Skip to content

Commit

Permalink
Simplify reloading section of README
Browse files Browse the repository at this point in the history
Drop references to shotgun and Rack::Reloader.  shotgun is no
longer maintened, and Rack::Reloader's approach of just loading
a modified file without removing constants defined in the existing
file is not something Roda should be encouraging.

Also recommend that people start with Zeitwerk, since that is the
most popular reloading option these days.
  • Loading branch information
jeremyevans committed Oct 18, 2023
1 parent 4b514f7 commit a0b8d4f
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -1006,25 +1006,16 @@ constants and removing them when any of the reloadable loaded files changes. It
+require+ and +require_relative+ when activated (usually in the development environment). No
configurations other than +reloadable_paths+ are required.

Both {rerun}[https://github.com/alexch/rerun] and
{shotgun}[https://github.com/rtomayko/shotgun] use a fork/exec approach for loading new
versions of your app. rerun is faster as it only reloads the app on changes, whereas
shotgun reloads the app on every request. Both work without any changes to application
{rerun}[https://github.com/alexch/rerun] uses a fork/exec approach for loading new
versions of your app. It work without any changes to application
code, but may be slower as they have to reload the entire application on every change.
However, for small apps that load quickly, either may be a good approach.

{Rack::Reloader}[https://github.com/rack/rack/blob/master/lib/rack/reloader.rb] ships
with rack and just reloads monitored files when they change, without unloading constants.
It's fast but may cause issues in cases where you remove classes, constants, or methods,
or when you are not clearing out cached data manually when files are reloaded.
However, for small apps that load quickly, it may be a good approach.

There is no one reloading solution that is the best for all applications and development
approaches. Consider your needs and the tradeoffs of each of the reloading approaches,
and pick the one you think will work best.

If you are unsure where to start, it may be best to start with rerun or shotgun
(unless you're running on JRuby or Windows), and only consider other options if rerun or
shotgun are not fast enough.
and pick the one you think will work best. If you are unsure where to start,
it may be best to start with Zeitwerk, and only consider other options if it does not
work well for you.

== Plugins

Expand Down Expand Up @@ -1143,4 +1134,3 @@ MIT
== Maintainer

Jeremy Evans <[email protected]>

0 comments on commit a0b8d4f

Please sign in to comment.