ANN: ClojureScript 1.9.198 - cljs.spec, core ns aliasing, macro inference, :rename, and more!

772 views
Skip to first unread message

David Nolen

unread,
Aug 12, 2016, 3:50:20 PM8/12/16
to clojure, clojur...@googlegroups.com
ClojureScript, the Clojure compiler that emits JavaScript source code.


Leiningen dependency information:

    [org.clojure/clojurescript "1.9.198"]

This release brings cljs.spec to parity with Clojure
1.9.0-alpha10. This release also includes a large number of
enhancements to the ns form:

* :refer now features macro inference. There is no longer any need
  to supply both :refer and :refer-macros in the same :require, the
  compiler will figure it out.

* clojure.* namespaces will now automatically be aliased to their
  ClojureScript equivalents. For example this means that the following
  is perfectly valid ClojureScript:

  (ns foo.bar
    (:require [clojure.spec :refer [fspec]]))

  This feature and the previous one should significantly reduce reader
  conditional usage in ns forms.

* thanks to Antonio Monteiro we now support :rename

We also have a new feature that is relevant for tooling such as
Figwheel and cljs-devtools - :preloads. This should now be the
standard way to inject some bit of side-effecting setup after core but
before user code (i.e. connecting REPLs to standard ports, etc.).

There are of course many various small fixes and enhancements, so
a very big thank you to everyone that has contributed.

As always feedback welcome!

## 1.9.198

### Enhancements
* CLJS-1508: Extend ns form to support :rename option
* CLJS-1507: Implicit macro loading: macro var inference in :refer
* CLJS-1692: Autoalias clojure.* to exisiting cljs.* namespaces if
possible
* CLJS-1350: Compiler support for browser REPL
* CLJS-1729: Support `use` special function in REPLs
* CLJS-1730: Support `refer-clojure` special function in REPLs

### Changes
* CLJS-1515: Self-host: Allow :file key in cljs.js/*load-fn*
* add toString implementation to Vars
* Use a js array to create collections in cljs.reader
* CLJS-1640: Use the unshaded version of the closure compiler
* add :browser-repl to list of known opts
* add browser REPL preload
* parity with Clojure 1.9.0-alpha10 clojure.spec
* bump to tools.reader 1.0.0-beta3

### Fixes
* CLJS-1733: Macro inference issue for macros & runtime vars with the same name
* CLJS-1735: Self-host: cljs.spec speced-vars instance
* CLJS-1736: cljs.spec.test: checkable-syms* called with 0-arity
* CLJS-1708: Self-host: [iu]nstrument-1 needs to qualify [iu]nstrument-1*
* CLJS-1707: Self-host: with-instrument-disabled needs to qualify *instrument-enabled*
* CLJS-1732: Add docstrings for new use and use-macros REPL specials
* CLJS-1720: Qualify symbols and namespaced keywords in spec macros
* CLJS-1731: Self-host: do_template problem with script/test-self-parity
* CLJS-1556: Invalid code emit for obj literal
* CLJS-1607: bug with `specify!` in JS prototypes with `static-fns` true
* CLJS-1591 avoid analyzing invoke arguments multiple times
* CLJS-1638: :elide-asserts disables atom validators in :advanced
* CLJS-1721: 3-arity get-in fails on types which do not implement ILookup
* CLJS-1728: Update doc for ns for new :rename capability
* CLJS-1727: Regression when evaluating non-sequential forms at the REPL
* CLJS-1490: Watch macro files in cljs.build.api/watch
* CLJS-1719: Port destructuring namespaced keys and symbols
* CLJS-1653: cljs.spec: keys* causes exception
* CLJS-1700: Support clojure.* aliasing when not in vector
* CLJS-1717 remove map from equiv-map
* CLJS-1716: No longer possible to use same alias for :require-macros and :require
* Use keyword options in js->clj 1-arg impl
* Add support for regex in transit for compiler analysis cache
* Escape non-Latin1 characters before base64 encoding the source-map string
* CLJS-1698: cljs.spec: every res call needs &env
* CLJS-1695: Self-host: Port cljs / clojure namespace aliasing
* CLJS-1697: doc on inferred macros fails
* CLJS-1699: Update docstring for ns
* CLJS-1694: Self-host: Port macro var inference in :refer

Jiyin Yiyong

unread,
Aug 12, 2016, 10:53:10 PM8/12/16
to ClojureScript, clo...@googlegroups.com
Got a question, Clojure is using `-alpha` in version name, is ClojureScript also in alpha stage, even without an `-alpha`?

Zubair Quraishi

unread,
Aug 13, 2016, 5:53:56 AM8/13/16
to ClojureScript, clo...@googlegroups.com
I don't know what you did but upgrading from cljs .89 to .198 on a fairly largish app and it seems to run over twice as fast!!!! Welldone, whatever it was that did it!!! :)

yong gou

unread,
Aug 13, 2016, 10:47:31 AM8/13/16
to ClojureScript, clo...@googlegroups.com
sorry my English is poor, but need help, thanks ^_^
after updated to 1.9.189 , I wrote this:
(require '[cljs.spec :as s])
(s/def ::a1 int?)
(s/def ::a2 int?)
(s/def ::all (s/merge (s/keys :opt-un [::a1]) (s/keys :opt-un [::a2])))

I got:
clojure.lang.ExceptionInfo: Wrong number of args (-1) passed to: spec/res at line 1 <cljs repl> {:file "<cljs repl>", :line 1, :column 14, :root-source-info {:source-type :fragment, :source-form (s/def :cljs.user/all (s/merge (s/keys :opt-un [:cljs.user/a1]) (s/keys :opt-un [:cljs.user/a2])))}, :tag :cljs/analysis-error}
at clojure.core$ex_info.invokeStatic(core.clj:4617)
at clojure.core$ex_info.invoke(core.clj:4617)
at cljs.analyzer$error.invokeStatic(analyzer.cljc:620)
at cljs.analyzer$error.invoke(analyzer.cljc:616)
at cljs.analyzer$macroexpand_1.invokeStatic(analyzer.cljc:2688)
at cljs.analyzer$macroexpand_1.invoke(analyzer.cljc:2684)
at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:2718)
at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:2701)
at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:2838)
at cljs.analyzer$analyze_form.invoke(analyzer.cljc:2834)
at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:2885)
at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:2876)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2901)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2896)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2895)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$parse_invoke_STAR_$ana_expr__3134.invoke(analyzer.cljc:2520)
at clojure.core$map$fn__4785.invoke(core.clj:2646)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.PersistentVector.create(PersistentVector.java:73)
at clojure.lang.LazilyPersistentVector.create(LazilyPersistentVector.java:44)
at clojure.core$vec.invokeStatic(core.clj:377)
at clojure.core$vec.invoke(core.clj:367)
at cljs.analyzer$parse_invoke_STAR_.invokeStatic(analyzer.cljc:2522)
at cljs.analyzer$parse_invoke_STAR_.invoke(analyzer.cljc:2493)
at cljs.analyzer$parse_invoke.invokeStatic(analyzer.cljc:2531)
at cljs.analyzer$parse_invoke.invoke(analyzer.cljc:2529)
at cljs.analyzer$analyze_seq_STAR_.invokeStatic(analyzer.cljc:2695)
at cljs.analyzer$analyze_seq_STAR_.invoke(analyzer.cljc:2692)
at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic(analyzer.cljc:2699)
at cljs.analyzer$analyze_seq_STAR__wrap.invoke(analyzer.cljc:2697)
at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:2720)
at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:2701)
at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:2838)
at cljs.analyzer$analyze_form.invoke(analyzer.cljc:2834)
at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:2885)
at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:2876)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2901)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:2721)
at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:2701)
at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:2838)
at cljs.analyzer$analyze_form.invoke(analyzer.cljc:2834)
at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:2885)
at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:2876)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2901)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2896)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2895)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze_let_binding_init.invokeStatic(analyzer.cljc:1496)
at cljs.analyzer$analyze_let_binding_init.invoke(analyzer.cljc:1494)
at cljs.analyzer$analyze_let_bindings_STAR_.invokeStatic(analyzer.cljc:1518)
at cljs.analyzer$analyze_let_bindings_STAR_.invoke(analyzer.cljc:1507)
at cljs.analyzer$analyze_let_bindings.invokeStatic(analyzer.cljc:1549)
at cljs.analyzer$analyze_let_bindings.invoke(analyzer.cljc:1548)
at cljs.analyzer$analyze_let.invokeStatic(analyzer.cljc:1564)
at cljs.analyzer$analyze_let.invoke(analyzer.cljc:1559)
at cljs.analyzer$eval2707$fn__2708.invoke(analyzer.cljc:1585)
at clojure.lang.MultiFn.invoke(MultiFn.java:251)
at cljs.analyzer$analyze_seq_STAR_.invokeStatic(analyzer.cljc:2694)
at cljs.analyzer$analyze_seq_STAR_.invoke(analyzer.cljc:2692)
at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic(analyzer.cljc:2699)
at cljs.analyzer$analyze_seq_STAR__wrap.invoke(analyzer.cljc:2697)
at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:2720)
at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:2701)
at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:2838)
at cljs.analyzer$analyze_form.invoke(analyzer.cljc:2834)
at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:2885)
at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:2876)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2901)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:2721)
at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:2701)
at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:2838)
at cljs.analyzer$analyze_form.invoke(analyzer.cljc:2834)
at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:2885)
at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:2876)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2901)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2896)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2895)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$parse_invoke_STAR_$ana_expr__3134.invoke(analyzer.cljc:2520)
at clojure.core$map$fn__4785.invoke(core.clj:2646)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:521)
at clojure.lang.LazilyPersistentVector.create(LazilyPersistentVector.java:44)
at clojure.core$vec.invokeStatic(core.clj:377)
at clojure.core$vec.invoke(core.clj:367)
at cljs.analyzer$parse_invoke_STAR_.invokeStatic(analyzer.cljc:2522)
at cljs.analyzer$parse_invoke_STAR_.invoke(analyzer.cljc:2493)
at cljs.analyzer$parse_invoke.invokeStatic(analyzer.cljc:2531)
at cljs.analyzer$parse_invoke.invoke(analyzer.cljc:2529)
at cljs.analyzer$analyze_seq_STAR_.invokeStatic(analyzer.cljc:2695)
at cljs.analyzer$analyze_seq_STAR_.invoke(analyzer.cljc:2692)
at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic(analyzer.cljc:2699)
at cljs.analyzer$analyze_seq_STAR__wrap.invoke(analyzer.cljc:2697)
at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:2720)
at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:2701)
at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:2838)
at cljs.analyzer$analyze_form.invoke(analyzer.cljc:2834)
at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:2885)
at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:2876)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2901)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2896)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2895)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$eval2688$fn__2690.invoke(analyzer.cljc:1475)
at clojure.lang.MultiFn.invoke(MultiFn.java:251)
at cljs.analyzer$analyze_seq_STAR_.invokeStatic(analyzer.cljc:2694)
at cljs.analyzer$analyze_seq_STAR_.invoke(analyzer.cljc:2692)
at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic(analyzer.cljc:2699)
at cljs.analyzer$analyze_seq_STAR__wrap.invoke(analyzer.cljc:2697)
at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:2720)
at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:2701)
at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:2838)
at cljs.analyzer$analyze_form.invoke(analyzer.cljc:2834)
at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:2885)
at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:2876)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2901)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2896)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2895)
cljs.user=> at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.analyzer$eval2573$fn__2575.invoke(analyzer.cljc:1121)
at clojure.lang.MultiFn.invoke(MultiFn.java:251)
at cljs.analyzer$analyze_seq_STAR_.invokeStatic(analyzer.cljc:2694)
at cljs.analyzer$analyze_seq_STAR_.invoke(analyzer.cljc:2692)
at cljs.analyzer$analyze_seq_STAR__wrap.invokeStatic(analyzer.cljc:2699)
at cljs.analyzer$analyze_seq_STAR__wrap.invoke(analyzer.cljc:2697)
at cljs.analyzer$analyze_seq.invokeStatic(analyzer.cljc:2720)
at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:2701)
at cljs.analyzer$analyze_form.invokeStatic(analyzer.cljc:2838)
at cljs.analyzer$analyze_form.invoke(analyzer.cljc:2834)
at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:2885)
at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:2876)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:2901)
at cljs.analyzer$analyze.invoke(analyzer.cljc:2888)
at cljs.repl$evaluate_form$fn__7452.invoke(repl.cljc:484)
at cljs.repl$evaluate_form.invokeStatic(repl.cljc:483)
at cljs.repl$evaluate_form.invoke(repl.cljc:440)
at cljs.repl$eval_cljs.invokeStatic(repl.cljc:575)
at cljs.repl$eval_cljs.invoke(repl.cljc:568)
at cljs.repl$repl_STAR_$read_eval_print__7598.invoke(repl.cljc:921)
at cljs.repl$repl_STAR_$fn__7604$fn__7613.invoke(repl.cljc:960)
at cljs.repl$repl_STAR_$fn__7604.invoke(repl.cljc:959)
at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1154)
at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1145)
at cljs.repl$repl_STAR_.invokeStatic(repl.cljc:923)
at cljs.repl$repl_STAR_.invoke(repl.cljc:806)
at cemerick.piggieback$run_cljs_repl.invokeStatic(piggieback.clj:169)
at cemerick.piggieback$run_cljs_repl.invoke(piggieback.clj:155)
at clojure.lang.AFn.applyToHelper(AFn.java:171)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:650)
at clojure.core$apply.invoke(core.clj:641)
at cemerick.piggieback$evaluate.invokeStatic(piggieback.clj:258)
at cemerick.piggieback$evaluate.invoke(piggieback.clj:254)
at clojure.lang.Var.invoke(Var.java:379)
at cemerick.piggieback$wrap_cljs_repl$fn__33010$fn__33012$fn__33013.invoke(piggieback.clj:290)
at cemerick.piggieback$enqueue$fn__32996.invoke(piggieback.clj:246)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__15308.invoke(interruptible_eval.clj:190)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: clojure.lang.ArityException: Wrong number of args (-1) passed to: spec/res
at cljs.analyzer$macroexpand_1_STAR_$fn__3161.invoke(analyzer.cljc:2643)
at cljs.analyzer$macroexpand_1_STAR_.invokeStatic(analyzer.cljc:2640)
at cljs.analyzer$macroexpand_1_STAR_.invoke(analyzer.cljc:2625)
... 173 more


Is this a bug?


在 2016年8月13日星期六 UTC+8上午3:50:20,David Nolen写道:

David Nolen

unread,
Aug 13, 2016, 11:09:12 AM8/13/16
to clojur...@googlegroups.com, clojure
Thanks for the report. This has already been fixed in master and I'll cut another release on Monday which include this and several other fixes.

--
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 clojurescript+unsubscribe@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.

Dušan Maliarik

unread,
Aug 13, 2016, 3:34:17 PM8/13/16
to ClojureScript, clo...@googlegroups.com
Thank you David and everyone involved, this release has a really nice set of additions and fixes. <3
Reply all
Reply to author
Forward
0 new messages