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
by dumping the on-jsload
param here: https://github.com/bhauman/lein-figwheel/blob/b187d9a4535e96d49f24c01579c30d11715b0fe8/support/src/figwheel/client/file_reloading.cljs#L385
I can still see the old function coming in, not the new one
of course this is not a problem in vanilla figwheel, but I cannot understand how, the on-jsload
function is part of the options
the on-jsload function can't be changed at runtime
AFAIK
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..."))
Hmmm maybe it's captured in a closure or maybe the original function isn't updated
very weird that I don't get the same behaviour, I will investigate more
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})
basically I have probably missed a call to some setup function that wraps on-jsload
in something else
yep in figwheel-sidecar/build-middleware/injection.clj
line 97
cool looks like I still have some work to do 😉
yeah figwheel does a lot of stuff
@bhauman for today is enough 🙂 Thanks for your help and patience for now
no problem at all