Not sure about logging level, but you could throw a (.clear js/console)
into whatever you've got running on figwheel's :on-jsload
i find that often it's just easier to close lein with figwheel and start from scratch than try to refresh a hundred times the browser so it maybe updates the code that is running
it's becoming really annoying
that i can't trust it
like i remove half the code
and it still running the old file with the old functions, drawing on the canvas stuff that are no longer present anywhere in the code
"live reload" so live that it won't kill even that is removed
@ashnur have you read about the restrictions code-reloading places on your code?
even a perfect code reloader could not handle arbitrary mutable code well
https://github.com/bhauman/lein-figwheel#writing-reloadable-code
@isak thanks, i will re read that, there will be certainly some stuff that will help. However my issue is not about state, but actual running code. If I have some code that is drawing something on a canvas, then I remove that code and restart lein with figwheel, why am I seeing the removed code still drawing stuff on the canvas?
i am not talking about live reloading
i am talking about closing lein entirely, then starting again with clean
and it was still showing me code that i removed
that should never ever happen normally
well it depends how it is added. If you add a function foo
, then call (js/setTimeout foo 100000), but then remove that function, I'd expect any code reloader to still execute it, right? @ashnur
IIRC, figwheel only adds/replaces definitions, doesn't remove
@isak, even after you close leiningen, run lein clean and then you run lein figwheel?
@ashnur if the original browser environment is still running, then yea, because it has already been mutated
i refreshed the browser window then the server was down, so it was showing that it can't connect
then when i started it again, it connected and shown the old code
i repeated the process and then it was showing what i expected
Ah I see, then that sounds strange, and I don't know
yeah 🙂
@ashnur I've seen that too, I suspect it's browser caching related