lein-figwheel

kauko 2016-06-08T07:28:51.000028Z

I'm working on a very big project, and figwheel is understandably getting slower. The problem is, sometimes it feels like it actually does more harm than good - especially when I do changes to a .cljc file, my browser tab completely freezes. While refreshing tabs is not something I want to go back to after experiencing the beauty that is figwheel, I'd certainly prefer it to going to the task manager and killing a tab.

kauko 2016-06-08T07:29:07.000029Z

I'm wondering whether there's some figwheel configurations we should do?

bhauman 2016-06-08T13:18:37.000030Z

@kauko: :reload-clj-files false

bhauman 2016-06-08T13:18:44.000031Z

that will do it

bhauman 2016-06-08T13:18:55.000032Z

I may make that the default soon

kauko 2016-06-08T13:19:33.000033Z

What will that do exactly? If I change a .cljc file, I'll have to compile and refresh myself?

bhauman 2016-06-08T13:20:35.000034Z

nope, it just prevents figwheel from autoloading the namespace into the clojure process. The file will still be compiled by the ClojureScript compiler

bhauman 2016-06-08T13:21:35.000035Z

:recompile-dependents false is a good one as well

bhauman 2016-06-08T13:21:49.000036Z

add those two and you will be flying again

kauko 2016-06-08T13:22:06.000037Z

Wait, why does figwheel care about .clj files?

bhauman 2016-06-08T13:23:00.000038Z

its for when you want to work on macros live. So clj files in the cljs-build :source-paths get auto loaded

bhauman 2016-06-08T13:23:11.000039Z

clj and cljc

kauko 2016-06-08T13:24:23.000040Z

Cool beans 🙂 So if I set :recompile-dependents false, and :reload-clj-files false, how exactly does it affect my worklow? There's a drawback, otherwise this would be the default, right?

bhauman 2016-06-08T13:28:50.000042Z

:reload-clj-files false - you won't be able to do cljs macro work

bhauman 2016-06-08T13:31:14.000043Z

:recompile-dependents false, turns off a safety feature of the compiler that recompiles all dependents of a changed file... It increases compile time if you are working on a namespace deep in a dependency tree, but in my experience I haven't seen any problems with turning it off

bhauman 2016-06-08T13:31:21.000044Z

and things really fly when you do

bhauman 2016-06-08T13:33:09.000045Z

there are also compile time things that slow you down like core.async, and core.match, or runtime things, that might be in your code, that get loaded over and over again

shaun-mahood 2016-06-08T20:10:28.000046Z

@bhauman: Given the amount of work you're doing on error messages, do you think it would be doable to pop up an info message when either :reload-clj-files or :recompile-dependents are false and a file changes such that you could assume the user wanted them to be set to true? Might reduce the drawbacks of changing the defaults to get the best of both worlds. This is all based on the assumption that the time taken is for operations outside of understanding that there was a change of some sort to the files, of course.

fenton 2016-06-08T23:10:45.000047Z

wondering if/when figwheel would support latest clj(s) versions so cljs can use cljs.spec. [org.clojure/clojurescript "1.9.36"] would be cool 🙂