ANN: ClojureScript 0.0-1877 (Breaking change)

516 views
Skip to first unread message

David Nolen

unread,
Sep 8, 2013, 7:42:51 PM9/8/13
to clojure, clojur...@googlegroups.com
ClojureScript, the Clojure compiler that emits JavaScript source code.

README and source code: https://github.com/clojure/clojurescript

New release version: 0.0-1877

Leiningen dependency information:

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

Breaking Changes: 
* Keywords are no longer represented as JavaScript Strings

Enhancements: 
* Only analyze files that need re-analysis, significant speedup for incremental compilation
* Leiningen project.clj provided

Fixes:
CLJS-582: duplicate items in sets
* CLJS-585: ChunkedCons does not implement INext
* ClojureScript clojure.string/split same behavior as Clojure
* CLJS-565: Allow the clojurescript reader to read "%"
* CLJS-580: def + fn bug when fn in a data literal
* CLJS-509: spurious protocol warning under incremental compilation

Julien Eluard

unread,
Sep 9, 2013, 9:18:06 AM9/9/13
to clojur...@googlegroups.com, clojure
Hi David,

that is really nice! Speedup during incremental build is definitively the one thing that would improve my ClojureScript dev workflow.

I gave this build a try with lein-cljsbuild and got some unexpected WARNINGS.

What I am doing:
* lein cljsbuild once => everything is fine
* change some cljs file
* lein cljsbuild once
=> tons of WARNINGS, all variations of "WARNING: Use of undeclared Var clojure.string/reduce at line 16 file:/Users/../clojurescript-0.0-1877.jar!/clojure/string.cljs"

It looks like unchanged cljs files also generate those warnings (but I am not quite sure what the incremental compilation does exactly).

Interestingly resulting js file seems correct.

Let me know if I should open a JIRA/create a simple reproducing example.

Thanks for the awesome work on ClojureScript,
Julien

albert cortez

unread,
Sep 9, 2013, 9:53:59 AM9/9/13
to clojur...@googlegroups.com, clojure
I'm getting the same long list of warnings as Julien

Tim Visher

unread,
Sep 9, 2013, 9:58:51 AM9/9/13
to clojur...@googlegroups.com, clojure
On Sun, Sep 8, 2013 at 7:42 PM, David Nolen <dnolen...@gmail.com> wrote:
> ClojureScript, the Clojure compiler that emits JavaScript source code.
>
> README and source code: https://github.com/clojure/clojurescript
>
> New release version: 0.0-1877
>
> Leiningen dependency information:
>
> [org.clojure/clojurescript "0.0-1877"]

Which repo was this published to?

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail

Julien Eluard

unread,
Sep 9, 2013, 10:05:41 AM9/9/13
to clojur...@googlegroups.com
In https://oss.sonatype.org/content/groups/public/ so if you are using leiningen you will need to add ":repositories  {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"}" to your project.clj.

Julien


2013/9/9 Tim Visher <tim.v...@gmail.com>

--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/qnRQdmu5yT8/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Sean Grove

unread,
Sep 9, 2013, 10:46:58 AM9/9/13
to clojure, clojur...@googlegroups.com
Also, a warning about breaking change with the strings no longer being keywords:

Previously in ClojureScript, strings could be invoked to look themselves up as keys inside maps, just like keywords. So both (:a {:a 10 "b" 20}) and ("b" {:a 10 "b" 20}) would work (the latter will not work in vanilla Clojure). We had a few places where we (Zenbox) were doing this without realizing it (think (defn my-fn [k] (k @profiles)) and k ends up being a string).

This worked because previously ClojureScript modified the String.prototype to add a .call and a .apply method. Many of you will have run into problems with JS interop where this broke other libraries' type-checking (see https://groups.google.com/forum/#!topic/clojure/NPWnikR8tro for an example if not).

If you want to upgrade and run into problems with the unmodified String.prototype, of course the best thing to do would be to write some tests and fix the problems. If that's not possible, a (very) temporary workaround is to use the old code here: https://github.com/clojure/clojurescript/blob/a113b08a8c2811b0590cc6a36b2e9e5adc1c4c1e/src/cljs/cljs/core.cljs#L2060-L2074

Hope this might save some confusing late night debugging sessions.

Best,
Sean


On Mon, Sep 9, 2013 at 7:15 AM, David Nolen <dnolen...@gmail.com> wrote:
Are you trying that with an existing project that may have a stale target directory lying around? If you can reproduce this issue after a `lein cljsbuild clean` then yes please open a ticket with a minimal project that exhibits the issue.

Thanks!
David


--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com

Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com

Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

David Nolen

unread,
Sep 9, 2013, 11:30:35 AM9/9/13
to clojur...@googlegroups.com
On Mon, Sep 9, 2013 at 10:46 AM, Sean Grove <se...@cloudfuji.com> wrote:
Previously in ClojureScript, strings could be invoked to look themselves up as keys inside maps, just like keywords. So both (:a {:a 10 "b" 20}) and ("b" {:a 10 "b" 20}) would work (the latter will not work in vanilla Clojure). We had a few places where we (Zenbox) were doing this without realizing it (think (defn my-fn [k] (k @profiles)) and k ends up being a string).

Thanks for feedback but we're not going to emit warnings about unspecified behavior. This case is little different from:

(- (js/Date.) (js/Date.))

which will work but there are no promises about this behavior nor at which point in the future it may become a warning/error.

David 

da...@dsargeant.com

unread,
Sep 9, 2013, 12:04:13 PM9/9/13
to clojur...@googlegroups.com, clojure
A large percentage of tests for my core.async based library are failing. Any thoughts?

David Nolen

unread,
Sep 9, 2013, 12:13:05 PM9/9/13
to clojur...@googlegroups.com, clojure
Can't have thoughts without a lot more details :) Specific errors, warnings, and a minimal case is always ideal.

David


On Mon, Sep 9, 2013 at 12:04 PM, <da...@dsargeant.com> wrote:
A large percentage of tests for my core.async based library are failing.  Any thoughts?

--

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.

David Nolen

unread,
Sep 9, 2013, 12:15:22 PM9/9/13
to clojur...@googlegroups.com
It should be landing in Maven central eventually, takes up to 24 hours I think?

David


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.

David Nolen

unread,
Sep 9, 2013, 12:24:06 PM9/9/13
to clojur...@googlegroups.com
I tried building core.async with 1877, looks like core.async will need some tweaking, it relies on the old behavior that keywords would be guaranteed to be identical?

David

David Sargeant

unread,
Sep 9, 2013, 12:56:02 PM9/9/13
to clojur...@googlegroups.com
Thanks for looking into that David.
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/qnRQdmu5yT8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.

Julien Eluard

unread,
Sep 9, 2013, 3:35:16 PM9/9/13
to clojur...@googlegroups.com
I can reproduce my issue after a 'lein cljsbuild clean'. I opened a JIRA ticket (http://dev.clojure.org/jira/browse/CLJS-586) about this with a simple project generating those warnings.

Thanks,
Julien

David Nolen

unread,
Sep 9, 2013, 3:49:08 PM9/9/13
to clojur...@googlegroups.com
Excellent, thanks!

Brandon Bloom

unread,
Sep 9, 2013, 9:50:34 PM9/9/13
to clo...@googlegroups.com, clojur...@googlegroups.com
> a (very) temporary workaround is to use the old code 

Why not just switch (k coll) to (get coll k) ?

If you know that coll is non-nil, you can also just use (coll k). Both forms also accept an optional not-found value.

David Nolen

unread,
Sep 11, 2013, 11:09:29 PM9/11/13
to clojur...@googlegroups.com, clojure
1878 went out today, the only change was fixing a bug introduced by 1877 that caused spurious warnings when incrementally compiling.


--
Note that posts from new members are moderated - please be patient with your first post.
---

Monte Johnston

unread,
Sep 19, 2013, 4:49:59 PM9/19/13
to clojur...@googlegroups.com, clojure
I am using 1889. Since the update, my keywords are getting printed as #<[object Object]> How do I print a keyword now?

David Nolen

unread,
Sep 19, 2013, 5:19:04 PM9/19/13
to clojur...@googlegroups.com
How are you trying to print keywords? They implement IPrintWithWriter as well as toString. Do you have an example that doesn't work?

Monte Johnston

unread,
Sep 19, 2013, 5:23:01 PM9/19/13
to clojur...@googlegroups.com
When this code:

      (.log js/console (str {:one "one"}))

Prints this:

{#<[object Object]> "one"} 


You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/qnRQdmu5yT8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.

David Nolen

unread,
Sep 19, 2013, 5:34:10 PM9/19/13
to clojur...@googlegroups.com
Did you run a `lein cljsbuild clean` before trying this? If you change ClojureScript versions you're bound to have stale code lying around. I just tried this with 1889 and it worked. 

Monte Johnston

unread,
Sep 19, 2013, 6:19:49 PM9/19/13
to clojur...@googlegroups.com
That is the second time that I have forgotten that. Maybe a note in the wiki would be a reminder.
Thanks for the help.

On Sep 19, 2013, at 5:34 PM, David Nolen <dnolen...@gmail.com> wrote:

lein cljsbuild clean

Marco Munizaga

unread,
Sep 19, 2013, 10:54:29 PM9/19/13
to clojur...@googlegroups.com, clojure
This release seemed to introduce a subtle bug with (clj->js ...) in advanced compilation. Here is the demo project (https://github.com/MarcoPolo/test-cljs). If you run (lein cljsbuild clean && lein cljsbuild auto) and use lein trampoline repl-listen (just for the webserver), the first compilation results in the expected (cljs->js {:command "function"}) to {command:"function"}, but subsequent compilations (after adding or deleting a line in core.cljs) causes (cljs->js {:command "function"}) to return {command:null}. This doesn't seem to happen in r1859.

David Nolen

unread,
Sep 20, 2013, 1:46:10 AM9/20/13
to clojur...@googlegroups.com
Please open a ticket in JIRA with a minimal example/project. I suspect the issue is due to the fact that the keyword change doesn't really work that well with incremental compilation.

Thanks!
David


Ruslan Prokopchuk

unread,
Sep 26, 2013, 3:20:38 AM9/26/13
to clojur...@googlegroups.com, clojure
I can't get core.async working with 0.0-1877+: nothing is executed in go block without any warnings and errors. When I use 0.0-1859 everything goes fine. (I've surely done lein cljsbuild clean)

David Nolen

unread,
Sep 26, 2013, 4:32:03 PM9/26/13
to clojur...@googlegroups.com
core.async and ClojureScript are out of sync, you need to wait for the next core.async release.


On Thu, Sep 26, 2013 at 3:20 AM, Ruslan Prokopchuk <fer....@gmail.com> wrote:
I can't get core.async working with 0.0-1877+: nothing is executed in go block without any warnings and errors. When I use 0.0-1859 everything goes fine. (I've surely done lein cljsbuild clean)

Marco Munizaga

unread,
Sep 26, 2013, 5:13:51 PM9/26/13
to clojur...@googlegroups.com
A temporary workaround:

Clone the core.async to a convenient location. cd into the repo and run lein install.
Then add [core.async "0.1.0-SNAPSHOT"] as your dependency.

That's exactly what David did for his async-tests repo.

Mimmo Cosenza

unread,
Sep 26, 2013, 5:37:32 PM9/26/13
to clojur...@googlegroups.com
You can eventually add to your dependencies the following repo which I just published on clojars.

[org.clojars.magomimmo/core.async "0.1.0-SNAPSHOT]

The only updates regard cljsbuild 0.3.3, the :min-lein-version "2.2.0", the :url and the group-id to adhere to the clojars naming convention when you deploy a someone else's repo.

Mimmo

Ruslan Prokopchuk

unread,
Sep 27, 2013, 7:55:09 AM9/27/13
to clojur...@googlegroups.com
Thanks a lot, now it works and I experience double joy using core.async in my new project with speeded up incremental build!

Tom Hall

unread,
Oct 7, 2013, 6:52:31 AM10/7/13
to clojur...@googlegroups.com
In general what is the best way to get a working recent version of
core.async and cljs?

Brandon Adams

unread,
Oct 7, 2013, 7:42:39 AM10/7/13
to clojur...@googlegroups.com

This pair is passing my codebase's unit and integration tests.

[org.clojure/clojurescript "0.0-1909"]
[org.clojure/core.async "0.1.242.0-44b1e3-alpha"]

Reply all
Reply to author
Forward
0 new messages