lein-figwheel

anmonteiro 2016-11-03T11:25:48.000114Z

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

anmonteiro 2016-11-03T11:26:26.000115Z

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

anmonteiro 2016-11-03T11:26:52.000116Z

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

anmonteiro 2016-11-03T11:27:44.000117Z

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)

anmonteiro 2016-11-03T11:28:08.000118Z

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

anmonteiro 2016-11-03T11:29:13.000120Z

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

bhauman 2016-11-03T14:47:22.000121Z

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

anmonteiro 2016-11-03T14:48:22.000122Z

@bhauman yeah

bhauman 2016-11-03T14:48:48.000123Z

Hmmm frustrating this should just work

bhauman 2016-11-03T14:49:34.000124Z

Have you eliminated nREPL and other environmental complications?

bhauman 2016-11-03T14:50:18.000125Z

@anmonteiro: ^

anmonteiro 2016-11-03T14:51:34.000126Z

yeah

bhauman 2016-11-03T14:52:39.000127Z

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

bhauman 2016-11-03T14:53:20.000128Z

if require compiles down to goog.require

bhauman 2016-11-03T15:00:42.000129Z

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.

anmonteiro 2016-11-03T15:03:06.000130Z

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

anmonteiro 2016-11-03T15:03:25.000131Z

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

bhauman 2016-11-03T15:04:04.000132Z

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

bhauman 2016-11-03T15:05:02.000135Z

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

anmonteiro 2016-11-03T15:05:04.000136Z

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

anmonteiro 2016-11-03T15:06:54.000137Z

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

anmonteiro 2016-11-03T15:07:10.000138Z

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

bhauman 2016-11-03T15:08:04.000139Z

Absolutely

bhauman 2016-11-03T15:08:58.000140Z

I wrote that before I knew about that trick

bhauman 2016-11-03T15:10:40.000141Z

Thanks for the pointer that helps.