Fork me on GitHub
#keechma
<
2018-09-28
>
priornix18:09:09

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

priornix18:09:24

(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!))))

mihaelkonjevic19:09:41

I see there's some reloading related code in shadow-cljs.edn file

priornix19:09:10

Anyway, I found a clue, the app is only updated when I touched the app definition file

priornix19:09:31

That means that while the component file is being updated, the app definition itself wasn't reloaded.

priornix19:09:24

I'll have a look at the sample code tomorrow, but at first glance doesn't seem to be doing anything different.

priornix19:09:27

:before-load maps to an empty function, :after-load restarts the app-state as the code above.

priornix19:09:16

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.

priornix19:09:54

I guess the trick here is to put app definition into the ui.cljs so that it gets reloaded