Clojure JIRAhttp://dev.clojure.org/jira
This file is an XML representation of an issueen-us4.464925-07-2011[CLJS-749] Changing ClojureScript versions may break browser REPLhttp://dev.clojure.org/jira/browse/CLJS-749
ClojureScript<p>By default in a project using ClojureScript, the .repl/ directory is used to store compiled CLJS for the browser REPL. This compilation is skipped if the directory already exists (src/clj/cljs/repl/browser.clj:205:create-client-js-file). However, it really should be re-compiled if the version of ClojureScript is upgraded/changed or else the browser REPL may fail with some very difficult to interpret error messages. At the moment, it seems people simply know to delete .repl/ when changing ClojureScript versions (<a href="https://groups.google.com/forum/#!topic/clojure/C-H4gSWIUwc">https://groups.google.com/forum/#!topic/clojure/C-H4gSWIUwc</a>) but this can be extremely tough on new users when they upgrade ClojureScript for the first time.</p>
<p>We could append <b>clojurescript-version</b> to the directory name. Unfortunate that it generates a new directory each time a new version of CLJS/BrowserREPL combo is used, but shoudl not occur too often and makes it very explicit that :working-dir should be tied to CLJS version. Also developers utilizing ClojureScript though lein checkouts will still have to delete .repl/ since <b>clojurescript-verion</b> is only set by script/build. </p>
<p>See attached patch.</p>
<p>NOTE: I do not have a CA agreement on file, but one is in the mail.</p>
<p>NOTE: Sorry if this is bad form, but as a preceding commit, in cases where <b>clojurescript-version</b> is unbound I changed (clojurescript-version) to return "" instead of ". This is so that when <b>clojurescript-version</b> is unbound .repl/ will be used instead of .repl-./ Let me know if this should be considered as a separate issue.</p>
<p>Alternatively, we could remove the exists check entirely, and instead recompile client.js every time (repl-env) is called at the cost of slowing down browser REPL startup.</p>CLJS-749Changing ClojureScript versions may break browser REPLDefectMajorClosedCompletedUnassignedOsbert FengreplTue, 14 Jan 2014 07:02:18 -0600Tue, 2 Dec 2014 12:49:18 -0600Tue, 2 Dec 2014 12:48:46 -060001<p>Seems like a fine fix but this patch needs to be rebased to master. Thanks.</p><p>Please see the updated patch. Thanks!</p><p>Fixed <a href="https://github.com/clojure/clojurescript/commit/50cc86ff3c4c39181a198a4f9be788c149eaae00">https://github.com/clojure/clojurescript/commit/50cc86ff3c4c39181a198a4f9be788c149eaae00</a><br/>
<a href="https://github.com/clojure/clojurescript/commit/85773301cf12541a053890643d1d943a6ed361de">https://github.com/clojure/clojurescript/commit/85773301cf12541a053890643d1d943a6ed361de</a><br/>
<a href="https://github.com/clojure/clojurescript/commit/d25aea69697cca2ef5fa8b9a6f7e4fd089685ace">https://github.com/clojure/clojurescript/commit/d25aea69697cca2ef5fa8b9a6f7e4fd089685ace</a></p><p>In the future squashed patches are preferred. Thanks for your contribution!</p>Global RankPatchCode