Closed gtrak closed 10 years ago
I don't seem to experience any serious consequences upon reloading the browser then reloading sources; dependencies appear to be loaded as expected…
That said, a refresh should yield option (1), not (2); though surely awesome, the intent of reloading the browser is to yield a clean slate, not a JS environment that has all previously-loaded code loaded again. Conveniently, it also has the benefit of being really easy to implement. :-P
I'll try to get to this in the next couple of days (the clean slate option, I've spent a few hours already trying to figure out the reload option, and I need more closure experience and hammock time to pull it off, I think :-), not sure what's the timeline for 0.1.5.
I'll just save off a snapshot of the env state in-memory after the first compilation so we can continue to cache it as a file.
Is this something that you've already implemented in your tooling middleware, or is there a change/patch that should land here?
I think I worked around this by always running a cljsbuild environment in addition to the repl, I haven't seen the behavior in a while. I tried to hack Austin to always reload whatever code has already been eval'd via compiler state, but that became a mess very quickly.
On Saturday, August 23, 2014, Chas Emerick notifications@github.com wrote:
Is this something that you've already implemented in your tooling middleware, or is there a change/patch that should land here?
— Reply to this email directly or view it on GitHub https://github.com/cemerick/austin/issues/54#issuecomment-53153816.
Yeah, not surprising, especially since the compiler state will include all sorts of random snippets evaluated interactively (i.e. not whole files).
Had an interesting conversation about it http://clojure-log.n01se.net/date/2014-03-01.html#21:08
Symptoms: load-file in the piggieback repl doesn't seem to be loading transitive deps due to stale compiler state, however my tooling/auto-complete stuff still thinks things exist.
This was on my fork of austin + clojurescript master.
Normal functioning:
After a refresh:
I think there are two obvious solutions.
I feel like 2 would be more awesome than ill-conceived.
Further investigation reveals: Seems like compiled-cljs files are enumerated and stored in the compiler state map, we could load those up. This doesn't address normal eval'd code, though. No biggie.
In closure.clj
Seems like this could be specified to return the pre-existing compiled sources that are already on disk (in dependency order) via closure/compiled-file, then clojurescript/closure's build function can continue to handle bundling everything up.