ANN: ClojureScript 1.9.456, Externs Inference & Comprehensive JS Modules Support

2,975 views
Skip to first unread message

David Nolen

unread,
Jan 27, 2017, 5:30:35 PM1/27/17
to clojure, clojur...@googlegroups.com
ClojureScript, the Clojure compiler that emits JavaScript source code.


Leiningen dependency information:

[org.clojure/clojurescript "1.9.456"]

This is a significant feature release.

The first new feature is externs inference. This should greatly ease
the integration of 3rd party JavaScript libraries incompatible
with Google Closure advanced compilation. By treating the externs
problem as a type-hinting one - we can automatically generate the
required externs for you. This new feature should be considered
of alpha quality and subject to change. Still, feedback is greatly
appreciated to help us better understand how to best deliver this
enhancement.

For details please look at the new guide:

The second new feature is much more comprehensive support for
JavaScript modules. We now have a good story for integrating the
various kinds of JavaScript modules into a ClojureScript project
build without resorting to JavaScript build tools. This feature
even includes the consumption of modules directly from NPM.

There are far too many details to cover in this release announcement
so once again refer to the guide:

Like externs inference this feature is alpha and subject to change.
Again feedback is critical to guiding this enhancement in the
right direction.

I'd like to especially call out Maria Geller's Google Summer of Code work
here around these two major features. This work began almost 2 years 
and it's nice to see the long term planning come together so well.

There are quite a few performancement enhancements in this release
related to compiler startup time as well as numerous fixes from
many members of the community.

Congratulations to everyone involved and happy hacking!

## 1.9.456

### Enhancements
* Enhanced JavaScript module support
* Support Node resolution for CommonJS modules
* Externs inference
* Performance enhancements
* CLJS-1835: REPL load special fn
* CLJS-1194: Support for `data_readers.cljc`

### Changes
* expose :closure-module-roots option
* bump Closure Compiler dep
* Under Node.js don't need require entries in the goog.addDependency calls in cljs_deps.js
* do not throw on circular dependencies between Google Closure JS libs
* str macro should call str/1 function directly, added str benchmark
* CLJS-1718: Foreign lib files should be placed in a relative location
* CLJS-1858: Should allow `:cache-analysis true` and `cache-analysis-format nil`
* CLJS-1616: Self-host: improve documentation for compile-str
* CLJS-1643: Emit more informative error when emitting a type which has no emit multimethod case
* CLJS-1816: Basic timing info in verbose output
* add support for emitting inferred externs file
* add cljs.analyzer/analyze-form-seq
* CLJS-1666: Flag to optionally disable transit analysis cache encoding
* Provide more descriptive error message when invalid libspec detected
* CLJS-1768: cljs.spec perf tweaks
* CLJS-1842: Remove analyzer `:merge` hack for REPLs
* CLJS-1839: Relax the constraint that `new` and dot forms must be passed a symbol
* default to :ecmascript3 if :language-out not specified for :es6 module
* respect :language-out when processing ES6 modules
* default to :ecmascript3 if :language-out not specified for :es6 module
* inline some?

### Fixes
* CLJS-1911: Need to bind Node.js require
* CLJS-1909: Self-host: circular dependency when requiring cljs.reader
* CLJS-1906: Self-host: script/test-self-parity fails
* CLJS-1903: Remove anonymous vars from dir and apropos output
* CLJS-1897: Too many externs generated
* CLJS-1895: Externs inference needs to support user supplied externs
* CLJS-1873: Self-host: Unit tests fail owing to test.check dep
* CLJS-1874: Self-host: :fn-var true for macros
* CLJS-1877: :foreign-libs entries should be allowed to specify directories along with individual files
* CLJS-1890: s/form for s/nilable in cljs.spec does not match clojure.spec
* CLJS-1811: Can't compose cljs.spec.test.instrument (or cljs.spec.test.check) with cljs.spec.test.enumerate-namespace
* CLJS-1894: Unnecessary analysis of core.cljs on first compile
* CLJS-1893: Unnecessary analysis of core.cljs
* CLJS-1892: Dependencies in JARs are analyzed every time even if an analysis cache file exists
* CLJS-1887: add :watch-error-fn option
* CLJS-1883 Foreign libs can't be found on Node.js
* CLJS-1882 Fix constant table sort order when using :modules
* CLJS-1853: var metadata in compiled output
* CLJS-1878: prefer `some?` over `(not (nil? %))` in analyzer
* CLJS-1880: missing ^boolean on some hasNext calls
* CLJS-1875 Difference in seqable? between CLJ & CLJS
* CLJS-1829: get does not return not-found on negative indexes
* cljs.spec.test/unstrument shouldn't return the names of vars that weren't instrumented in the first place. Fixes CLJS-1812
* CLJS-1786: Add knob for controlling printing of namespaced maps
* CLJS-1836: nth doesn't throw for IndexedSeqs
* CLJS-1870: Quoted specs check in require macro symbols
* CLJS-1869: Regression importing goog.Uri
* Fix CLJS-1653 regression
* CLJS-1860: Resolve JS modules referred by their fully-qualified namespace
* CLJS-1861: Use usr/bin/env in build scripts for portability
* CLJS-1857: Fix self-host tests
* CLJS-1855: Subvec should implement IIterable
* CLJS-1856: Self-host: load-deps doesn't delegate to itself
* CLJS-1651: Self-host: Cannot replace core macro-function
* CLJS-1848: Analyzer can't find JS modules during macro-expansion
* CLJS-1851: Only output JS module processing time when `:compiler-stats` is true
* CLJS-1850: *unchecked-if* not declared ^:dynamic warning after commit a732f0
* CLJS-1849: Self-host: regression introduced by CLJS-1794
* CLJS-1844: port over Maria Geller's externs file parsing code
* CLJS-1845: Assoc on subvec should throw if out of bounds
* CLJS-1847: REPL should recognize `clojure.core/load`
* CLJS-1745: refer-clojure doesn't pull in previously excluded vars
* CLJS-1794: incomplete alias created for namespace cljs.spec warning under advanced compilation
* CLJS-1834: REPL regression, require of ns from the ns itself errors out in circular reference
* fix ns aliasing regression for JS namespaces
* CLJS-1837: Port halt-when over from Clojure
* CLJS-1820: "No such namespace" warning when referring to JS module namespace without using alias
* CLJS-1828: Add `:rename` to `require`'s docstring

Francesco Bellomi

unread,
Jan 28, 2017, 7:19:55 AM1/28/17
to ClojureScript, clo...@googlegroups.com
Hi,

first of all, congratulations on this release, it's a huge step ahead.

I'm having an issue compiling a program with advanced optimizations, which worked fine with .293

I get the following exception, any ideas on how can i narrow down the problem within my source?

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V, compiling:(/tmp/form-init5778645093287298904.clj:1:73)
at clojure.lang.Compiler.load(Compiler.java:7442)
at clojure.lang.Compiler.loadFile(Compiler.java:7368)
at clojure.main$load_script.invokeStatic(main.clj:277)
at clojure.main$init_opt.invokeStatic(main.clj:279)
at clojure.main$init_opt.invoke(main.clj:279)
at clojure.main$initialize.invokeStatic(main.clj:310)
at clojure.main$null_opt.invokeStatic(main.clj:344)
at clojure.main$null_opt.invoke(main.clj:341)
at clojure.main$main.invokeStatic(main.clj:423)
at clojure.main$main.doInvoke(main.clj:386)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
at com.google.javascript.rhino.IR.name(IR.java:363)
at com.google.javascript.jscomp.ClosureCodingConvention.<clinit>(ClosureCodingConvention.java:474)
at com.google.javascript.jscomp.Compiler.<init>(Compiler.java:202)
at com.google.javascript.jscomp.Compiler.<init>(Compiler.java:264)
at cljs.closure$make_closure_compiler.invokeStatic(closure.clj:293)
at cljs.closure$optimize.invokeStatic(closure.clj:1255)
at cljs.closure$optimize.doInvoke(closure.clj:1251)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invokeStatic(core.clj:659)
at cljs.closure$build.invokeStatic(closure.clj:2113)
at cljs.build.api$build.invokeStatic(api.clj:205)
at cljs.build.api$build.invoke(api.clj:193)
at cljs.build.api$build.invokeStatic(api.clj:196)
at cljsbuild.compiler$compile_cljs$fn__6997.invoke(compiler.clj:59)
at cljsbuild.compiler$compile_cljs.invokeStatic(compiler.clj:59)
at cljsbuild.compiler$run_compiler.invokeStatic(compiler.clj:167)
at user$eval7152$iter__7200__7204$fn__7205$fn__7231.invoke(form-init5778645093287298904.clj:1)
at user$eval7152$iter__7200__7204$fn__7205.invoke(form-init5778645093287298904.clj:1)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:525)
at clojure.core$seq__6422.invokeStatic(core.clj:137)
at clojure.core$dorun.invokeStatic(core.clj:3106)
at clojure.core$doall.invokeStatic(core.clj:3121)
at user$eval7152.invokeStatic(form-init5778645093287298904.clj:1)
at user$eval7152.invoke(form-init5778645093287298904.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6978)
at clojure.lang.Compiler.eval(Compiler.java:6968)
at clojure.lang.Compiler.load(Compiler.java:7430)
... 12 more

thanks in advance

Francesco

David Nolen

unread,
Jan 28, 2017, 9:42:02 AM1/28/17
to clojur...@googlegroups.com, clo...@googlegroups.com
Looks like you have a dependency issue. Use `lein deps :tree` or the equivalent command to sort it out.

HTH
David
--
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 https://groups.google.com/group/clojurescript.

Francesco Bellomi

unread,
Jan 28, 2017, 3:01:09 PM1/28/17
to ClojureScript, clo...@googlegroups.com
Found, thanks!

Francesco

Varga Radu

unread,
Mar 7, 2017, 7:15:30 AM3/7/17
to Clojure, clojur...@googlegroups.com
Also solved my problem by adding [com.google.guava/guava "21.0"] to my project.clj

On Thursday, 2 March 2017 13:45:29 UTC+1, Dirk Bergmann wrote:
Had the same issue. Fixed it by upgrading guava dependency to [com.google.guava/guava "21.0"]

On Sunday, January 29, 2017 at 3:01:16 AM UTC+7, Francesco Bellomi wrote:
Found, thanks!

Francesco
Reply all
Reply to author
Forward
0 new messages