keechma

Keechma stack. Mention @U050986L9 or @U2J1PHYNM if you have any questions
priornix 2018-09-28T18:02:09.000100Z

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

priornix 2018-09-28T18:02:24.000100Z

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

mihaelkonjevic 2018-09-28T19:00:54.000100Z

@priornix check out https://github.com/mjmeintjes/shadow-cljs-keechma-node?files=1

mihaelkonjevic 2018-09-28T19:01:41.000100Z

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

priornix 2018-09-28T19:03:10.000100Z

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

priornix 2018-09-28T19:04:31.000100Z

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

priornix 2018-09-28T19:16:24.000100Z

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

priornix 2018-09-28T19:17:27.000100Z

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

priornix 2018-09-28T19:21:16.000100Z

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.

priornix 2018-09-28T19:23:54.000100Z

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