I was using keechma
with figwheel
previously, and it worked. But I am using keechma
with shadow-cljs
for the first time, and although (restart-app!)
in the following code block was called, the changes in ui isn't being re-rendered. The same code works under figwheel
. If I use just a basic reagent
component in shadow-cljs
, it gets re-rendered. tl;dr: reagent
+ lein
/ shadow-cljs
works; figwheel
+ keechma
works; shadow-cljs
+ keechma
doesn't work
(defn start-app! []
(reset! running-app (app-state/start! app/definition)))
(defn restart-app! []
(let [current @running-app]
(if current
(app-state/stop! current start-app!)
(start-app!))))
@priornix check out https://github.com/mjmeintjes/shadow-cljs-keechma-node?files=1
I see there's some reloading related code in shadow-cljs.edn file
Anyway, I found a clue, the app is only updated when I touched the app definition
file
That means that while the component file is being updated, the app definition itself wasn't reloaded.
I'll have a look at the sample code tomorrow, but at first glance doesn't seem to be doing anything different.
:before-load
maps to an empty function, :after-load
restarts the app-state as the code above.
Anyway, in summary shadow-cljs
reloads the component
file, the ui.cljs
file (containing the hashmap to the compenent
) but doesn't reload the app definition
file.
I guess the trick here is to put app
definition into the ui.cljs
so that it gets reloaded