ANN: ClojureScript 0.0-2913, Google Closure Modules, improved nREPL support

687 views
Skip to first unread message

David Nolen

unread,
Feb 21, 2015, 1:01:39 PM2/21/15
to clojure, clojur...@googlegroups.com
ClojureScript, the Clojure compiler that emits JavaScript source code.


New release version: 0.0-2913

Leiningen dependency information:

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

This release comes with two very big enhancements.

The first is support for Google Closure Modules via the :modules build
option. Google Closure Modules permits splitting advanced compiled
builds into optimal smaller pieces for faster page
loads. ClojureScript's Google Closure Module support is fully
:foreign-libs aware. Source mapping for modules is also fully
supported.

The feature is described in more detail here:

The second big change is a fundamental rearchitecting of ClojureScript
REPLs. ClojureScript REPLs now support a set of options similar to
those taken by `clojure.main/repl` with small changes to account for
different JavaScript evaluation environments. Many third party REPLs
like Figwheel, Weasel, and Ambly are either unaffected or have already
accounted for these changes. However current tooling leveraging
Piggieback will likely present an inferior experience as Piggieback was
designed to work around the previous limitations of ClojureScript
REPLs. Now that ClojureScript REPLs are more like the standard Clojure
REPL it should be far simpler to add proper interruptible-eval and
load-file nREPL middleware so that existing tooling around nREPL can
more easily integrate ClojureScript REPLs as first class citizens.

Feedback on both of these enhancements is very welcome!

There are also many smaller fixes around REPL command line behavior,
the Nashorn REPL, :foreign-libs resource finding issues, the full
list follows:

## 0.0-2913
* Support custom :output-to for :cljs-base module

## 0.0-2911

### Enhancements
* CLJS-1042: Google Closure Modules :source-map support
* CLJS-1041: Google Closure Modules :foreign-libs support
* Google Closure Modules support via :modules
* CLJS-1040: Source-mapped script stack frames for the Nashorn repl

### Changes
* CLJS-960: On carriage return REPLs should always show new REPL prompt
* CLJS-941: Warn when a symbol is defined multiple times in a file
* REPLs now support parameterization a la clojure.main/repl
* all REPLs analyze cljs.core before entering loop
* can emit :closure-source-map option for preserving JS->JS map
* REPLs can now merge new REPL/compiler options via -setup

### Fixes
* CLJS-998: Nashorn REPL does not support require special fn
* CLJS-1052: Cannot require ns from within the ns at the REPL for reloading purposes
* CLJS-975: preserve :reload & :reload-all in ns macro sugar
* CLJS-1039: Under Emacs source directory watching triggers spurious recompilation
* CLJS-1046: static vars do not respect user compile time metadata
* CLJS-989: ClojureScript REPL loops on EOF signal
* fix DCE regression for trivial programs
* CLJS-1036: use getResources not findResources in get-upstream-deps*

Boris Kourtoukov

unread,
Feb 21, 2015, 4:16:11 PM2/21/15
to clojur...@googlegroups.com, clo...@googlegroups.com
Closure Module support is an amazing addition, thank you for implementing it. It is something that has always been nagging at me when building multi page/multi ui applications with CLJS.

Shaun LeBron

unread,
Feb 23, 2015, 3:35:36 PM2/23/15
to clojur...@googlegroups.com, clo...@googlegroups.com
I was trying out the Closure Module support. Looks like we need to wait for cljsbuild to support this.

David Nolen

unread,
Feb 23, 2015, 3:40:31 PM2/23/15
to clojur...@googlegroups.com
Closure Module support was developed by testing alongside with cljsbuild. There's nothing to wait for.

Is there some issue that you encountered?

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

Max Gonzih

unread,
Feb 24, 2015, 6:25:02 AM2/24/15
to clojur...@googlegroups.com, clo...@googlegroups.com
Nice! I played a bit with modules support. Good stuff! It is still not very clear for me where should I put my preamble stuff in that case. Will it be stored in cljs-base or in main output file? Can I have per module preamble? (probably per module preamble does not make any sense, right?)

David Nolen

unread,
Feb 24, 2015, 7:37:46 AM2/24/15
to clojur...@googlegroups.com, clojure
:preamble will only be applied to the base module. When using :modules there is not such thing as a main output file.

You cannot currently have a per module :preamble.

David

Shaun LeBron

unread,
Feb 24, 2015, 10:59:47 AM2/24/15
to clojur...@googlegroups.com
I uploaded a project that I failed to get working with :modules. I know I'm missing something; just not seeing it yet:
https://github.com/shaunlebron/cljs-multi-module

David Nolen

unread,
Feb 24, 2015, 11:14:53 AM2/24/15
to clojur...@googlegroups.com
That example project misinterprets how Google Closure Modules is intended to work.

The example.core namespace depends on all three modules but is never itself placed into a module that expresses this dependency.

David

Matthew Chadwick

unread,
Oct 30, 2016, 10:17:50 AM10/30/16
to ClojureScript, clo...@googlegroups.com
On Tuesday, February 24, 2015 at 12:37:46 PM UTC, David Nolen wrote:
> :preamble will only be applied to the base module. When using :modules there is not such thing as a main output file.
>
>
> You cannot currently have a per module :preamble.
>

I recently wanted per-module :preamble when playing with webworkers, in order to add the importScripts(); line -- is there any other way to get that line into a module ?
Reply all
Reply to author
Forward
0 new messages