Fork me on GitHub
#keechma
<
2019-07-08
>
Ahmed Hassan11:07:53

How do you setup hot code reload with shadow-cljs in Keechma?

Ahmed Hassan11:07:51

I am using shadow-cljs as build tool and code is not being loaded to browser when I save file after changes.

Ahmed Hassan11:07:47

So, I have to press reload button of browser to see results and effects.

Ahmed Hassan12:07:28

UI behaves same way after changes. (to make it behave in new(changed) way browser reload button is needed to be pressed)

Ahmed Hassan12:07:35

I just noticed that when I make changes and save the core.cljs file in which app-definition/app-config is defined and app is mounted, changes are loaded to the browser automatically. (even ones I did in other namespaces.)

mihaelkonjevic12:07:31

@ahmed1hsn AFAIK there were some issues with shadow-cljs not reloading transitive dependencies. This is not a keechma related issue, but it works differently than figwheel

mihaelkonjevic12:07:39

I was using shadow-cljs only for node projects, I’m using classic figwheel for all projects I’m working on

Ahmed Hassan12:07:39

Is there any possible workaround or should I move to figwheel-main? I'm using shadow-cljs because it's simple and interop with npm libs is painless.

mihaelkonjevic13:07:53

@ahmed1hsn not sure. I’m not even using figwheel-main, just figwheel (although I did test figwheel and it was working ok). For npm libs I’m using this setup: https://github.com/retro/protok-frontend/blob/master/project.clj https://github.com/retro/protok-frontend/blob/master/src/js/index.js https://github.com/retro/protok-frontend/blob/master/Makefile#L18 We’re using it on all our projects and it works flawlessly

carkh15:07:20

actually easy to make it work with shadow-cljs

carkh15:07:32

i personally prefer it to figwheel-main