Fork me on GitHub
#lein-figwheel
<
2016-11-03
>
anmonteiro11:11:48

@bhauman ClojureScript 1.9.293 introduced require macros that can be called outside of the ns form

anmonteiro11:11:26

we also replaced the REPL special functions by these in cljs.repl

anmonteiro11:11:52

I'm seeing weird behavior in the Fighweel REPL with ClojureScript 1.9.293 and some requires

anmonteiro11:11:44

i.e. if I have a ClojureScript dependency in the classpath that is otherwise not used in my Figwheel build, require fails with this error:

#object[Error Error: goog.require could not find: bidi.bidi]
   figwheel$client$file_reloading$figwheel_require (jar:file:/Users/anmonteiro/.m2/repository/figwheel/figwheel/0.5.6/figwheel-0.5.6.jar!/figwheel/client/file_reloading.cljs:187:30)

anmonteiro11:11:08

^ in this case I'm trying to require bidi.bidi but I don't (yet) have it in any of the project's namespaces

anmonteiro11:11:13

(require '[om.next :as om]), for example, works just fine (because it's a dependency in some namespaces in the project

bhauman14:11:22

@anmonteiro: and this same case works in the regular cljs repl?

bhauman14:11:48

Hmmm frustrating this should just work

bhauman14:11:34

Have you eliminated nREPL and other environmental complications?

bhauman14:11:39

Hmmmm, I think there is something wrong with the expectations here.

bhauman14:11:20

if require compiles down to goog.require

bhauman15:11:42

Thinking out loud here: Then bidi is going to need to be in the client side dependency map. So the result of calling require will have to compile bidi and update the dependency map, hmmm OK I can see several ways this might fail. I'll take a look.

anmonteiro15:11:06

@bhauman I think you're replicating a lot of stuff from cljs.repl

anmonteiro15:11:25

there's probably something there you also need to replicate but aren't currently?

bhauman15:11:04

Nope I use cljs.repl straight with various options set.

bhauman15:11:02

But on the client side I have to some crazy stuff for live reloading

anmonteiro15:11:04

this one changed to accomodate for the new stuff, e.g. require, etc

anmonteiro15:11:54

@bhauman if you're going to rely on internal details maybe you can call private stuff via the var? then everything is updated automatically

anmonteiro15:11:10

e.g. (#'cljs.repl/some-private-fn foo bar baz)

bhauman15:11:04

Absolutely

bhauman15:11:58

I wrote that before I knew about that trick

bhauman15:11:40

Thanks for the pointer that helps.