Closed gerdint closed 8 months ago
If you update the init multimethod in the pages
namespace as follows, and that should do the trick
(defmethod ig/init-key :reitit.routes/pages
[_ {:keys [base-path]
:or {base-path ""}
:as opts}]
(layout/init-selmer!)
(when (= :dev (:env opts))
(selmer.parser/cache-off!))
[base-path (route-data opts) (page-routes opts)])
Indeed. Perhaps it would be a good idea to add this to the stock pages component template?
Yup, I've updated the module with the code.
It feels odd that changes in Selmer templates do not have effect until you do an Integrant reset in the REPL. I know this is analogous to how code changes are handled (reset always needed), but since the template files are referenced from the source itself it seems logical that changes to them take effect immediately.
I do see the value of automatic caching/memoization in production. I tried disabling the caching by doing
(selmer.parser/cache-off!)
in the user.clj ns but this does not seem to help.