Fork me on GitHub
#lein-figwheel
<
2016-06-08
>
kauko07:06:51

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.

kauko07:06:07

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

bhauman13:06:37

@kauko: :reload-clj-files false

bhauman13:06:44

that will do it

bhauman13:06:55

I may make that the default soon

kauko13:06:33

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

bhauman13:06:35

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

bhauman13:06:35

:recompile-dependents false is a good one as well

bhauman13:06:49

add those two and you will be flying again

kauko13:06:06

Wait, why does figwheel care about .clj files?

bhauman13:06:00

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

bhauman13:06:11

clj and cljc

kauko13:06:23

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?

bhauman13:06:50

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

bhauman13:06:14

: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

bhauman13:06:21

and things really fly when you do

bhauman13:06:09

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-mahood20:06:28

@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.

fenton23:06:45

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 🙂