ANN: ClojureScript 0.0-3196, Conditional Reading, REPLs, and Code Motion

1,076 views
Skip to first unread message

David Nolen

unread,
Apr 10, 2015, 8:20:58 PM4/10/15
to clojure, clojur...@googlegroups.com
ClojureScript, the Clojure compiler that emits JavaScript source code.


Leiningen dependency information:

    [org.clojure/clojurescript "0.0-3196"]

This release is intended to coincide with Clojure 1.7.0-beta1. Besides
conditional reading support, it includes a number of improvements and
bug fixes around REPLs. Piggieback (and thus nREPL) integration has
been greatly enhanced. Also notable is significantly improved cross
module code motion under :modules.

As always feedback welcome!

## 0.0-3196

### Enhancements
* Conditional reading
* map clojure.core/in-ns to REPL in-ns special for existing tools
* CLJS-1171: map clojure.repl/doc, clojure.repl/source, clojure.repl/dir
* add macroexpand and macroexpand-1 macros
* CLJS-1019: REPL source map caching support
* CLJS-1154: Unmunged function names for stacktrace

### Changes
* Clojure 1.7.0-beta1 dependency
* tools.reader 0.9.1 dependency
* CLJS-1188: multi-arity fns hinder cross-module code motion
* cljs.test needs to default to sync
* CLJS-1184: log module building activity under verbose
* CLJS-1175: CLJS defmulti doesn't exhibit same defonce behavior as Clojure's defmulti, suggesting an even better reloading behavior
* CLJS-1176: redirect node REPL output through *out* and *err*, not System/out, System/err
* CLJS-1144 - expose defaul-dispatch-val and dispatch-fn multifn accessors
* CLJ-1172: supply main entry points for all standard REPLs
* less noisy REPL prompt
* add docstrings & validation to macroexpand & macroexpand-1

### Fixes
* CLJS-1192: eliminate JDK8 API dependency in cljs.repl.node
* CLJS-1158: Regression: compiler fails to see symbols defined in another namespace
* CLJS-1189: array-map will return PersistentHashMap if applied to more than (.-HASHMAP-THRESHOLD PersistentArrayMap) pairs
* CLJS-1183: load-file doesn't copy source to output directory
* CLJS-1187: var ast contains internal nodes with bad analysis :context
* CLJS-1182: semantics of load-file should be require + implicit :reload
* CLJS-1179: strange load-file behavior
* CLJS-808: Warning from `find-classpath-lib` mistakenly included in generated source
* CLJS-1169: cannot use REPL load-file on files that declare single segment namespaces
* don't use print unless printing the result of eval
* CLJS-1162: Failure to printStackTrace when REPL initialized
* CLJS-1161: actually print error stack traces to *err*, allow higher-level rebindings of *cljs-ns*
* CLJS-841: cljs.closure/build file locks
* CLJS-1156: load-file fails with :make-reader issue
* CLJS-1152: (require 'some.ns :reload) causes printing to stop working in browser REPL
* CLJS-1157: Stacktrace unmunging blindly use locals
* CLJS-1155: REPL :watch support does not play nicely with :cljs/quit
* CLJS-1137: :cljs/quit fails to actually quit in browser REPL
* CLJS-1148: ClojureScript REPL must maintain eval/print pairing
* make quit-prompt configurable
* CLJS-1149: cljs.repl/repl needs to support :compiler-env option
* CLJS-1140: typo in cljs.repl/repl, `:need-prompt prompt` instead of `:need-prompt need-prompt`

Ravindra Jaju

unread,
Apr 10, 2015, 10:42:35 PM4/10/15
to clojur...@googlegroups.com, clojure
Hi.

I need some help here to understand some errors I see after switching to 0.0-3196

Top-level exception message:
clojure.lang.ArityException: Wrong number of args (2) passed to: reader/read

This was working okay with 0.0-3169

The change commit-id 6d4ee9c0f938ac62147ecda6a2a47fcb2cca69e4 has the following diff around reader/read
-                          (reader/read pbr nil eof-sentinel opts nil))]
+                          (reader/read opts pbr))]

I'm using leiningen (lein-cljsbuild) to build this, but a direct build from REPL as follows (as suggested in the Wiki)
(require 'cljs.closure)

(cljs.closure/build "src" {:output-to "out/main.js"})

also throws the same exception.

What could I be missing?

Thanks,
jaju

--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Julien Eluard

unread,
Apr 10, 2015, 10:55:07 PM4/10/15
to clojur...@googlegroups.com, clo...@googlegroups.com
Hi,

that looks like a tools.reader version conflict. You can get more details about all your project dependencies using `lein deps :tree`. Make sure the only tools.reader is the one coming from ClojureScript.

Julien

Ravindra Jaju

unread,
Apr 10, 2015, 11:06:22 PM4/10/15
to clojur...@googlegroups.com, clo...@googlegroups.com
You're right. Thanks!!

cider-nrepl is pulling in an older version. Even though I tried narrowing down and updating all dependencies (including lein plugins) to their snapshot versions, my assumptions about versions and dependencies and how updated they may have been were, obviously, so wrong! :)
And without realizing, I started the REPL via lein and pulling in those dependencies - to try the direct compile - even though I was looking to stay clean of lein + plugins to ensure that "bug" reproduction was 'pure'! ;-)

I wouldn't have guessed even if I'd have looked at the deps-tree, without your directions. Thanks again!

Best,
jaju

Georgi Danov

unread,
Apr 11, 2015, 5:06:37 AM4/11/15
to clo...@googlegroups.com, clojur...@googlegroups.com
Hi,
 I keep having troubles running repl with piggieback and once again I see in the changelog this was improved. I also saw the screenshot in your last tweet which clearly shows intellij can connect.

 Can you please share your project set-up? Some sort of sample project that has that up & running would be of great value.

 Even when I follow the tutorials I end up in weird exceptions, last one being

No implementation of method: :-evaluate of protocol: #'cljs.repl/IJavaScriptEnv found for class: clojure.lang.PersistentArrayMap
        at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:554)

David Nolen

unread,
Apr 11, 2015, 10:06:47 AM4/11/15
to clojur...@googlegroups.com, clojure
I was able to connect IntelliJ to a REPL because Cursive can now connect to a ClojureScript REPL started in the usual way. There is no special setup, make sure you've taken the time to read the new ClojureScript Quick Start.

HTH,
David

Georgi Danov

unread,
Apr 11, 2015, 10:45:18 AM4/11/15
to clojur...@googlegroups.com, clo...@googlegroups.com
I did read it very carefully several times, but kept trying to use it via remote connection (headbang).

I got it running using the config "use clojure.main in normal JVM process", is this how it's supposed to be?

David Nolen

unread,
Apr 11, 2015, 11:15:06 AM4/11/15
to clojur...@googlegroups.com, clojure
Yep, the clojure.main option is the one you want.

David

Georgi Danov

unread,
Apr 12, 2015, 5:34:41 AM4/12/15
to clojur...@googlegroups.com, clo...@googlegroups.com
thanks!

Leon Grapenthin

unread,
Apr 13, 2015, 6:44:45 AM4/13/15
to clo...@googlegroups.com, clojur...@googlegroups.com
Is there any working ClojureScript NREPL with this latest setup of CLJ 1.7-beta-1, CLJS3169 and cider-0.9-SNAPSHOT available?

Using weasel-0.6.0-SNAPSHOT with piggieback 0.2.0 gives me a functioning REPL but code completion and source jump don't work anymore.

Best regards,
 Leon.
Reply all
Reply to author
Forward
0 new messages