lein-figwheel

richiardiandrea 2016-12-29T01:03:33.000395Z

The reason I asked is that the call to my old on-jsload function still is the old one, but if I execute it in the console manually, it runs the new one

richiardiandrea 2016-12-29T01:04:43.000398Z

I can still see the old function coming in, not the new one

richiardiandrea 2016-12-29T01:06:28.000399Z

of course this is not a problem in vanilla figwheel, but I cannot understand how, the on-jsload function is part of the options

bhauman 2016-12-29T01:06:30.000400Z

the on-jsload function can't be changed at runtime

bhauman 2016-12-29T01:06:46.000401Z

AFAIK

richiardiandrea 2016-12-29T01:08:10.000402Z

mmm I see that if I change the below in figwheel vanilla, the code in the console changes For instance in:

(defn on-js-reload []
  ;; optionally touch your app-state to force rerendering depending on
  ;; your application
  (.info js/console "Reloading Jav221asxsra..."))

bhauman 2016-12-29T01:08:10.000403Z

Hmmm maybe it's captured in a closure or maybe the original function isn't updated

richiardiandrea 2016-12-29T01:10:28.000404Z

very weird that I don't get the same behaviour, I will investigate more

richiardiandrea 2016-12-29T01:12:01.000405Z

ah! the called function is different, boot calls my version dirctly, vanilla calls:

Calling on-jsload function (var_args){
var x = null;
if (arguments.length > 0) {
var G__29653__i = 0, G__29653__a = new Array(arguments.length -  0);
while (G__29653__i < G__29653__a.length) {G__29653__a[G__29653__i] = arguments[G__29653__i + 0]; ++G__29653__i;}
  x = new cljs.core.IndexedSeq(G__29653__a,0);
} 
return G__29652__delegate.call(this,x);} with res ({:file "resources/public/js/compiled/out/fig_boot_reload/core.js", :namespace "fig_boot_reload.core", :type :namespace, :loaded-file true})

richiardiandrea 2016-12-29T01:13:10.000406Z

basically I have probably missed a call to some setup function that wraps on-jsload in something else

bhauman 2016-12-29T01:13:31.000407Z

yep in figwheel-sidecar/build-middleware/injection.clj

bhauman 2016-12-29T01:13:49.000408Z

line 97

bhauman 2016-12-29T01:14:41.000409Z

@richiardiandrea ^

richiardiandrea 2016-12-29T01:15:24.000410Z

cool looks like I still have some work to do 😉

bhauman 2016-12-29T01:16:16.000413Z

yeah figwheel does a lot of stuff

richiardiandrea 2016-12-29T01:16:28.000414Z

@bhauman for today is enough 🙂 Thanks for your help and patience for now

bhauman 2016-12-29T01:16:38.000415Z

no problem at all

👌 1