duct-framework / duct

Server-side application framework for Clojure
MIT License
1.13k stars 51 forks source link

Add Hawk dependency and auto reloading #94

Closed kwrooijen closed 5 years ago

kwrooijen commented 5 years ago

Problem

There is no way to auto reload your Duct project currently. See: https://github.com/duct-framework/core/issues/12

Solution

As stated in https://github.com/duct-framework/core/issues/12 we can add Hawk as a dependency and write our own watcher.

Usage:

lein repl
(dev)
(auto-reset)
;; From here you can change any (Clojure / EDN) file 
;; in `src/` or `resources/` and the `(reset)` command 
;; will execute in a separate thread.

Notes

weavejester commented 5 years ago

Thanks for the PR. Before we talk about the actual code, the code needs to be moved to the duct.core.repl namespace, which is part of the duct/core library. This avoids unnecessary code in the project template.

kwrooijen commented 5 years ago

Thanks for your feedback. I'll close this and move it to core.

kwrooijen commented 5 years ago

Moved to https://github.com/duct-framework/core/pull/24