Fork me on GitHub
#boot
<
2017-05-23
>
bhagany01:05:22

@mudphone I don't think I know of the talk you saw, but in my experience, this kind of thing is done in the context of a watch task, and the caching is done in memory.

bhagany01:05:59

So, the cache doesn't live beyond a single boot invocation - it's only useful for subsequent runs of a task in the same process

mudphone01:05:53

bhagany: I see. So, you mean on reload?

bhagany01:05:20

Do you mean boot-reload?

bhagany01:05:27

By which I mean, are you using the word "reload" kind of generically, or are you referring to the specific reload task?

mudphone01:05:40

I’m using boot-reload, so I guess that’s what I mean.

mudphone01:05:00

I hadn’t thought about how watch might use a cache.

bhagany01:05:46

Okay, yeah - so watch doesn't really know anything about caches, but it does make it feasible for other tasks to have them, because everything stays in the same process. I don't know for sure, but I would bet that boot-reload is tracking things in some sort of internal cache itself, to keep track of what files are newly changed on each watch loop

bhagany01:05:55

in fact, let me look quick...

mudphone01:05:10

For example, if I change my cljs.hl, how would I prevent SCSS for rebuilding.

mudphone01:05:54

…reading link…

bhagany01:05:18

I'm not sure what cljs.hl is?

mudphone01:05:15

oh sorry, I mean any CLJS

bhagany01:05:32

In case you could use some commentary on the link - it's comparing the fileset from the previous time the task was run (aka prev) to the current fileset, and only acting on edn files that have changed

mudphone01:05:36

(.cljs.hl is the Hoplon extension)

bhagany01:05:37

ah, okay. Is there a separate task that's building your SCSS?

mudphone01:05:08

hmm, looking closer, I think it’s autoprefixer that I’m running every reload

mudphone01:05:09

by a separate task…

mudphone01:05:48

danielsz.autoprefixer

bhagany01:05:50

okay, it should work the same general way. whatever task is running autoprefixer would have to do fileset diffing similarly to the link from boot-reload, and only run autoprefixer on css files that have changed since the last run

mudphone01:05:03

hmm, okay, thanks

bhagany01:05:45

and yeah, it looks like danielsz.autoprefixer does that

mudphone01:05:48

It might be because I am sifting the css to a subdirectory

bhagany01:05:01

ach, I meant "doesn't do that"

bhagany01:05:43

and I don't see any caching - it just runs on every css file every time

mudphone01:05:57

that was very helpful, thank you

bhagany01:05:38

sure, np 🙂

dominicm13:05:42

@mudphone caching has been added to per-tasks. uber is an example of such a task.

juhoteperi14:05:49

Simple tasks can use fileset-diff to check the changed files and recompile those. Simple example can be found at deprecated Boot-cljx: https://github.com/Deraen/boot-cljx/blob/master/src/deraen/boot_cljx.clj#L29-L32, but for example less4clj/sass4clj use the same solution.

mudphone22:05:48

@U09LZR36F thanks for the help. I’m a little confused by the term “per-task,” could you please explain what that is?

mudphone22:05:21

@U061V0GG2 okay, I think that explains why my sass is only loaded one time (unless changed)

dominicm07:05:18

@mudphone uh, I was trying to reuse a term I thought I saw used earlier. Basically it persists outside of the fileset-diff ^^

mudphone08:05:52

Hmm I think I’m still confused about what happens in the sift task… I think I need to do more experiments.

cpmcdaniel19:05:24

ok, so I am writing an external (Closure-compatible) js lib and using {:compiler-options {:libs ["libs/foo.js"]}} for my cljs task. It works, but I suppose I need to add it to :source-paths for watch to recompile. Is this the recommended way to do this?

cpmcdaniel20:05:09

also, I’m using :source-map true and Chrome seems to find my source maps, but the files are empty in dev tools

avery23:05:52

Anyone here ever used boot-logservice in conjunction with boot-http? I’m finding if I don’t use serve’s init option, my server pod (?) doesn’t include the correct logfactory as alter-var-rooted’ in build.boot