Fork me on GitHub
#lein-figwheel
<
2016-12-29
>
richiardiandrea01:12:33

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

richiardiandrea01:12:43

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

richiardiandrea01:12:28

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

bhauman01:12:30

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

richiardiandrea01:12:10

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..."))

bhauman01:12:10

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

richiardiandrea01:12:28

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

richiardiandrea01:12:01

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})

richiardiandrea01:12:10

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

bhauman01:12:31

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

richiardiandrea01:12:24

cool looks like I still have some work to do 😉

bhauman01:12:16

yeah figwheel does a lot of stuff

richiardiandrea01:12:28

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

bhauman01:12:38

no problem at all