Fork me on GitHub
#cljs-dev
<
2016-07-30
>
anmonteiro16:07:07

I can mark the macro-dependant files for recompilation, but it seems that the macros don’t get expanded again

anmonteiro16:07:34

so even though the files that depend on macros get recompiled, the macros have the old behavior?

anmonteiro16:07:44

seems kinda strange, but it’s what I’m seeing

dnolen16:07:23

@anmonteiro: well you have to re-evaluate the macro file

dnolen16:07:43

the simplest way is probably to require :reload

anmonteiro16:07:59

@dnolen: oh.. actually re-evaluate the macro file in the compiler?

dnolen16:07:21

@anmonteiro: yeah you need to reload that Clojure code

anmonteiro16:07:35

I was looking at Figwheel for inspiration, and it does load-file indeed

anmonteiro16:07:51

OK, let me try that then

anmonteiro17:07:44

Cool, it works now

bhauman17:07:59

Are you just handling the case where a clj file has macros in it?

anmonteiro17:07:35

@bhauman: I suppose I am. As compared to what?

bhauman17:07:15

as opposed to handling cases where clj files that load macro files are changed?

bhauman17:07:25

scratch that

bhauman17:07:47

as opposed to reloading transient dependents of macro files

anmonteiro17:07:18

@bhauman: ah right. I suppose that in that case I would have to :reload-all

bhauman17:07:19

like if a macro file depends on a another clj file

anmonteiro17:07:35

I wonder what behavior would be most appropriate /cc @dnolen

bhauman17:07:36

From my experience you either have to do the very simple case where a file with macros in it has direct cljs dependents or do the full namespace walk

bhauman17:07:09

I think the simple case covers 99% of the cases

anmonteiro17:07:52

@bhauman: I get it now. A dependant of a macro file changed, but that one has no direct CLJS dependants

anmonteiro17:07:47

So yeah, I’m only doing the simple case

bhauman17:07:50

I would say handle only the case where a file has macros in it, and it has direct cljs dependents

bhauman17:07:06

yeah thats good

bhauman17:07:17

and easy to reason about

anmonteiro17:07:33

it’s what I’m doing. if external tooling wants to do the full namespace walk nothing prevents that

anmonteiro17:07:13

@bhauman: thanks for your input 👍

bhauman17:07:29

no problem 🙂

dnolen18:07:11

@anmonteiro: hard error is fine since that can only lead to head scratchers