<< Back to previous view

[CLJS-1213] cljs.analyzer incorrectly marks all defs as tests when eliding test metadata Created: 20/Apr/15  Updated: 20/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Minor
Reporter: Stephen Nelson Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L861

Cond threading will unconditionally assoc :test true when eliding test metadata for a namespace def.

This prevents accurate detection of test vars in cljs macros.






[CLJS-1212] Error in set ctor for > 8-entry map literal Created: 18/Apr/15  Updated: 18/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   
orion:Desktop mfikes$ java -jar cljs.jar -m cljs.repl.nashorn
To quit, type: :cljs/quit
cljs.user=> *clojurescript-version*
"0.0-3208"
cljs.user=> (set {:a 0 :b 0 :c 0 :d 0 :e 0 :f 0 :g 0 :h 0})             
#{[:a 0] [:b 0] [:c 0] [:d 0] [:e 0] [:f 0] [:g 0] [:h 0]}
cljs.user=> (set {:a 0 :b 0 :c 0 :d 0 :e 0 :f 0 :g 0 :h 0 :i 0})
TypeError: Cannot call undefined
	 cljs$core$set (.cljs_nashorn_repl/cljs/core.cljs:7912:11)
	 (NO_SOURCE_FILE <eval>:1:0)
	 (NO_SOURCE_FILE <eval>:1:0)
	 (NO_SOURCE_FILE <eval>:1:0)

This doesn't appear to be a recent regression (it is reproducible for versions from several months ago).



 Comments   
Comment by David Nolen [ 18/Apr/15 9:51 AM ]

It appears NodeSeq does not implement INext. We should probably have a fast path for INext implementors and something simpler for everyone else.





[CLJS-1211] Automatically requiring :main namespace under :none fails in IE9 Created: 17/Apr/15  Updated: 17/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058, 0.0-3115, 0.0-3196, 0.0-3117, 0.0-3119, 0.0-3123, 0.0-3126
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Immo Heikkinen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Internet Explorer 9



 Description   

Automatic goog/base.js inclusion using :none & :main doesn't work in Internet Explorer 9. The following error message is printed to the console:

ClojureScript could not load :main, did you forget to specify :asset-path?

There seems to be a timing issue after writing script tags to the HTML document. Inline JavaScript for requiring the main namespace gets executed while goog is still undefined.

I played a bit with this but couldn't get it working in IE9. I tried moving the require statement to a separate JS file and adding a script tag to load that file, then goog was no longer undefined but I still got an error message:

SCRIPT5022: Undefined nameToPath for goog.string
base.js, line 753 character 9

The feature seems to work fine in other browsers (also IE10). Probably not worth fixing but at least the limitation is documented now in case someone else wonders the why it doesn't work in IE9.






[CLJS-1210] Javascript built-in arguments replaces nil arguments locally defined by let Created: 16/Apr/15  Updated: 17/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Darrick Wiebe Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

NodeJs 0.12.2 on OSX. Using lein cljsbuild project generated with mies template



 Description   

I encountered this using cljs.tools.cli/parse-opts which returns a map that may contain an arguments key. It is easy to work around by avoiding destructuring, but could lead to some very confusing bugs.

(deftest arguments-error
  (let [{:keys [arguments]} {}
        arguments (or arguments [])]
    (is (= [] arguments))))





[CLJS-1209] Reduce produces additional final nil when used w/ eduction Created: 16/Apr/15  Updated: 16/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Karsten Schmidt Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: transducers


 Description   
Unable to find source-code formatter for language: clojure. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
(defn my-conj
  [acc x]
  (prn acc x)
  (conj acc x))

(reduce my-conj [] (eduction (map identity) [1 2 3]))
;; [] 1
;; [1] 2
;; [1 2] 3
;; [1 2 3] nil
;; [1 2 3 nil]

This seems to be a CLJS specific issue - the above works fine in CLJ1.7.0-beta1. On the other hand, reductions too doesn't suffer this behavior (in CLJS):

Unable to find source-code formatter for language: clojure. Available languages are: javascript, sql, xhtml, actionscript, none, html, xml, java
(reductions my-conj [] (eduction (map identity) [1 2 3]))
;; [] 1
;; [1] 2
;; [1 2] 3
;; ([] [1] [1 2] [1 2 3])





[CLJS-1208] local deps.cljs should take precedence over upstream libs when containing the same :provides Created: 15/Apr/15  Updated: 16/Apr/15  Resolved: 16/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Minor
Reporter: Kevin Webster Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None

Attachments: Text File rabidpraxis-reversed-deps.patch    
Patch: Code

 Description   

Creating a deps.cljs in attempt to override :foreign-libs from an upstream dependency (ex. cljsjs) does not work when the :provides are the same.

https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj#L1251

It looks as though getResources returns a sequence of deps.cljs where the upstream versions are ordered at the end of the seq. Because of this, when this gets built into the index, the upstream version always takes precedence.

Reversing the sequence seems to fix the problem.



 Comments   
Comment by David Nolen [ 16/Apr/15 1:53 PM ]

This is not how overriding works, overriding is done by supplying overrides via compiler options.





[CLJS-1207] Emit a warning if multiple resources found for a ClojureScript namespace Created: 15/Apr/15  Updated: 15/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

We should emit a simple warning if a namespace doesn't not appear to be unique on the classpath.






[CLJS-1206] Images in HTML don't show up when served from localhost:9000 Created: 15/Apr/15  Updated: 15/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: J David Eisenberg Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: brepl, bug
Environment:

Fedora core 21, java version "1.8.0_40" Java(TM) SE Runtime Environment (build 1.8.0_40-b26) Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)


Attachments: Text File cljs_1206.patch     File imgtest_files.tgz    
Patch: Code

 Description   

In a project built from latest version of mies (from github), put an img element in the index.html page. When running scripts/brepl and loading http://localhost:9000, the image does not appear and the console gives a 404 error (see screenshot in attached tarball). The image shows up fine when loading the index.html as a plain file:/// in the browser, so the image definitely does exist in the correct directory.

I think the problem is in file src/clj/cljs/repl/browser.clj, the code starting server/dispatch-on; it lacks options for paths ending in .jpg and .png

I've included a diff -u file in the tarball as well with a possible patch. The patch also adds .svg as a valid type of file to serve, which was the particular thing I needed when I first saw this problem.



 Comments   
Comment by David Nolen [ 15/Apr/15 8:47 AM ]

Please attach patches directly, thanks!

Comment by J David Eisenberg [ 15/Apr/15 10:12 AM ]

Not sure what the format for a patch is, nor where it should be attached. (Add another attachment with the diff file?) Also, I think I see why the image doesn't appear -somewhere in the input or output process, the binary data is being converted to UTF-8.

Comment by Francis Avila [ 15/Apr/15 10:47 AM ]

Patch instructions. Add patch file as independent attachment to this ticket.

Before your code can be accepted you must sign a contributor's agreement.

Comment by J David Eisenberg [ 15/Apr/15 7:04 PM ]

Patch that allows server to correctly serve PNG, JPG, and SVG files. Patch uses maps to store data about MIME types and encoding, so other file extensions and types can be added easily if necessary.





[CLJS-1205] Support conditional reading in REPLs Created: 14/Apr/15  Updated: 14/Apr/15  Resolved: 14/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

Same as CLJ-1700



 Comments   
Comment by David Nolen [ 14/Apr/15 6:33 PM ]

fixed https://github.com/clojure/clojurescript/commit/78c882f1f61023c0b0a75b87bd8e8bcb7058ed04





[CLJS-1204] cljs.closure/watch cannot take cljs.closure/Compilable Created: 14/Apr/15  Updated: 14/Apr/15  Resolved: 14/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

Blocker for exporting an official cljs.build.api/watch.



 Comments   
Comment by David Nolen [ 14/Apr/15 6:10 PM ]

fixed https://github.com/clojure/clojurescript/commit/e8a4ad9db140ba47179850b32e9b757c9193d3f8





[CLJS-1203] official way to supply multiple files/directories to cljs.closure/build and cljs.closure/watch Created: 14/Apr/15  Updated: 14/Apr/15  Resolved: 14/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 14/Apr/15 9:02 AM ]

https://github.com/clojure/clojurescript/commit/5353489fe3beda9a6e9d044e89da3bd0d2accce7





[CLJS-1202] load-file is not additive, unmaps the namespace Created: 14/Apr/15  Updated: 14/Apr/15  Resolved: 14/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 14/Apr/15 7:23 AM ]

fixed https://github.com/clojure/clojurescript/commit/53780c6e0aaf68e8c687ebb666cf2d4092ba136f





[CLJS-1201] compare-indexed: improper handling of empty indexed collections Created: 14/Apr/15  Updated: 14/Apr/15  Resolved: 14/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Nikita Prokopov Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File cljs-1201-empty-vectors-throw-on-compare.patch    

 Description   
(compare (into [] '()) [])
(compare (vec #js[]) [])
(compare (with-meta [] {}) [])
(compare (pop [1]) [])
(compare (subvec [1] 0 0) (subvec [1] 0 0))

all throw #<Error: No item 0 in vector of length 0>

(compare [] []) only passes because they're considered identical?
(-compare [] []) throws too



 Comments   
Comment by David Nolen [ 14/Apr/15 7:18 AM ]

This is a dupe of CLJS-1200. Prefer a patch that simply covers all cases not individual problems.

Comment by Nikita Prokopov [ 14/Apr/15 7:33 AM ]

No, it is not a dupe. CLJS-1200 is a conceptual thing: should compare compare objects of different types? It’s a language-level decision. E.g. Clojure’s compare does not. We can discuss it for months.

This one is an actual bug in compare-indexed. A zero-index access inside empty collection. Missed codepath, real exception.

Please fix this one as it affects our production code.

Comment by David Nolen [ 14/Apr/15 7:55 AM ]

Nikita, accurate ticket titles help when assessing the intent of patches. I understand the issue now.

Comment by David Nolen [ 14/Apr/15 7:59 AM ]

fixed https://github.com/clojure/clojurescript/commit/c7082b4149096b9a6f3fd937d69c27b259c0340a

Comment by Nikita Prokopov [ 14/Apr/15 8:00 AM ]

Oh, you probably thought that I’m comparing PersistentVector to Subvec. Sorry, didn’t want to confuse you





[CLJS-1200] compare behaves differently from Clojure Created: 13/Apr/15  Updated: 13/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: newbie


 Description   
(compare [:foo 1] [:foo "one"])

Fails, also array-map & hash-map apparently cannot compare.






[CLJS-1199] array-map can reuse skipped elements of IndexedSeq Created: 13/Apr/15  Updated: 13/Apr/15  Resolved: 13/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: Nikita Prokopov Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File cljs-1199.patch    

 Description   
(let [x (drop 1 [0 :a 1 :b 2])]
  (apply array-map x))

Expected:

{:a 1, :b 2}

Got:

{0 :a, 1 :b, 2 nil}

Broken by this commit: https://github.com/clojure/clojurescript/commit/815dde62ef06e591444d5deec8f2425890f57a1f

(defn array-map
  "keyval => key val
  Returns a new array map with supplied mappings."
  [& keyvals]
  (let [arr (if (instance? IndexedSeq keyvals)
              (.-arr keyvals)
              (into-array keyvals))]
    (.fromArray cljs.core/PersistentArrayMap arr true false)))

This code should also check for (zero? (.-i keyvals))



 Comments   
Comment by David Nolen [ 13/Apr/15 8:37 AM ]

fixed https://github.com/clojure/clojurescript/commit/0c0602ac25a4092e0d3fbc53b5a7ff0479307307





[CLJS-1198] cljs.test may report summary before all async tests complete Created: 12/Apr/15  Updated: 19/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Jenan Wise Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None

Attachments: File cljs-1198-1    

 Description   

cljs.test may report summary before all async tests complete.

E.g, if you have an async test that looks like this:

(deftest a-test
  (async done
         (testing "a slow async test"
           (go
             (<! (timeout 1000))
             (is (= 0 1))
             (done)))))

then the report output may look like this:

Ran 1 tests containing 0 assertions.
0 failures, 0 errors.

<1 second elapses>

FAIL in () (cljs_test_with_slow_async_example/core_test.js:201:49)
expected: (= 0 1)
  actual: (not (= 0 1))

Minimal repo: https://github.com/jenanwise/cljs-test-with-slow-async-example



 Comments   
Comment by Leon Grapenthin [ 15/Apr/15 12:28 PM ]

I am quite surre that the problem has been introduced with this commit: https://github.com/clojure/clojurescript/commit/9bf486b22cebf5aba4154d07f3ad52e990ddc305

@David
I don't understand the intent of the commit message "cljs.test needs to default to sync, remove broken validation"

Why should the execution strategy default to :sync?

From my reading of the commit this would imply that, unless one provides map fixtures, tests are executed without support for async testing.

This is what happens. The problem goes away if I one adds e. g.

(use-fixtures :each {:before (fn [_])
:after (fn [_])})

I don't see why you removed the guard around async tests in the :sync execution. Its purpose was to throw when execution strategy is :sync an and async test is encountered.

If you can help with the intent of your commit, I'd be glad to provide the fix for myself. What validation was broken?

Comment by David Nolen [ 15/Apr/15 1:41 PM ]

Leon, when I changed how top-level fn emission worked for cross module code motion even though I could see good code getting generated I couldn't run the tests because of the validation bit. After poking around I couldn't make heads or tails of the invariant the code was trying to maintain and so I removed it. All the tests started working again.

Happy to see the invariants re-introduced if the code more clearly documents intent so I can understand it

Comment by Leon Grapenthin [ 15/Apr/15 2:26 PM ]

Can you specify on what you mean by the invariant?

Comment by David Nolen [ 15/Apr/15 2:28 PM ]

Leon, I have no idea what the check was doing nor why it was done that way, only that it prevented me from successfully running more important tests. So you will have to explain the approach to me

Comment by Leon Grapenthin [ 16/Apr/15 2:51 PM ]

Here I try to give you a quick overview of what is going on in the code you have removed/altered:

It solved the problem brought up in our discussion regarding the CLJS-988: The style in which clojure.test requires fixtures to be written didn't allow one to determine when an async test is over. Hence you came up with this requirement: http://dev.clojure.org/jira/browse/CLJS-988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#issue-tabs

This is the way I have chosen to implement it:

In test-vars-block we create a block that looks up fixtures in the current env and decides whether to support async testing via execution-strategy.

In any case except for wrapped fixtures we run with support for async testing by executing the provided test functions in a block so that they can return async tests which are then picked up by the block runner. Also, via test-var-block additional code is wrapped around and added after them for reporting purposes.

In the case where wrapped fixtures are provided, we can't just create a test-var-block in the same fashion because flow control is passed to the wrapping fixtures and they don't execute or return a block. The only way work around this is to provide them directly with a function that invokes a nested block runner. Implicitly reusing test-var-block here was a decision made for obvious DRY reasons.

Now if async tests are used in the test function, the nested block runner could return before testing is finished, continuing testing too early. This is why the execution strategy is called sync: It expects the nested block runners to finish synchronously.

Per your requirment, testing should be aborted if an async test is encountered in the latter case. We can only know whether a test is async once it has been called and returned something. I didn't see a way to find out what was returned in the :sync result-expr directly, since test-var doesn't return what the test has returned. Hence I picked to look at what the test has returned in the test-var-block and throw if an async test is returned and async tests are disabled, storing this condition in the test-env. Today I see a strong alternative to that: Directly wrap the :test fn in the var in the :sync result-expr to throw if it returns an async test. It surely seems cleaner. You'd get a true invariant because the test-env would be out of the game. Notice though that anyhting thrown there will be catched by the reporting exception handler in test-var-block and testing would continue, so it has to rethrow to truely abort testing. Directly looking up the test-env in the async macro would have been another alternative which I have discarded for its dirtiness because it requires users to invoke async during testing to work.

I hope this helped you to understand the code. To make the code more understandable one could rename execution-strategy to async-supported? and return a boolean.

In any case, the :async execution-strategy needs to be the default, otherwise returned async test objects are not expanded into the root block and this CLJS-1198 happens.

I can provide a patch with the aforementioned improvements on sunday if you like. Finally I have no idea why the check prevented your tests from running - Can you tell me which tests I can use to potentially reproduce the problem?

Comment by Leon Grapenthin [ 19/Apr/15 8:32 AM ]

Patch notes:

  • changes default execution-strategy back to :async
  • prevents async tests from running when execution-strategy is sync

@David: I had to dissect test-var-block a bit because apparently alter-meta! is broken for vars. Please see commented lines 549 and 552 - Also I couldn't check whether this resolves the issue you had with tests being prevented from running after the compiler changes.





[CLJS-1197] load-file does not reload associated macro namespace Created: 12/Apr/15  Updated: 12/Apr/15  Resolved: 12/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

In the case of a ns with a accompanying macros ns of the same name we should reload the macro namespace when using load-file.



 Comments   
Comment by David Nolen [ 12/Apr/15 5:51 PM ]

fixed https://github.com/clojure/clojurescript/commit/3cf142cdfe83b7ce59fcbbe5e0e721f3176123df





[CLJS-1196] Assert failed on 3190+ while :require-ing .js file in :libs directory Created: 12/Apr/15  Updated: 12/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: Michal Till Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

OSX, jre 1.8.0_05-b13, Clojure 1.7.0-beta1



 Description   

While :require-ing a GC-compatible .js file that is in one of the :libs directories I get a failed assertion. I tried to hunt it down but wasn't successful.

My setup is:

  • :libs ["libs"] in project.clj
  • test.js in libs/test.js with a proper declaration goog.provide("app.test") at the first line
  • [app.test :as test] in one of the app ns header

This happens specifically from 0.0-3190 and newer, it does NOT happen in 0.0-3178.

Exception in thread "main" java.lang.AssertionError: Assert failed: (or (file? x) (url? x) (string? x)), compiling/private/var/folders/ym/l2qxd7l97kzfzftrdpqsclm40000gn/T/form-init5482203094887638175.clj:1:125)
at clojure.lang.Compiler.load(Compiler.java:7249)
at clojure.lang.Compiler.loadFile(Compiler.java:7175)
at clojure.main$load_script.invoke(main.clj:275)
at clojure.main$init_opt.invoke(main.clj:280)
at clojure.main$initialize.invoke(main.clj:308)
at clojure.main$null_opt.invoke(main.clj:343)
at clojure.main$main.doInvoke(main.clj:421)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.AssertionError: Assert failed: (or (file? x) (url? x) (string? x))
at cljs.util$ext.invoke(util.clj:114)
at cljs.closure$source_on_disk.invoke(closure.clj:1172)
at cljs.closure$output_unoptimized$fn__3624.invoke(closure.clj:1201)
at clojure.core$map$fn__4532.invoke(core.clj:2622)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:507)
at clojure.core$seq__4107.invoke(core.clj:135)
at clojure.core$filter$fn__4559.invoke(core.clj:2677)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:507)
at clojure.core$seq__4107.invoke(core.clj:135)
at clojure.core$map$fn__4532.invoke(core.clj:2614)
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.RT.next(RT.java:674)
at clojure.core$next__4091.invoke(core.clj:64)
at clojure.core$str$fn__4167.invoke(core.clj:528)
at clojure.core$str.doInvoke(core.clj:526)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:628)
at cljs.closure$deps_file.invoke(closure.clj:1015)
at cljs.closure$output_deps_file.invoke(closure.clj:1035)
at cljs.closure$output_unoptimized.doInvoke(closure.clj:1215)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:630)
at cljs.closure$build.invoke(closure.clj:1480)
at cljs.closure$build.invoke(closure.clj:1392)
at cljsbuild.compiler$compile_cljs$fn__3791.invoke(compiler.clj:81)
at cljsbuild.compiler$compile_cljs.invoke(compiler.clj:80)
at cljsbuild.compiler$run_compiler.invoke(compiler.clj:180)
at user$eval3923$iter_39593963$fn3964$fn_3982.invoke(form-init5482203094887638175.clj:1)
at user$eval3923$iter_39593963$fn_3964.invoke(form-init5482203094887638175.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:507)
at clojure.core$seq__4107.invoke(core.clj:135)
at clojure.core$dorun.invoke(core.clj:3007)
at clojure.core$doall.invoke(core.clj:3023)
at user$eval3923.invoke(form-init5482203094887638175.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6792)
at clojure.lang.Compiler.eval(Compiler.java:6782)
at clojure.lang.Compiler.load(Compiler.java:7237)
... 11 more






[CLJS-1195] generic reusable command line argument parsing for REPLs Created: 10/Apr/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: newbie


 Description   

REPLs are more or less started in the same way and all the builtin ones provide a -main entry point. We should supply reusable command line argument parsing that any REPL can use to get standard command line driven start.






[CLJS-1194] data_readers.cljc Created: 10/Apr/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Now that conditional reading has landed we can implement support for data_readers.cljc to get both compile time and runtime support.



 Comments   
Comment by David Nolen [ 10/Apr/15 7:45 PM ]

This needs http://dev.clojure.org/jira/browse/CLJ-1699 to be useful.





[CLJS-1193] recompile dependents fails to work when not auto-building Created: 10/Apr/15  Updated: 10/Apr/15  Resolved: 10/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 10/Apr/15 8:52 AM ]

fixed https://github.com/clojure/clojurescript/commit/e89950e1962d4aece70262dacc7fab6428fb5625





[CLJS-1192] cljs.repl.node mistakenly depends upon JDK8 API Created: 08/Apr/15  Updated: 08/Apr/15  Resolved: 08/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: Chas Emerick Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: File CLJS-1192.diff    
Patch: Code

 Description   

The errant patch was associated with CLJS-1176.



 Comments   
Comment by David Nolen [ 08/Apr/15 11:44 AM ]

fixed https://github.com/clojure/clojurescript/commit/689ed7db5507fd3a10285f88086f8a379f55bbe6





[CLJS-1191] Update clojure.walk to the current version on clojure Created: 06/Apr/15  Updated: 13/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Stuart Mitchell Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: enhancement, performance

Attachments: Text File 50.patch     Text File CLJS-1191.patch    
Patch: Code

 Description   

Currently clojure.walk can not handle records

It is using an old version of clojure.walk and clojure has improved the implementation because of

http://dev.clojure.org/jira/browse/CLJ-1105


src/cljs/clojure/walk.cljs | 4 ++++
1 file changed, 4 insertions

diff --git a/src/cljs/clojure/walk.cljs b/src/cljs/clojure/walk.cljs
index f2ebd8d..541ecea 100644
— a/src/cljs/clojure/walk.cljs
+++ b/src/cljs/clojure/walk.cljs
@@ -43,7 +43,11 @@ the sorting function."}
{:added "1.1"}
[inner outer form]
(cond
+ (list? form) (outer (apply list (map inner form)))
+ (satisfies? IMapEntry form) (outer (vec (map inner form)))
(seq? form) (outer (doall (map inner form)))
+ (satisfies? IRecord form)
+ (outer (reduce (fn [r x] (conj r (inner x))) form form))
(coll? form) (outer (into (empty form) (map inner form)))
:else (outer form)))



 Comments   
Comment by David Nolen [ 07/Apr/15 5:56 AM ]

Please attach the patch as a file. Thanks!

Comment by Stuart Mitchell [ 07/Apr/15 7:18 PM ]

I think this one works

it is a mail formatted patch

Comment by David Nolen [ 08/Apr/15 6:07 AM ]

Please follow the patch conventions described here https://github.com/clojure/clojurescript/wiki/Patches. Thank you.

Comment by David Nolen [ 12/Apr/15 4:53 PM ]

Stuart, I don't see you on the list of contributors. Please submit a CA so I can apply the patch. Thanks!

Comment by Stuart Mitchell [ 13/Apr/15 7:49 PM ]

Hopefully this is the right format

Comment by Stuart Mitchell [ 13/Apr/15 7:50 PM ]

Contributor agreement signed as well





[CLJS-1190] definterface support Created: 03/Apr/15  Updated: 03/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

A interop thing for JSDoc using JavaScript libraries, but also a potential Clojure interop thing. We can generate an empty object + methods that includes JSDoc @interface annotation.






[CLJS-1189] array-map will return PersistentHashMap if applied to more than (.-HASHMAP-THRESHOLD PersistentArrayMap) pairs Created: 03/Apr/15  Updated: 10/Apr/15  Resolved: 03/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Mike Fikes Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

cljs.user=> (type (apply array-map [1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0]))
cljs.core/PersistentArrayMap
cljs.user=> (type (apply array-map [1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 10 0]))
cljs.core/PersistentHashMap



 Comments   
Comment by David Nolen [ 03/Apr/15 5:22 PM ]

fixed https://github.com/clojure/clojurescript/commit/815dde62ef06e591444d5deec8f2425890f57a1f

Comment by Mike Fikes [ 03/Apr/15 5:30 PM ]

Confirmed fixed.

Comment by Michał Marczyk [ 10/Apr/15 7:31 PM ]

array-map actually should always return array maps – it does so in Clojure and this is documented as desired behaviour in the docstring (which promises to return an array map) and on the Data Structures page on clojure.org:

http://clojure.org/data_structures

ArrayMaps
When doing code form manipulation it is often desirable to have a map which maintains key order. An array map is such a map - it is simply implemented as an array of key val key val... As such, it has linear lookup performance, and is only suitable for very small maps. It implements the full map interface. New ArrayMaps can be created with the array-map function. Note that an array map will only maintain sort order when un-'modified'. Subsequent assoc-ing will eventually cause it to 'become' a hash-map.

Clojure keeps the above promise:

Clojure 1.7.0-beta1
user=> (class (apply array-map (range 1000)))
clojure.lang.PersistentArrayMap

See also CLJS-873 (with my patch to make non-higher-order calls to array-map return array maps) and CLJS-872 (tangentially related).





[CLJS-1188] multi-arity fns hinder cross-module code motion Created: 03/Apr/15  Updated: 07/Apr/15  Resolved: 06/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File CLJS-1188.patch    

 Description   

Google Closure compiler will not move multi-arity ClojureScript functions as they are constructed via a function invoke.



 Comments   
Comment by David Nolen [ 03/Apr/15 7:14 PM ]

Experimented with lazy loading top-level multi-arity fns (which also required eliminating all existing invoke optimization) and confirmed that multi-arity fns in their current form defeat code motion. With working code motion the results can be quite dramatic, in the case of the Mori it shrinks the base module to about 25K.

Comment by David Nolen [ 03/Apr/15 7:35 PM ]

Lazy loading is not the way to do it as it cannot be reconciled without our other optimizations. We should treat top-level multi-arity fns as a special case. There is now a code-motion branch where this exploration is underway.

Comment by David Nolen [ 04/Apr/15 1:38 PM ]

In the code-motion branch currently explores doing this at the macro level. Doing this at the macro level avoids further complications to def and fn analyzer cases which are already the two of most complicated bits of the analyzer outside of ns. Doing this at the macro level does introduce its own issues - we have to replicate the implementation specific code generation bits handled by the compiler emission around multi-arity fns (the dispatcher), and the variadic fns (the argument wrangling, and runtime metadata). Another complication is that the compiler sees an fn var which takes no arguments. We will need to hack around this by collecting this information passing it along on the fn form.

Comment by David Nolen [ 06/Apr/15 6:30 PM ]

fixed https://github.com/clojure/clojurescript/commit/576fb6e054dd50ec458a3c9e4172a5a0002c7aea

Comment by Thomas Heller [ 07/Apr/15 4:48 AM ]

Nice work! Not seeing much in terms of movement between modules but my main module goes from 98KB to 91KB (gzip'd) due to extra removable code.

Comment by David Nolen [ 07/Apr/15 5:53 AM ]

Thomas that's great to hear. As another datapoint, for Mori the difference is about a 30-35% reduction of the base module.





[CLJS-1187] var ast contains internal nodes with bad analysis :context Created: 02/Apr/15  Updated: 03/Apr/15  Resolved: 03/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Blocker
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   
(defn foo [] (print "foo!"))
 
(defn bar [] (print "bar!"))
 
(defn print-foo [fb]
  (apply 
    (case fb
      :foo #'foo
      :bar #'bar) []))


 Comments   
Comment by David Nolen [ 03/Apr/15 5:50 AM ]

fixed https://github.com/clojure/clojurescript/commit/49ed83337baf762ef21a907be234ebdbcc105d66





[CLJS-1186] add :postamble option to compiler Created: 02/Apr/15  Updated: 02/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Michael Bradley Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: cljs

Attachments: Text File cljs_1186.patch    

 Description   

Similar to CLJS-723:

1) :postamble's value will be a vector of paths
2) the compiled output is appended with the contents of the files at those paths
3) the generated source map points to the correct/adjusted line numbers






[CLJS-1185] Support preambles when our target is node.js and we are compiler a main file Created: 02/Apr/15  Updated: 02/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Trivial
Reporter: Ivan Willig Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File CLJS-1185.patch    




[CLJS-1184] log module building activity under verbose Created: 02/Apr/15  Updated: 03/Apr/15  Resolved: 03/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Log how modules are constructed to support user reports as well as development.



 Comments   
Comment by David Nolen [ 03/Apr/15 7:25 AM ]

fixed https://github.com/clojure/clojurescript/commit/343573f5bf748aec6943d71e85e9c9a36dcfb529





[CLJS-1183] load-file doesn't copy source to output directory Created: 01/Apr/15  Updated: 01/Apr/15  Resolved: 01/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Mike Fikes Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None
Environment:

0.0-3169 QuickStart Browser REPL with watch commented out, OS X, Chrome



 Description   

If you invoke load-file for a path like "src/foo/bar.cljs", compiler output for the file is placed in "out/foo", but the source "bar.cljs" file is not copied. This results in java.io.FileNotFoundException: /Users/mfikes/Desktop/hello_world/out/foo/bar.cljs if source mapping of exception stacktraces needs to access the file.

To repro:
1. Use 0.0-3169 in QuickStart.
2. Set up Browser REPL following QuickStart, but comment out :watch.
3. Connect and ensure REPL is working.
4. Add "src/foo/bar.cljs" with contents below (a fn that will throw).
5. Do (load-file "src/foo/bar.cljs")
6. Call the fn: (foo.bar/call-me)
7. Observe attempt to read source in out when processing stacktrace.

cljs.user=> (foo.bar/call-me)
Error: 1 is not ISeqable
Exception in thread "main" java.io.FileNotFoundException: /Users/mfikes/Desktop/hello_world/out/foo/bar.cljs (No such file or directory), compiling:(/Users/mfikes/Desktop/hello_world/repl.clj:8:19)
	at clojure.lang.Compiler.load(Compiler.java:7142)
	at clojure.lang.Compiler.loadFile(Compiler.java:7086)
	at clojure.main$load_script.invoke(main.clj:274)
	at clojure.main$script_opt.invoke(main.clj:336)
	at clojure.main$main.doInvoke(main.clj:420)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.lang.Var.invoke(Var.java:379)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)
Caused by: java.io.FileNotFoundException: /Users/mfikes/Desktop/hello_world/out/foo/bar.cljs (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at clojure.java.io$fn__8702.invoke(io.clj:229)
	at clojure.java.io$fn__8615$G__8606__8622.invoke(io.clj:69)
	at clojure.java.io$fn__8676.invoke(io.clj:165)
	at clojure.java.io$fn__8628$G__8610__8635.invoke(io.clj:69)
	at clojure.java.io$reader.doInvoke(io.clj:102)
	at clojure.lang.RestFn.invoke(RestFn.java:410)
	at cljs.analyzer$parse_ns$fn__1510.invoke(analyzer.clj:2049)
	at cljs.analyzer$parse_ns.invoke(analyzer.clj:2035)
	at cljs.analyzer$parse_ns.invoke(analyzer.clj:2026)
	at cljs.repl$read_source_map.invoke(repl.clj:218)
	at clojure.core$juxt$fn__4211.invoke(core.clj:2440)
	at cljs.repl$mapped_stacktrace$iter__3903__3907$fn__3908$fn__3909.invoke(repl.clj:287)
	at cljs.repl$mapped_stacktrace$iter__3903__3907$fn__3908.invoke(repl.clj:278)
	at clojure.lang.LazySeq.sval(LazySeq.java:40)
	at clojure.lang.LazySeq.seq(LazySeq.java:49)
	at clojure.lang.RT.seq(RT.java:484)
	at clojure.core$seq.invoke(core.clj:133)
	at clojure.core$map$fn__4245.invoke(core.clj:2551)
	at clojure.lang.LazySeq.sval(LazySeq.java:40)
	at clojure.lang.LazySeq.seq(LazySeq.java:49)
	at clojure.lang.LazySeq.more(LazySeq.java:85)
	at clojure.lang.RT.more(RT.java:607)
	at clojure.core$rest.invoke(core.clj:73)
	at cljs.repl$mapped_stacktrace.invoke(repl.clj:322)
	at cljs.repl$print_mapped_stacktrace.invoke(repl.clj:333)
	at cljs.repl$display_error.invoke(repl.clj:403)
	at cljs.repl$repl_caught.invoke(repl.clj:696)
	at cljs.repl$repl_STAR_$fn__4076$fn__4083.invoke(repl.clj:835)
	at cljs.repl$repl_STAR_$fn__4076.invoke(repl.clj:832)
	at cljs.compiler$with_core_cljs.invoke(compiler.clj:951)
	at cljs.repl$repl_STAR_.invoke(repl.clj:798)
	at cljs.repl$repl.doInvoke(repl.clj:914)
	at clojure.lang.RestFn.invoke(RestFn.java:439)
	at user$eval198.invoke(repl.clj:10)
	at clojure.lang.Compiler.eval(Compiler.java:6703)
	at clojure.lang.Compiler.load(Compiler.java:7130)
	... 9 more

Contents of "src/foo/bar.cljs"

(ns foo.bar)

(defn this-throws [] (ffirst 1))

(defn call-me [] (this-throws))


 Comments   
Comment by Mike Fikes [ 01/Apr/15 1:41 PM ]

Occurs for me with master (https://github.com/clojure/clojurescript/commit/d12d678d9babb7d9a164e11997f084eeeb378c16)

Comment by David Nolen [ 01/Apr/15 3:22 PM ]

Ah right, this is probably due to the fact that load-file doesn't copy over the original source file into :output-dir which is needed for source mapping to work.

Comment by David Nolen [ 01/Apr/15 5:43 PM ]

fixed https://github.com/clojure/clojurescript/commit/6c446bce4ffe367ad4b32e60f5139f201651bf29

Comment by Mike Fikes [ 01/Apr/15 5:50 PM ]

Confirmed fixed.





[CLJS-1182] semantics of load-file should be require + implicit :reload Created: 01/Apr/15  Updated: 01/Apr/15  Resolved: 01/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 01/Apr/15 6:02 AM ]

fixed https://github.com/clojure/clojurescript/commit/d12d678d9babb7d9a164e11997f084eeeb378c16





[CLJS-1181] User Defined Tagged literal for integer causes all repls to hang Created: 01/Apr/15  Updated: 01/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196, 0.0-3126
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Kuldeep Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

For a user define tagged literal brepl, rhino repl crash/hang on startup or form evaluation.

; CLJS
(register-tag-parser! 'my/int #(js/parseInt %))

; Clojure
(defn- print-int
  [^Integer i ^java.io.Writer w]
  (.write w (str "#my/int \"" i "\"")))

(defmethod print-method Integer
  [^Integer i ^java.io.Writer w]
  (print-int i w))

(defmethod print-dup Integer
  [^Integer i ^java.io.Writer w]
  (print-int i w))

(defn read-int
  [^String s]
  (Integer. s))

; resources data_readers.clj
; {my/int     myns/read-int}


 Comments   
Comment by David Nolen [ 01/Apr/15 5:57 AM ]

This ticket needs more information. Please include the stacktrace. Thanks.





[CLJS-1180] Cache is read using read-edn, which does not accept all keywords that clojurescript accepts Created: 31/Mar/15  Updated: 01/Apr/15  Resolved: 01/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Stephen Nelson Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None


 Description   

Source that contains keywords such as `:*:` cannot be loaded from the cache because it's not valid edn. The same keyword is accepted by cljsc. Consequently, non-clean builds can fail when they attempt to load from the cache.

This particular keyword is used in hiccup vectors to indicate splicing (e.g. keminglabs/singult).



 Comments   
Comment by David Nolen [ 01/Apr/15 6:07 AM ]

This ticket needs more information - i.e. is this actually considered a valid keyword? Just because something can be read does not mean it's actually valid. According to http://clojure.org/reader, it appears keywords ending with : would be reserved by Clojure.

Comment by Francis Avila [ 01/Apr/15 9:52 AM ]

There are definitely problems with the keyword and symbol lack-of-specs and differences between edn and clojure, but :*: is an unreadable form everywhere.

Probably :*: was created from a string with (keyword ":*:"). So the problem here is really that Clojure will print forms that it and edn can't read back.

I think there was a proposal to have tagged-literal forms for symbols and keywords which are not readable directly, but I can't find a ticket for it. (e.g. print #kw [nil "*:"] instead.)

Related: CLJ-1527 CLJS-677 CLJ-1286

Comment by Stephen Nelson [ 01/Apr/15 4:34 PM ]

minimal reproduction using cljs.jar and the 'Quick Start' instructions.

:*: is a valid keyword in clojurescript, in so far that it's accepted by the cljs reader (without requiring using the keyword constructor). This is demonstrated by the reproduction I've created, the relevant source line is (println :*:). It is not accepted by the edn or clj readers.

The http://clojure.org/reader spec is an inaccurate representation of the syntax actually accepted by various readers. I think the compiler should at least be internally consistent in its behaviour, even if it doesn't follow the spec. I don't think it's reasonable for cljsc to fail when it loads from its cache as this behaviour is hard to diagnose for a user.

Tightening the constraints on keywords in the cljs reader to match edn and/or the clj reader would be an acceptable resolution of this issue.

Comment by David Nolen [ 01/Apr/15 4:43 PM ]

Just verified that this is an unreadable form in Clojure. Please feel free to file an issue with Singult or tools.reader which is what we use to read.





[CLJS-1179] strange load-file behavior Created: 31/Mar/15  Updated: 31/Mar/15  Resolved: 31/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

As reported by Colin Fleming:

~/d/cljs> cat node_repl.clj 
(require 'cljs.repl)
(require 'cljs.closure)
(require 'cljs.repl.node)

(cljs.closure/build "src"
  {:main 'hello-world.core
   :output-to "out/main.js"
   :verbose true})

(cljs.repl/repl (cljs.repl.node/repl-env)
  :watch "src"
  :output-dir "out")

~/d/cljs> cat src/hello_world/core.cljs 
(ns hello-world.core
  (:require [cljs.nodejs :as nodejs]))

(nodejs/enable-util-print!)

(defn -main [& args]
  (println "Hello world!"))

(set! *main-cli-fn* -main)

(defn foo [a b] (+ a b))

~/d/cljs> rlwrap java -cp cljs.jar:src clojure.main node_repl.clj
Reading analysis cache for jar:file:/Users/colin/dev/cljs/cljs.jar!/cljs/core.cljs
Compiling src/hello_world/core.cljs
Analyzing jar:file:/Users/colin/dev/cljs/cljs.jar!/cljs/nodejs.cljs
Compiling out/cljs/nodejs.cljs
Compiling out/cljs/core.cljs
Using cached cljs.core out/cljs/core.cljs
ClojureScript Node.js REPL server listening on 55907
Watch compilation log available at: out/watch.log
To quit, type: :cljs/quit
cljs.user=> (load-file "/Users/colin/dev/cljs/src/hello_world/core.cljs")
nil
cljs.user=> (hello-world.core/foo 1 2)
repl:13
throw e__3976__auto__;
      ^
TypeError: Cannot read property 'call' of undefined
    at repl:1:109
    at repl:9:3
    at repl:14:4
    at Object.exports.runInThisContext (vm.js:74:17)
    at Domain.<anonymous> ([stdin]:41:34)
    at Domain.run (domain.js:197:16)
    at Socket.<anonymous> ([stdin]:40:25)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
cljs.user=> (require '[hello-world.core :as hello] :reload)
/Users/colin/dev/cljs/out/hello_world/core.js:5
cljs.nodejs.enable_util_print_BANG_.call(null);
           ^
TypeError: Cannot read property 'enable_util_print_BANG_' of undefined
    at Object.<anonymous> (/Users/colin/dev/cljs/out/hello_world/core.cljs:4:2)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at global.CLOSURE_IMPORT_SCRIPT (repl:75:16)
    at Object.goog.require (repl:19:60)
    at repl:3:6
cljs.user=> :cljs/quit

~/d/cljs> rlwrap java -cp cljs.jar:src clojure.main node_repl.clj
Reading analysis cache for jar:file:/Users/colin/dev/cljs/cljs.jar!/cljs/core.cljs
Compiling src/hello_world/core.cljs
Reading analysis cache for jar:file:/Users/colin/dev/cljs/cljs.jar!/cljs/nodejs.cljs
Compiling out/cljs/nodejs.cljs
ClojureScript Node.js REPL server listening on 50817
Watch compilation log available at: out/watch.log
To quit, type: :cljs/quit
cljs.user=> (require '[hello-world.core :as hello] :reload)
nil
cljs.user=> (hello-world.core/foo 1 2)
3
cljs.user=> :cljs/quit
~/d/cljs>


 Comments   
Comment by David Nolen [ 31/Mar/15 7:32 AM ]

fixed https://github.com/clojure/clojurescript/commit/5b847b9da7997f30f42aa82f4f9225012035ae81





[CLJS-1178] Compiler does not know Math ns is not not-native Created: 29/Mar/15  Updated: 29/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Francis Avila Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: compiler

Attachments: Text File cljs-1178.patch    
Patch: Code

 Description   

With static-fns true, compiler will emit invocations of functions in the Math "namespace" with a conditional arity check or .call() because it does not know that the Math namespace is not not-native. Example with the fix function (advanced compilation, pseudo-names true):

function $cljs$core$fix$$($q$$28$$) {
  return 0 <= $q$$28$$ ? Math.floor.$cljs$core$IFn$_invoke$arity$1$ ? Math.floor.$cljs$core$IFn$_invoke$arity$1$($q$$28$$) : Math.floor.call(null, $q$$28$$) : Math.ceil.$cljs$core$IFn$_invoke$arity$1$ ? Math.ceil.$cljs$core$IFn$_invoke$arity$1$($q$$28$$) : Math.ceil.call(null, $q$$28$$);
}

With attached patch, the following is emitted instead:

function $cljs$core$fix$$($q$$28$$) {
  return 0 <= $q$$28$$ ? Math.floor($q$$28$$) : Math.ceil($q$$28$$);
}





[CLJS-1177] A compiler pass for JS dialects Created: 28/Mar/15  Updated: 28/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

There are now a variety of JS dialects, JSX, TypeScript etc. which need to be transformed first into regular JS before module processing. We should devise a standard way to deal with this. As we cannot predict what various dialects may arise in the future it's probably best to provide something like :preprocess-module option to cljs.closure/build.






[CLJS-1176] Push node.js REPL output through *out* and *err* Created: 27/Mar/15  Updated: 08/Apr/15  Resolved: 28/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Enhancement Priority: Major
Reporter: Chas Emerick Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None

Attachments: File CLJS-1176.diff    
Patch: Code

 Description   

The node.js REPL environment currently lets the child node process inherit the JVM's stdout/err. This is bad for nREPL, and for any other setup where one would like to rebind *out* and/or *err* in order to redirect content print ed by ClojureScript code. Turning off the inheritance and pumping output from the process to *out* and *err* should be straightforward.

Related nREPL/piggieback issue: https://github.com/cemerick/piggieback/issues/41



 Comments   
Comment by Chas Emerick [ 28/Mar/15 5:10 AM ]

Patch attached. Node REPL now sends output to *out* and *err*.

Comment by David Nolen [ 28/Mar/15 12:07 PM ]

fixed https://github.com/clojure/clojurescript/commit/a7f2a85d9df15e912dff71a8c95529bcfe459882

Comment by Joel Wilsson [ 08/Apr/15 7:10 AM ]

This doesn't work for me, because java.lang.Process does not have an isAlive() method. Maybe you were thinking of java.lang.Thread isAlive()?

user=> (require '[cljs.repl :as repl])
nil
user=> (require '[cljs.repl.node :as node])
nil
user=> (def env (node/repl-env))
#'user/env
user=> (repl/repl env)
Exception in thread "Thread-8" Exception in thread "Thread-9" java.lang.IllegalArgumentException: No matching field found: isAlive for class java.lang.UNIXProcess
	at clojure.lang.Reflector.getInstanceField(Reflector.java:271)
	at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:315)
	at cljs.repl.node$pipe.invoke(node.clj:85)
	at cljs.repl.node$setup$fn__10733.invoke(node.clj:109)
...
Comment by Chas Emerick [ 08/Apr/15 7:37 AM ]

Damn, no, looks like I was using the JDK 8 javadoc when I wrote the patch: http://docs.oracle.com/javase/8/docs/api/java/lang/Process.html#isAlive--

Looks like this would be an equivalent expression:

(try (.exitValue proc) false (catch IllegalThreadStateException _ true))

We'll see if David prefers a patch for this, or to paste it in himself…

Comment by Chas Emerick [ 08/Apr/15 8:03 AM ]

Patch attached to CLJS-1192. Sorry for the snafu! :-/





[CLJS-1175] CLJS defmulti doesn't exhibit same defonce behavior as Clojure's defmulti, suggesting an even better reloading behavior Created: 27/Mar/15  Updated: 28/Mar/15  Resolved: 28/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: Bruce Hauman Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

I just noticed that the redefinition of a defmulti completely destroys the dispatch table associated with it.

This is not the case in Clojure.
http://dev.clojure.org/jira/browse/CLJ-900
https://github.com/clojure/clojure/commit/1b8d5001ba094053b24c55829994785be422cfbf

I actually think the better behavior is to create a new MultiFn with the new options and steal the dispatch table state from the current MultiFn.

I think this is the least surprising behavior.



 Comments   
Comment by David Nolen [ 27/Mar/15 1:32 PM ]

defmulti in Clojure has defonce semantics. I don't think we need to do anything at all beyond that. Patch welcome for this.

Comment by David Nolen [ 28/Mar/15 12:29 PM ]

fixed https://github.com/clojure/clojurescript/commit/380c8b19c5fada55c40759063a4a23332bc7fdf8





[CLJS-1174] Simple warning if a namespace with dashes not found but a file path with dashes exists Created: 27/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None





[CLJS-1173] standard way to identify types originating from ClojureScript Created: 27/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None





[CLJS-1172] Determine if practical to supply main entry points for all standard REPLs Created: 26/Mar/15  Updated: 27/Mar/15  Resolved: 27/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Task Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 27/Mar/15 5:21 AM ]

fixed https://github.com/clojure/clojurescript/commit/9d7ee61070ba50dce283dea2b4c5caceaf8002cc





[CLJS-1171] map clojure.repl/doc, clojure.repl/source, clojure.repl/dir Created: 26/Mar/15  Updated: 27/Mar/15  Resolved: 27/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 27/Mar/15 5:02 AM ]

fixed https://github.com/clojure/clojurescript/commit/a8809d7030a82943d40094aeffa84c0f573630e9





[CLJS-1170] expose macroexpand & macroexpand-1 at the REPL Created: 26/Mar/15  Updated: 27/Mar/15  Resolved: 27/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 27/Mar/15 4:58 AM ]

fixed https://github.com/clojure/clojurescript/commit/f58861149dac8a8e61e34414903ed43c01acbe91





[CLJS-1169] cannot use REPL load-file on files that declare single segment namespaces Created: 26/Mar/15  Updated: 26/Mar/15  Resolved: 26/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

While not encouraged for projects, being able to do this when trying thing out is convenient.



 Comments   
Comment by David Nolen [ 26/Mar/15 9:19 PM ]

fixed by b17edea679fab22bafb949f0cffb01c1c55d33c9





[CLJS-1168] REPL fails to find .js files in :libs Created: 25/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: Daniel Skarda Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

org.clojure/clojurescript 0.0-3149
Tested with both basic clojurescript REPL and new com.cemerick/piggieback 0.2.0-20150324.120715-1



 Description   

We use Google E2E library for encryption. This library is written using Google Closure.
The library is stored locally in a directory ("closure-libs/e2e") and we pass :libs ["closure-libs/e2e"] to the compiler.

Compilation of our project works fine. Compiler does find the library without problems in all optimization modes.

Recently we have problem with REPL. With same parameters, REPL fails to load the library:

java.lang.IllegalArgumentException: Namespace e2e.async.Result does not exist
at cljs.closure$source_for_namespace.invoke(closure.clj:501)
at cljs.repl$load_namespace.invoke(repl.clj:181)
at cljs.repl$load_dependencies.invoke(repl.clj:201)
at cljs.repl$evaluate_form.invoke(repl.clj:444)
at cljs.repl$eval_cljs.invoke(repl.clj:527)
at cljs.repl$repl_STAR_$read_eval_print__4890.invoke(repl.clj:783)
at cljs.repl$repl_STAR_$fn_4896$fn_4903.invoke(repl.clj:821)
at cljs.repl$repl_STAR_$fn__4896.invoke(repl.clj:820)
at cljs.compiler$with_core_cljs.invoke(compiler.clj:951)
at cljs.repl$repl_STAR_.invoke(repl.clj:785)
at cryptelo.dev.cljs.env$eval11953.invoke(02b7dffab3345931421313ec2fe5d506990ab5e5-init.clj:1)

I spent long time investigating the issue (which is not easy given jungle of compiler and repl option maps, bindings of global variables etc).

What I found:

  • compiler finds the library without problem, all our tests invoked from the command line pass
  • both basic cljs REPL and piggieback (0.2.0 experimental branch) fails to find the library
  • :libs files are not copied to :output-dir
  • at the beginning, repl calls default-compiler-env with options
  • default-compiler-options run js-dependency-index, which scans all libraries and stores it in compiler atom
  • strace proves that clojurescript finds closure-libs/e2e/deps.js and reads it
  • calling (js-dependency-index {:libs ["closure-lib/e2e"]}) proves that the e2e.async.Result was found

But:

  • library-dependencies stores file path as URL in {:url ...}
  • source-for-namespace (from error stack) finds the file, but expects relative path with key :file

This is where my investigation stops. I am sure that fix would be probably easy, but I do not know all details of information cljs stores about .js files. Moreover I do not know why it works in compiler and not in REPL. Probably compiler does not open file and passes
it as a argument to Google Closure, while REPL actually wants to load the file itself.

Hope you have all information to fix the problem.

Thank you.



 Comments   
Comment by David Nolen [ 25/Mar/15 8:49 AM ]

Please do not include piggieback information when reporting issues to JIRA. We do not consider downstream tooling here at all. Will take a look, thanks for the report!





[CLJS-1167]  Using (require 'namespace.core :reload) causes "too much recursion" - one process only. Created: 24/Mar/15  Updated: 24/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: J David Eisenberg Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Linux Fedora 21, openjdk version "1.8.0_31"


Attachments: File m060.tgz    

 Description   

At shell prompt, using "mies" from github: lein new mies m060
In core.cljs uncomment: (repl/connect "http://localhost:9000/repl")
In core.cljs add (defn doubled [x] (* 2 x))
At shell prompt: scripts/build # finishes successfully
At shell prompt: scripts/brepl

This will generate two warnings about goog.next.xpc.TransportNames and goog.net.xpc.CfgFields

In browser, connect to localhost:9000

In REPL: (require 'm060.core)
In REPL: (in-ns 'm060.core)
In REPL: (doubled 10) ;; this works correctly

In core.cljs, add: (defn tripled [x] (* 3 x))
in REPL: (require 'm060.core :reload)

browser shows "too much recursion" error twice (in Firefox)
in REPL: (tripled 10) ;; also works correctly

in core.cljs, add: (defn quad [x] (* 4 x))

in REPL: (require 'm060.core :reload)
Internal error: Too much recursion
Many repetitions of clojure$browser$repl$bootstrapgoog.require (out/clojure/browser/repl.cljs:158:33)


Note: this error can be avoided by replacing the (repl/connect "http://localhost:9000/repl") by
(defonce conn (repl/connect "http://localhost:9000/repl")) ;; as in quick start guide






[CLJS-1166] Browser REPL stacktraces unprocessed if explicit IP used Created: 24/Mar/15  Updated: 24/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

QuickStart Browser REPL OS X Safari (other browsers as well)



 Description   

Go through the Quick Start but change the repl/connect form to use an explicit IP instead of localhost. (In this case the IP I am trying is indeed the same host, if that matters.)

(defonce conn
  (repl/connect "http://10.96.82.207:9000/repl"))

Then connect to the REPL using the explicit IP http://10.96.82.207:9000.

The REPL will function properly but stacktraces are not properly processed. Here is an example (generated using Safari):

ClojureScript:cljs.user> (ffirst [1])
Error: 1 is not ISeqable
cljs$core$seq@http://10.96.82.207:9000/out/cljs/core.js:4667:17
cljs$core$first@http://10.96.82.207:9000/out/cljs/core.js:4697:22
cljs$core$ffirst@http://10.96.82.207:9000/out/cljs/core.js:5774:23


eval code
eval@[native code]
http://10.96.82.207:9000/out/clojure/browser/repl.js:42:271
clojure$browser$repl$evaluate_javascript@http://10.96.82.207:9000/out/clojure/browser/repl.js:45:4
http://10.96.82.207:9000/out/clojure/browser/repl.js:242:173
deliver@http://10.96.82.207:9000/out/goog/messaging/abstractchannel.js:142:21
xpcDeliver@http://10.96.82.207:9000/out/goog/net/xpc/crosspagechannel.js:733:19
messageReceived_@http://10.96.82.207:9000/out/goog/net/xpc/nativemessagingtransport.js:321:23
fireListener@http://10.96.82.207:9000/out/goog/events/events.js:741:25
handleBrowserEvent_@http://10.96.82.207:9000/out/goog/events/events.js:862:34
http://10.96.82.207:9000/out/goog/events/events.js:276:42





[CLJS-1165] Support for multiple source directories in cljs.closure/build and watch Created: 24/Mar/15  Updated: 24/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Daniel Skarda Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Quick-Start wiki page describes build and watch as functions with source (directory) as first argument

However more complex projects have multiple source paths (eg "src/cljs", "test/cljs" or cljx output "target/generated/cljs" and in future also "src/cljc").

Maybe I am missing some important point of a puzzle but I do not see a way how to (for example) build or watch multiple directories. Should we extend these function to support vectors of directories?






[CLJS-1164] quot and rem are inefficient Created: 24/Mar/15  Updated: 29/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Francis Avila Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: math

Attachments: Text File cljs-1164.patch    
Patch: Code and Test

 Description   

The implementation of the quot and rem functions are needlessly complicated. Currently they are:

(defn quot [n d] (fix (/ (- n (js-mod n d)) d)))
(defn rem [n d] (- n (* d (quot n d))))

However all numbers in js are doubles already, so all this is unnecessary:

(defn quot [n d] (fix (/ n d)))
(defn rem [n d] (js-mod n d)))

Notice that "rem" is simply js-mod, and I'm not sure why no one noticed this before. I keep js-mod for now since a lot of code uses it, and if cljs ever grows a number tower the distinction may be important.

Patch attached, which also:

  • Creates a macro version of quot and rem.
  • Updates documentation for quot, rem, js-mod and mod for clarity.
  • Implement fix (private function to round to zero) with ES6 Math.trunc() if available.

Existing quot and rem tests pass, although there could be some better tests of edge cases (negative decimal num or div, NaN and +-Infinity args).



 Comments   
Comment by Francis Avila [ 24/Mar/15 12:27 PM ]

Better tests found rounding errors in my updated rem, which should stay as-is. (Not simply js-mod after all! Seems to round args first? Not obvious from the spec.) Changed quot however is correct and introduces less error than the current one. Will update patch and tests when I get a chance.

Comment by Francis Avila [ 29/Mar/15 12:39 AM ]

Working patch with tests attached. Tests expanded to cover floating-point cases. rem is now fundamentally the same as master (was more accurate than js-mod!!), but returns results consistent with js-mod for non-finite args or zero divisor.





[CLJS-1163] Using (require 'namespace.core :reload) causes "too much recursion" Created: 23/Mar/15  Updated: 23/Mar/15  Resolved: 23/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: J David Eisenberg Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None
Environment:

Linux (Fedora 21)


Attachments: File m060.tgz    

 Description   

lein new mies m060 (using latest version of mies from github)
Uncomment repl/connect in core.cljs, add function (defn doubled[x] (* 2 x))
In one terminal window: scripts/watch (wait for it to build)
In another terminal window: scripts/brepl
In browser: go to http://localhost:9000 and open web console.
In REPL: (require 'm060.core), then (in-ns 'm060.core)
In editor, add this to core.cljs: (defn tripled[x] (* 3 x)) ;; the "watch" window will recompile it
In REPL: (require 'm060.core :reload)
After a long pause, web console displays "too much recursion" message twice.
Despite the error message, in REPL: (tripled 10) works properly.



 Comments   
Comment by David Nolen [ 23/Mar/15 11:07 PM ]

We don't support multiple processes compiling to the same output directory.

Comment by J David Eisenberg [ 23/Mar/15 11:08 PM ]

Spurious issue; can't run both brepl and watch at the same time.





[CLJS-1162] Failure to printStackTrace when REPL initialized Created: 23/Mar/15  Updated: 23/Mar/15  Resolved: 23/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File CLJS-1162.patch    

 Description   

I got the (spurious) exception included below once when starting the Ambly REPL with 0.0-3148.

For quick reference, relevant code is
https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/repl.clj#L687

FWIW, I found that I can reproduce it in a Clojure REPL with:

(binding [*err* 1]
      (.printStackTrace (clojure.lang.ExceptionInfo. "hi" {} (Throwable.)) *err*))

where *err* is bound to anything of a type that is not an instance of PrintStream, which is perhaps at the root of the problem.

Exception in thread "main" java.lang.IllegalArgumentException: No matching method found: printStackTrace for class clojure.lang.ExceptionInfo, compiling:(/private/var/folders/nm/97bx7f_n31z2t2g_gf2bn90w0h013l/T/form-init733659167150723581.clj:1:141)
	at clojure.lang.Compiler.load(Compiler.java:7142)
	at clojure.lang.Compiler.loadFile(Compiler.java:7086)
	at clojure.main$load_script.invoke(main.clj:274)
	at clojure.main$init_opt.invoke(main.clj:279)
	at clojure.main$initialize.invoke(main.clj:307)
	at clojure.main$null_opt.invoke(main.clj:342)
	at clojure.main$main.doInvoke(main.clj:420)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at clojure.lang.Var.invoke(Var.java:383)
	at clojure.lang.AFn.applyToHelper(AFn.java:156)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)
Caused by: java.lang.IllegalArgumentException: No matching method found: printStackTrace for class clojure.lang.ExceptionInfo
	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:80)
	at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
	at cljs.repl$repl_caught.invoke(repl.clj:687)
	at cljs.repl$repl_STAR_$fn__4102$fn__4103.invoke(repl.clj:790)
	at cljs.repl$repl_STAR_$fn__4102.invoke(repl.clj:785)
	at cljs.compiler$with_core_cljs.invoke(compiler.clj:951)
	at cljs.repl$repl_STAR_.invoke(repl.clj:782)
	at user$eval4325.invoke(form-init733659167150723581.clj:3)
	at clojure.lang.Compiler.eval(Compiler.java:6703)
	at clojure.lang.Compiler.eval(Compiler.java:6666)
	at clojure.core$eval.invoke(core.clj:2927)
	at clojure.main$eval_opt.invoke(main.clj:288)
	at clojure.main$initialize.invoke(main.clj:307)
	at clojure.main$null_opt.invoke(main.clj:342)
	at clojure.main$main.doInvoke(main.clj:420)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at clojure.lang.Var.invoke(Var.java:383)
	at clojure.lang.AFn.applyToHelper(AFn.java:156)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
	at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
	at clojure.lang.Reflector.invokeStaticMethod(Reflector.java:207)
	at user$eval5.invoke(form-init733659167150723581.clj:1)
	at clojure.lang.Compiler.eval(Compiler.java:6703)
	at clojure.lang.Compiler.eval(Compiler.java:6693)
	at clojure.lang.Compiler.load(Compiler.java:7130)
	... 11 more


 Comments   
Comment by Mike Fikes [ 23/Mar/15 1:07 PM ]

Minor correction to description: PrintStream or PrintWriter.

Comment by Mike Fikes [ 23/Mar/15 1:30 PM ]

I am able to reproduce this by adding

(throw (clojure.lang.ExceptionInfo. "hi" {} (Throwable.)))

to Ambly's startup impl.

With this, I added a (prn *err*) right before the line in repl.clj and get this:

#<OutputStreamWriter java.io.OutputStreamWriter@1fe05fff>

This class is neither PrintStream or PrintWriter, so this is the penultimate cause.

Comment by Mike Fikes [ 23/Mar/15 1:37 PM ]

A minimal repro with Node.js REPL:

Add the throw mentioned above to the Node REPL impl, as the first thing inside setup:

--- a/src/clj/cljs/repl/node.clj
+++ b/src/clj/cljs/repl/node.clj
@@ -102,6 +102,7 @@
           root (.substring path 0 (+ (.indexOf path fc) (count fc)))
           root-path (vec (cons root cs))
           rewrite-path (conj root-path "goog")]
+      (throw (clojure.lang.ExceptionInfo. "hi" {} (Throwable.)))
       (reset! (:proc repl-env) proc)
       (loop [r nil]
         (when-not (= r "ready")

Then (with (prn *err*) still in place):

Mike-Fikess-MacBook-Pro:clojurescript mfikes$ script/noderepljs 
#<OutputStreamWriter java.io.OutputStreamWriter@41f686af>
Exception in thread "main" java.lang.IllegalArgumentException: No matching method found: printStackTrace for class clojure.lang.ExceptionInfo
	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:80)
	at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
	at cljs.repl$repl_caught.invoke(repl.clj:688)
	at cljs.repl$repl_STAR_$fn__4074.invoke(repl.clj:756)
	at cljs.compiler$with_core_cljs.invoke(compiler.clj:951)
	at cljs.repl$repl_STAR_.invoke(repl.clj:749)
	at cljs.repl$repl.doInvoke(repl.clj:900)
	at clojure.lang.RestFn.invoke(RestFn.java:410)
	at user$eval4248.invoke(NO_SOURCE_FILE:3)
	at clojure.lang.Compiler.eval(Compiler.java:6703)
	at clojure.lang.Compiler.eval(Compiler.java:6666)
	at clojure.core$eval.invoke(core.clj:2927)
	at clojure.main$eval_opt.invoke(main.clj:288)
	at clojure.main$initialize.invoke(main.clj:307)
	at clojure.main$null_opt.invoke(main.clj:342)
	at clojure.main$main.doInvoke(main.clj:420)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at clojure.lang.Var.invoke(Var.java:383)
	at clojure.lang.AFn.applyToHelper(AFn.java:156)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)
ClojureScript Node.js REPL server listening on 57399
Mike-Fikess-MacBook-Pro:clojurescript mfikes$
Comment by Mike Fikes [ 23/Mar/15 2:07 PM ]

Attached patch resolves issue. See CLJ-286 for interesting discussion surrounding root cause.

Comment by Mike Fikes [ 23/Mar/15 3:43 PM ]

I suppose an alternate patch could first check if *out* is a PrintWriter and conditionally do the wrapping. I'd be happy to put that together if warranted.

Comment by David Nolen [ 23/Mar/15 4:04 PM ]

fixed https://github.com/clojure/clojurescript/commit/b9d6a75a2693037f95abd4c211d9df0aa3e99251

Comment by Mike Fikes [ 23/Mar/15 4:27 PM ]

Confirmed fixed in master.





[CLJS-1161] Use higher-level binding of *cljs-ns*, REPL stack traces not printing to *err* Created: 23/Mar/15  Updated: 23/Mar/15  Resolved: 23/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Enhancement Priority: Blocker
Reporter: Chas Emerick Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File CLJS-1161.patch    
Patch: Code

 Comments   
Comment by Chas Emerick [ 23/Mar/15 12:18 PM ]

Patch attached. Not printing to *err* was probably just an oversight; being able to rebind *cljs-ns* at a higher level enables user-facing REPL utilities other than cljs.repl/repl.

Comment by David Nolen [ 23/Mar/15 12:21 PM ]

fixed https://github.com/clojure/clojurescript/commit/4a3737bbe8de30081c9aef1ec15f8aae9065a1b6





[CLJS-1160] Source map js / cljs line number mixup Created: 23/Mar/15  Updated: 23/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

QuickStart Browser REPL Chrome OS X



 Description   

Note the source location for cljs.core.LazySeq.sval in the following 0.0-3126 stacktrace:

ClojureScript:cljs.user> (map ffirst (range))
Error: 0 is not ISeqable
	 cljs$core$seq (out/cljs/core.cljs:951:13)
	 cljs$core$first (out/cljs/core.cljs:960:7)
	 cljs$core$ffirst (out/cljs/core.cljs:1393:3)
	 cljs.core.map.cljs$core$map__2 (out/cljs/core.cljs:4046:30)
	 cljs.core.LazySeq.sval (out/cljs/core.cljs:11400:3)
	 cljs.core.LazySeq.cljs$core$ISeqable$_seq$arity$1 (out/cljs/core.cljs:2884:12)
	 cljs$core$seq (out/cljs/core.cljs:938:7)
	 cljs$core$pr_sequential_writer (out/cljs/core.cljs:8426:13)

It turns out that line 11400 is actually in core.js, but the source map logic is evidently getting tripped up by this one, and core.cljs gets reported with the JS line numbers (core.cljs doesn't even have that many lines).

Note that this also occurs on master (where CLJS-1154 and CLJS-1157 have landed):

ClojureScript:cljs.user> (map ffirst (range))
Error: 0 is not ISeqable
	 cljs.core/seq (out/cljs/core.cljs:951:20)
	 cljs.core/first (out/cljs/core.cljs:960:16)
	 cljs$core$ffirst (out/cljs/core.cljs:1393:11)
	 cljs.core.map.cljs$core$map__2 (out/cljs/core.cljs:4046:30)
	 cljs.core.LazySeq.sval (out/cljs/core.cljs:11400:3)
	 cljs.core.LazySeq.cljs$core$ISeqable$_seq$arity$1 (out/cljs/core.cljs:2884:12)
	 cljs.core/seq (out/cljs/core.cljs:938:25)
	 cljs$core$pr_sequential_writer (out/cljs/core.cljs:8426:20)





[CLJS-1159] compiled files with warnings that otherwise don't need recompilation will not emit warnings on the next compile Created: 23/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The aggressive caching approach is odds with warning visibility. It probably makes sense for a compiled file with warnings to always return true for requires-compilation?.






[CLJS-1158] Regression: compiler fails to see symbols defined in another namespace Created: 23/Mar/15  Updated: 09/Apr/15  Resolved: 07/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: Nikita Prokopov Assignee: David Nolen
Resolution: Completed Votes: 1
Labels: None

Attachments: Zip Archive cljs-1158.zip    

 Description   

Regression happened between 0.0-2985 and 0.0-3030.

E.g. I have this setup:

(ns datascript
  (:require [datascript.core :as dc]))

(def filter dc/filter)
(ns datascript.js
  (:require
    [datascript :as d]))

d/filter

This is the output of compiler for 0.0-2985:

Compiling ClojureScript.
Compiling "target/datascript.js" from ["src" "test"]...
Analyzing jar:file:/Users/prokopov/.m2/repository/org/clojure/clojurescript/0.0-2985/clojurescript-0.0-2985.jar!/cljs/core.cljs
Compiling src/datascript/btset.cljs
Compiling src/datascript/core.cljs
Compiling src/datascript/debug.cljs
Compiling src/datascript/impl/entity.cljs
Compiling src/datascript/js.cljs
Analyzing file:/Users/prokopov/Dropbox/ws/datascript/src/datascript.cljs
WARNING: datascript is a single segment namespace at line 1 /Users/prokopov/Dropbox/ws/datascript/src/datascript.cljs
Analyzing file:/Users/prokopov/Dropbox/ws/datascript/src/datascript/query.cljs
Analyzing file:/Users/prokopov/Dropbox/ws/datascript/src/datascript/parser.cljs
Analyzing jar:file:/Users/prokopov/.m2/repository/org/clojure/clojurescript/0.0-2985/clojurescript-0.0-2985.jar!/clojure/set.cljs
Analyzing file:/Users/prokopov/Dropbox/ws/datascript/src/datascript/pull_parser.cljs
Analyzing file:/Users/prokopov/Dropbox/ws/datascript/src/datascript/pull_api.cljs
Analyzing jar:file:/Users/prokopov/.m2/repository/org/clojure/clojurescript/0.0-2985/clojurescript-0.0-2985.jar!/cljs/reader.cljs
Analyzing jar:file:/Users/prokopov/.m2/repository/org/clojure/clojurescript/0.0-2985/clojurescript-0.0-2985.jar!/clojure/walk.cljs
Compiling src/datascript/parser.cljs
...

Note that

Compiling src/datascript/js.cljs
triggers
Analyzing file:/Users/prokopov/Dropbox/ws/datascript/src/datascript.cljs

And on 0.0-3030 and later versions I get this:

Compiling ClojureScript.
Retrieving org/clojure/clojurescript/0.0-3030/clojurescript-0.0-3030.pom from central
Retrieving org/clojure/clojurescript/0.0-3030/clojurescript-0.0-3030.jar from central
Compiling "target/datascript.js" from ["src" "test"]...
Reading analysis cache for jar:file:/Users/prokopov/.m2/repository/org/clojure/clojurescript/0.0-3030/clojurescript-0.0-3030.jar!/cljs/core.cljs
Compiling src/datascript/btset.cljs
Compiling src/datascript/core.cljs
Compiling src/datascript/debug.cljs
Compiling src/datascript/impl/entity.cljs
Compiling src/datascript/js.cljs
WARNING: Use of undeclared Var datascript/filter at line 11 src/datascript/js.cljs
Compiling src/datascript/parser.cljs
Analyzing jar:file:/Users/prokopov/.m2/repository/org/clojure/clojurescript/0.0-3030/clojurescript-0.0-3030.jar!/clojure/set.cljs
Compiling src/datascript/pull_api.cljs
Analyzing file:/Users/prokopov/Dropbox/ws/datascript/src/datascript/pull_parser.cljs
Compiling src/datascript/pull_parser.cljs
Compiling src/datascript/query.cljs
Analyzing jar:file:/Users/prokopov/.m2/repository/org/clojure/clojurescript/0.0-3030/clojurescript-0.0-3030.jar!/cljs/reader.cljs
Analyzing jar:file:/Users/prokopov/.m2/repository/org/clojure/clojurescript/0.0-3030/clojurescript-0.0-3030.jar!/clojure/walk.cljs
Compiling src/datascript/query_v3.cljs
Analyzing jar:file:/Users/prokopov/.m2/repository/com/cemerick/clojurescript.test/0.3.3/clojurescript.test-0.3.3.jar!/cemerick/cljs/test.cljs
Analyzing jar:file:/Users/prokopov/.m2/repository/org/clojure/clojurescript/0.0-3030/clojurescript-0.0-3030.jar!/clojure/string.cljs
Compiling src/datascript.cljs
WARNING: datascript is a single segment namespace at line 1 src/datascript.cljs
...

The problem is in this line:

WARNING: Use of undeclared Var datascript/filter at line 11 src/datascript/js.cljs

I have fully legit use of datascript/filter in datascript.js, and yet get this warning.

To reproduce, just lein cljsbuild once advanced on master of https://github.com/tonsky/datascript with 0.0-3030 or later



 Comments   
Comment by David Nolen [ 23/Mar/15 5:45 AM ]

In general we only consider minimal cases not complete projects as there are too many variables at play. We no longer consider anything involving cljsbuild. Please attempt to produce a minimal case first. Given the above you should be able produce something quite small and simple using the Quick Start and the standalone JAR. Thanks!

Comment by David Nolen [ 23/Mar/15 6:09 AM ]

I just tried the standalone 0.0-3126 JAR with the following:

src/alias_bug/core.cljs

(ns alias-bug.core)

(defn foo [a b]
  (+ a b))

src/alias_bug/js.cljs

(ns alias-bug.js
  (:require [alias-bug :as alias]))

alias/foo

src/alias_bug.cljs

(ns alias-bug
  (:require [alias-bug.core :as core]))

(def foo core/foo)

build.clj

(require '[cljs.closure :as cljsc])

(cljsc/build "src"
  {:output-to "out/main.js"
   :verbose true})

I compiled this with:

java -cp cljs.jar:src clojure.main build.clj

I did not see this issue. I tried touching one file then running build again one at a time, still did not see this issue. The implicit options here are :optimizations :none, :cache-analysis true.

Comment by Nikita Prokopov [ 23/Mar/15 6:37 AM ]

Sorry, for some reason I decided that’s something trivial that was just overlooked and is easy to spot without a minimal test case. Now I see it’s more deep/complex than that. Attaching a minimal use case. Looks like it has something to do with :require-macros

Comment by Nikita Prokopov [ 23/Mar/15 6:58 AM ]

Just for information: I also noted that compilation order is alphabetical, and naming files plays a role here: when it compiles a, then b, then c, bug reproduces, if we rename files to change that order, it vanishes.

Comment by Immo Heikkinen [ 04/Apr/15 10:02 AM ]

I ran into this as well. The source seems to be changes to `intern-macros` in commit https://github.com/clojure/clojurescript/commit/db2c4d04cb924da6f939c26ba36dcdad08ef7080
which causes analysis of the macro namespace to be skipped here:
https://github.com/clojure/clojurescript/blob/r3126/src/clj/cljs/analyzer.clj#L1240

Comment by David Nolen [ 04/Apr/15 10:36 AM ]

Thanks for the additional information. I think this should be enough for me to create a minimal case.

Comment by David Nolen [ 07/Apr/15 7:34 AM ]

fixed https://github.com/clojure/clojurescript/commit/0d0f50958c952db5281aaec5e7bf0c0f9954ccee

Comment by Nikita Prokopov [ 07/Apr/15 7:44 AM ]

Amazing — thanks David!

Comment by David Nolen [ 07/Apr/15 9:14 AM ]

Nikita & Immo I'm pretty sure this fixes the issue but you all should confirm with master. Thanks.

Comment by Immo Heikkinen [ 07/Apr/15 11:40 PM ]

Yes it fixes the issue. Thanks David!

Comment by Nikita Prokopov [ 09/Apr/15 1:32 PM ]

Confirming too — works both on minimal test case and on DataScript codebase, warning is gone





[CLJS-1157] Stacktrace unmunging will blindly use local symbols Created: 21/Mar/15  Updated: 21/Mar/15  Resolved: 21/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File CLJS-1157-2.patch     Text File CLJS-1157.patch    

 Description   

With CLJS-1154, the symbol used to call a function is extracted from source maps to use in lieu of a munged name. This leads to undesirable results if the symbol is simply a local.

For example, notice the use of f in call-me:

(ns foo.bar)

(defn this-throws []
  (ffirst 1))

(defn call-me [f]
  (f))

(defn tricky []
  (call-me this-throws))

Where previously we would get:

ClojureScript:cljs.user> (foo.bar/tricky)
Error: 1 is not ISeqable
	 cljs$core$seq (.../cljs/core.cljs:951:13)
	 cljs$core$first (.../cljs/core.cljs:960:7)
	 cljs$core$ffirst (.../cljs/core.cljs:1393:3)
	 foo$bar$this_throws (.../foo/bar.cljs:4:3)
	 foo$bar$call_me (.../foo/bar.cljs:7:3)
	 foo$bar$tricky (.../foo/bar.cljs:10:3)
	 (NO_SOURCE_FILE)

we now get:

ClojureScript:cljs.user> (foo.bar/tricky)
Error: 1 is not ISeqable
	 cljs.core/seq (.../cljs/core.cljs:951:20)
	 cljs.core/first (.../cljs/core.cljs:960:16)
	 cljs.core/ffirst (.../cljs/core.cljs:1393:11)
	 f (.../foo/bar.cljs:4:4)
	 foo.bar/call-me (.../foo/bar.cljs:7:4)
	 foo$bar$tricky (.../foo/bar.cljs:10:4)
	 (NO_SOURCE_FILE)


 Comments   
Comment by Mike Fikes [ 21/Mar/15 10:36 AM ]

The attached patch takes a strategy of only replacing munged names if we can munge back to them.

It is a little more complicated in trying to deal with the possibility that, instead of a clean name like call-me, we had call-me$', in which case the unmanaged name would be used.

Below is what the patch would produce with the additional change call-me -> call-me$'. It successfully prevents replacing foo$bar$this_throws with the local symbol f.

ClojureScript:cljs.user> (foo.bar/tricky)
Error: 1 is not ISeqable
	 cljs.core/seq (.../cljs/core.cljs:951:20)
	 cljs.core/first (.../cljs/core.cljs:960:16)
	 cljs.core/ffirst (.../cljs/core.cljs:1393:11)
	 foo$bar$this_throws (.../foo/bar.cljs:4:4)
	 foo.bar/call-me$' (.../foo/bar.cljs:7:4)
	 foo$bar$tricky (.../foo/bar.cljs:10:4)
	 (NO_SOURCE_FILE)
Comment by Mike Fikes [ 21/Mar/15 1:23 PM ]

Attaching a simpler patch that doesn't try to look for $ in unmunaged name. It does't appear to be necessary and, makes things more complex, and would cause a local symbol with a name like f$ to appear in the trace.

Comment by David Nolen [ 21/Mar/15 2:03 PM ]

fixed https://github.com/clojure/clojurescript/commit/ddede7552814b09e0ca8c74943cd1ec9d2b54940





[CLJS-1156] load-file fails with :make-reader issue Created: 20/Mar/15  Updated: 22/Mar/15  Resolved: 21/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Blocker
Reporter: Mike Fikes Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None
Environment:

Quick Start, browser REPL (with :watch eliminated from repl.clj), OS X, Chrome,



 Description   

If I try (load-file ...) in the Browser REPL (Quick Start) for a file I've added it fails.

Here is a sample transcript illustrating the issue, followed by successfully using (require ...).

orion:hello_world mfikes$ rlwrap java -cp cljs.jar:src clojure.main repl.clj
Compiling client js ...
Waiting for browser to connect ...
To quit, type: :cljs/quit
ClojureScript:cljs.user> (doc load-file)
-------------------------
load-file
REPL Special Function
  Sequentially read and evaluate the set of forms contained in the file.
nil
ClojureScript:cljs.user> (load-file "src/foo/bar.cljs")
java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil
	at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:544)
	at clojure.java.io$fn__8628$G__8610__8635.invoke(io.clj:69)
	at clojure.java.io$reader.doInvoke(io.clj:102)
	at clojure.lang.RestFn.invoke(RestFn.java:410)
	at cljs.analyzer$forms_seq.invoke(analyzer.clj:1957)
	at cljs.analyzer$parse_ns$fn__1485.invoke(analyzer.clj:2011)
	at cljs.analyzer$parse_ns.invoke(analyzer.clj:1998)
	at cljs.analyzer$parse_ns.invoke(analyzer.clj:1989)
	at cljs.closure$src_file__GT_target_file.invoke(closure.clj:1580)
	at cljs.closure$src_file__GT_target_file.invoke(closure.clj:1575)
	at cljs.repl$load_file.invoke(repl.clj:467)
	at cljs.repl$fn__3938$self__3940.invoke(repl.clj:540)
	at cljs.repl$repl_STAR_$read_eval_print__4004.invoke(repl.clj:745)
	at cljs.repl$repl_STAR_$fn__4010$fn__4017.invoke(repl.clj:785)
	at cljs.repl$repl_STAR_$fn__4010.invoke(repl.clj:784)
	at cljs.compiler$with_core_cljs.invoke(compiler.clj:950)
	at cljs.repl$repl_STAR_.invoke(repl.clj:749)
	at cljs.repl$repl.doInvoke(repl.clj:866)
	at clojure.lang.RestFn.invoke(RestFn.java:439)
	at user$eval30.invoke(repl.clj:10)
	at clojure.lang.Compiler.eval(Compiler.java:6703)
	at clojure.lang.Compiler.load(Compiler.java:7130)
	at clojure.lang.Compiler.loadFile(Compiler.java:7086)
	at clojure.main$load_script.invoke(main.clj:274)
	at clojure.main$script_opt.invoke(main.clj:336)
	at clojure.main$main.doInvoke(main.clj:420)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.lang.Var.invoke(Var.java:379)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)
ClojureScript:cljs.user> (load-file "/Users/mfikes/Desktop/hello_world/src/foo/bar.cljs")
java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil
	at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:544)
	at clojure.java.io$fn__8628$G__8610__8635.invoke(io.clj:69)
	at clojure.java.io$reader.doInvoke(io.clj:102)
	at clojure.lang.RestFn.invoke(RestFn.java:410)
	at cljs.analyzer$forms_seq.invoke(analyzer.clj:1957)
	at cljs.analyzer$parse_ns$fn__1485.invoke(analyzer.clj:2011)
	at cljs.analyzer$parse_ns.invoke(analyzer.clj:1998)
	at cljs.analyzer$parse_ns.invoke(analyzer.clj:1989)
	at cljs.closure$src_file__GT_target_file.invoke(closure.clj:1580)
	at cljs.closure$src_file__GT_target_file.invoke(closure.clj:1575)
	at cljs.repl$load_file.invoke(repl.clj:467)
	at cljs.repl$fn__3938$self__3940.invoke(repl.clj:540)
	at cljs.repl$repl_STAR_$read_eval_print__4004.invoke(repl.clj:745)
	at cljs.repl$repl_STAR_$fn__4010$fn__4017.invoke(repl.clj:785)
	at cljs.repl$repl_STAR_$fn__4010.invoke(repl.clj:784)
	at cljs.compiler$with_core_cljs.invoke(compiler.clj:950)
	at cljs.repl$repl_STAR_.invoke(repl.clj:749)
	at cljs.repl$repl.doInvoke(repl.clj:866)
	at clojure.lang.RestFn.invoke(RestFn.java:439)
	at user$eval30.invoke(repl.clj:10)
	at clojure.lang.Compiler.eval(Compiler.java:6703)
	at clojure.lang.Compiler.load(Compiler.java:7130)
	at clojure.lang.Compiler.loadFile(Compiler.java:7086)
	at clojure.main$load_script.invoke(main.clj:274)
	at clojure.main$script_opt.invoke(main.clj:336)
	at clojure.main$main.doInvoke(main.clj:420)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.lang.Var.invoke(Var.java:379)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.Var.applyTo(Var.java:700)
	at clojure.main.main(main.java:37)
ClojureScript:cljs.user> (require 'foo.bar)
nil
ClojureScript:cljs.user> (ns-interns 'foo.bar)
{six #'foo.bar/six, two! #'foo.bar/two!, one #'foo.bar/one, eight #'foo.bar/eight, five' #'foo.bar/five', four #'foo.bar/four, nine #'foo.bar/nine, seven #'foo.bar/seven, three* #'foo.bar/three*}


 Comments   
Comment by Mike Fikes [ 20/Mar/15 9:37 PM ]

I'm not familiar with the way load-file is supposed work. I used the fully-qualified path, because that's what I saw Cursive do. I tried a path relative to the source directory, and this does't balk, but doesn't work either:

ClojureScript:cljs.user> (load-file "foo/bar.cljs")
nil
ClojureScript:cljs.user> (ns-interns 'foo.bar)
{}
Comment by Mike Fikes [ 20/Mar/15 9:40 PM ]

(I apologize for the ticket noise.)

The relative path does work in that the symbols are loaded into the browser JavaScript engine, while ns-interns is not updated:

orion:hello_world mfikes$ rlwrap java -cp cljs.jar:src clojure.main repl.clj
Compiling client js ...
Waiting for browser to connect ...
To quit, type: :cljs/quit
ClojureScript:cljs.user> (foo.bar/nine)
WARNING: Use of undeclared Var foo.bar/nine at line 1 <cljs repl>
ReferenceError: foo is not defined
ReferenceError: foo is not defined
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:1:89)
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:9:3)
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:14:4)
    at http://localhost:9000/out/clojure/browser/repl.js:42:267
    at clojure$browser$repl$evaluate_javascript (http://localhost:9000/out/clojure/browser/repl.js:45:4)
    at Object.callback (http://localhost:9000/out/clojure/browser/repl.js:242:169)
    at goog.messaging.AbstractChannel.deliver (http://localhost:9000/out/goog/messaging/abstractchannel.js:142:13)
    at goog.net.xpc.CrossPageChannel.xpcDeliver (http://localhost:9000/out/goog/net/xpc/crosspagechannel.js:733:12)
    at Function.goog.net.xpc.NativeMessagingTransport.messageReceived_ (http://localhost:9000/out/goog/net/xpc/nativemessagingtransport.js:321:13)
    at Object.goog.events.fireListener (http://localhost:9000/out/goog/events/events.js:741:21)
ClojureScript:cljs.user> (load-file "foo/bar.cljs")
nil
ClojureScript:cljs.user> (foo.bar/nine)
WARNING: Use of undeclared Var foo.bar/nine at line 1 <cljs repl>
Error: 1 is not ISeqable
	 cljs$core$seq (out/cljs/core.cljs:951:13)
	 cljs$core$first (out/cljs/core.cljs:960:7)
	 cljs$core$ffirst (out/cljs/core.cljs:1393:3)
	 foo$bar$one (out/foo/bar.cljs:7:14)
	 foo$bar$two_BANG_ (out/foo/bar.cljs:9:15)
	 foo$bar$three_STAR_ (out/foo/bar.cljs:11:17)
	 foo$bar$four (out/foo/bar.cljs:13:15)
	 foo$bar$five_SINGLEQUOTE_ (out/foo/bar.cljs:16:16)
	 foo$bar$six (out/foo/bar.cljs:20:2)
ClojureScript:cljs.user> (ns-interns 'foo.bar)
{}

(The exception thrown from foo.bar/nine is expected... I was testing stacktraces with this namespace earlier.)

Comment by David Nolen [ 21/Mar/15 8:46 PM ]

fixed https://github.com/clojure/clojurescript/commit/eb9478cab0f08cd752c1bb7894c2b4375346600a

Comment by Mike Fikes [ 22/Mar/15 9:05 AM ]

Confirmed fixed in master.





[CLJS-1155] REPL :watch support does not play nicely with :cljs/quit Created: 20/Mar/15  Updated: 20/Mar/15  Resolved: 20/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Blocker
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 20/Mar/15 5:51 PM ]

fixed https://github.com/clojure/clojurescript/commit/501a922a2fd1412503638bedc78a1f5e18b0219c

Comment by Mike Fikes [ 20/Mar/15 6:00 PM ]

Confirmed fixed for me when using browser REPL from Quick Start with :watch "src".





[CLJS-1154] When source-mapping stacktraces, obtain unmunged function names from source map Created: 20/Mar/15  Updated: 21/Mar/15  Resolved: 21/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Enhancement Priority: Blocker
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None
Environment:

All except for, say Node.js, where source mapping is done by the engine


Attachments: Text File CLJS-1154.patch    

 Description   

With CLJS-937 function symbols in stacktraces ended up being munged (for example cljs.core/first appears as cljs$core$first).

The symbol used when making calls is available in source maps (it is the :name element when read in), and it is possible to use this info to improve the stacktraces by using that symbol where possible (which appears to always be possible except for the top-most element in the trace, where the call site info is not there).



 Comments   
Comment by David Nolen [ 21/Mar/15 7:54 AM ]

fixed https://github.com/clojure/clojurescript/commit/e3169592656343cdb77db572a6bee0af2af903a5





[CLJS-1153] Typed Array backed PersistentVector based on clojure.core/Vec Created: 19/Mar/15  Updated: 19/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Adrian Medina Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: enhancement

Attachments: Text File 1153.patch    
Patch: Code

 Description   

Goal is to add support for vectors based on clojure.core/Vec, built on top of JavaScript Typed Arrays.

My hope is that this would allow for both efficient creation of vectors from existing Typed Arrays without intermediate conversion to normal JavaScript arrays, as well as efficient concatenation of the composite arrays of the vector back into a Typed Array when necessary via an enhanced cljs.core/into-array.

Implementation is based heavily on clojure/core/gvec.clj, cljs.core/PersistentVector, and cljs.core/TransientVector.

Performance should be comparable to cljs.core/PersistentVector, although there is additional constant overhead with TypedArray instantiation compared to js/Array.

Adds cljs.core/Vec, cljs.core/TransientVec, cljs.core/vector-of, and updates cljs.core/into-array.



 Comments   
Comment by Adrian Medina [ 19/Mar/15 8:39 PM ]

I still have to test, I will update the issue when that is complete. I just wanted to get my first patch up for review as quickly as possible.

Comment by Francis Avila [ 19/Mar/15 11:59 PM ]

No mention of Uint8ClampedArray.

Should Vec type- or range-check assignments? In Clojure these fail (even with unchecked-math):

  • (vector-of :byte 128) returns [-128]
  • (vector-of :byte "1") returns [1]
  • (vector-of :byte (js-obj)) returns [0]

If we're going to expose host primitive arrays via cljs apis, should we also bring the various other array functions in line with Clojure (and ClojureCLR, which also has extra uint, ubyte, etc types) like you are doing with into-array? Some or all of these issues may warrant another ticket instead, or maybe even a design page:

  • make-array ignores type argument and lacks higher dimensions.
  • object-array, int-array, etc. maybe should return TypedArrays.
  • Missing ubyte-array, ushort-array, uint-array (like ClojureCLR)
  • Missing aset-* setters. (Meaningless in js unless we range-check.)
  • aclone and amap preserve type of input array in Clojure, but not in cljs.
  • missing array casters: bytes, shorts, chars, ints, etc.
  • While we're at it, primitive coercion functions (e.g. int, long, unchecked-int, etc) are either no-ops or differ from clojure. (e.g., int in cljs is like unchecked-int in clojure, but unchecked-int in cljs does nothing). Maybe these should be dropped or should match the javascript ToInt32, ToInt16, etc abstract operations (i.e. those used when assigning to TypedArrays). Maybe these match java semantics also?




[CLJS-1152] (require 'some.ns :reload) causes printing to stop working in browser REPL Created: 19/Mar/15  Updated: 21/Mar/15  Resolved: 21/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Blocker
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 20/Mar/15 9:06 AM ]

This root cause is that the compiled browser repl JavaScript also gets reloaded. This occurs because we do not have real require and instead use the ns form to simulate it. What happens is that we emit a new ns form with whatever requires were previously present, the new ones, and add :reload or :reload-all. However this will affect all the namespaces instead of only the ones specified by require. Because of auto-building changing the semantics is likely to be surprising for compilation, however aligning the semantics when at the REPL should be fine.

In order to avoid churn on master while we wait for an enhanced Piggieback release we should try to implement the solution in the least invasive as possible way.

Comment by David Nolen [ 21/Mar/15 10:14 AM ]

Reloading is a transient thing so doing this via metadata is probably not a good idea. Probably the simplest thing to do is to always have REPL require reshape the specs into vectors and add metadata to the vector so that analyzer parse 'ns can extract and leverage this information without polluting the persistent compiler environment.

Comment by David Nolen [ 21/Mar/15 8:09 PM ]

fixed https://github.com/clojure/clojurescript/commit/bd392de1842949ad07076f9484c069a1b5ebb294





[CLJS-1151] Noisy errors when referring to symbol in undefined ns Created: 19/Mar/15  Updated: 22/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Quick Start / OS X / Chrome



 Description   

Run through the Quick Start to the point where you have the browser REPL running.

If you refer to a symbol in an undefined ns you will get really noisy errors:

ClojureScript:cljs.user> foo.bar/a
WARNING: Use of undeclared Var foo.bar/a at line 1 <cljs repl>
ReferenceError: foo is not defined
ReferenceError: foo is not defined
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:1:89)
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:9:3)
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:14:4)
    at http://localhost:9000/out/clojure/browser/repl.js:42:267
    at clojure$browser$repl$evaluate_javascript (http://localhost:9000/out/clojure/browser/repl.js:45:4)
    at Object.callback (http://localhost:9000/out/clojure/browser/repl.js:242:169)
    at goog.messaging.AbstractChannel.deliver (http://localhost:9000/out/goog/messaging/abstractchannel.js:142:13)
    at goog.net.xpc.CrossPageChannel.xpcDeliver (http://localhost:9000/out/goog/net/xpc/crosspagechannel.js:733:12)
    at Function.goog.net.xpc.NativeMessagingTransport.messageReceived_ (http://localhost:9000/out/goog/net/xpc/nativemessagingtransport.js:321:13)
    at Object.goog.events.fireListener (http://localhost:9000/out/goog/events/events.js:741:21)

Now, define the namespace, but don't actually define the symbol. For example:

(ns foo.bar)

(def z 3)

Now, require the namespace and do the same. The noise will go away.

ClojureScript:cljs.user> (require 'foo.bar)
nil
ClojureScript:cljs.user> foo.bar/a
WARNING: Use of undeclared Var foo.bar/a at line 1 <cljs repl>
nil

Additional info: Now if you attempt to refer to other unknown symbols, you will get different kinds of "noise" depending on whether the ns simply starts with foo:

ClojureScript:cljs.user> foo.baz/a
WARNING: No such namespace: foo.baz, could not locate foo/baz.cljs at line 1 <cljs repl>
WARNING: Use of undeclared Var foo.baz/a at line 1 <cljs repl>
TypeError: Cannot read property 'a' of undefined
TypeError: Cannot read property 'a' of undefined
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:1:96)
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:9:3)
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:14:4)
    at http://localhost:9000/out/clojure/browser/repl.js:42:267
    at clojure$browser$repl$evaluate_javascript (http://localhost:9000/out/clojure/browser/repl.js:45:4)
    at Object.callback (http://localhost:9000/out/clojure/browser/repl.js:242:169)
    at goog.messaging.AbstractChannel.deliver (http://localhost:9000/out/goog/messaging/abstractchannel.js:142:13)
    at goog.net.xpc.CrossPageChannel.xpcDeliver (http://localhost:9000/out/goog/net/xpc/crosspagechannel.js:733:12)
    at Function.goog.net.xpc.NativeMessagingTransport.messageReceived_ (http://localhost:9000/out/goog/net/xpc/nativemessagingtransport.js:321:13)
    at Object.goog.events.fireListener (http://localhost:9000/out/goog/events/events.js:741:21)
ClojureScript:cljs.user> goo.baz/a
WARNING: No such namespace: goo.baz, could not locate goo/baz.cljs at line 1 <cljs repl>
WARNING: Use of undeclared Var goo.baz/a at line 1 <cljs repl>
ReferenceError: goo is not defined
ReferenceError: goo is not defined
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:1:89)
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:9:3)
    at eval (eval at <anonymous> (http://localhost:9000/out/clojure/browser/repl.js:42:272), <anonymous>:14:4)
    at http://localhost:9000/out/clojure/browser/repl.js:42:267
    at clojure$browser$repl$evaluate_javascript (http://localhost:9000/out/clojure/browser/repl.js:45:4)
    at Object.callback (http://localhost:9000/out/clojure/browser/repl.js:242:169)
    at goog.messaging.AbstractChannel.deliver (http://localhost:9000/out/goog/messaging/abstractchannel.js:142:13)
    at goog.net.xpc.CrossPageChannel.xpcDeliver (http://localhost:9000/out/goog/net/xpc/crosspagechannel.js:733:12)
    at Function.goog.net.xpc.NativeMessagingTransport.messageReceived_ (http://localhost:9000/out/goog/net/xpc/nativemessagingtransport.js:321:13)
    at Object.goog.events.fireListener (http://localhost:9000/out/goog/events/events.js:741:21)


 Comments   
Comment by Mike Fikes [ 19/Mar/15 3:47 PM ]

Clarification on the description: When defining the foo.bar ns, I actually created a source file src/foo/bar.cljs containing the ns declaration and the def z.

Comment by David Nolen [ 22/Mar/15 9:49 AM ]

I'm not sure what we can do about this or that suppressing the errors from the JavaScript evaluation environment is a good idea. Property access on something that doesn't exist is what causes the JS environment to emit the error. In the later cases the property access is on something that does exist but doesn't have the property so no error.





[CLJS-1150] lift cljs.repl/repl cljs.user ns form evalution into default init Created: 19/Mar/15  Updated: 19/Mar/15  Resolved: 19/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 19/Mar/15 7:40 AM ]

fixed https://github.com/clojure/clojurescript/commit/4d1bbd6cfdde7411d9d286917d06a356afc12376





[CLJS-1149] cljs.repl/repl needs to support :compiler-env option Created: 19/Mar/15  Updated: 19/Mar/15  Resolved: 19/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 19/Mar/15 7:25 AM ]

fixed https://github.com/clojure/clojurescript/commit/1208fe565b27ec30ac315f3c237b0df3d30a629d





[CLJS-1148] ClojureScript REPL must maintain eval/print pairing Created: 19/Mar/15  Updated: 20/Mar/15  Resolved: 19/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

Currently the behavior is fine for the standard command line REPLs but pretty broken for anything else. Instead we should adopt the approach of the coming socket REPLs, we should supply a bind-err option which can be set to false to force error printing and other forms of logging to be directed to *err* instead of *out*.

There also a couple of places around the default prompt that should also be fixed.



 Comments   
Comment by Mike Fikes [ 19/Mar/15 7:10 AM ]

One consideration for printed output (even if directed to *err*): it needs to be modeled after print (in contrast to the default of println for :print).

Rationale: this supports evaluating forms that essentially call either print or println, without presuming a newline should be sent to *err*.

The pattern I've used in Ambly is :print-no-newline followed by :flush; perhaps with *err* semantics the :flush isn't necessary.

Comment by David Nolen [ 19/Mar/15 8:09 AM ]

fixed https://github.com/clojure/clojurescript/commit/9e680c425d300f20bd8726993d9835ced560bd87

Comment by David Nolen [ 19/Mar/15 8:09 AM ]

Mike Fikes good point but I think we should surface that issue elsewhere now.





[CLJS-1147] reconnect logic for browser REPLs Created: 18/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Instead of forcing users to refresh browser and lose application state, the browser REPL should poll once a second to connect if connection is unreachable for some reason.



 Comments   
Comment by David Nolen [ 21/Mar/15 8:56 PM ]

This is firmly a major nice-to-have, but not a blocker.





[CLJS-1146] REPL regression due to missing wrapping cljs.compiler/with-core-cljs in cljs.repl/repl Created: 18/Mar/15  Updated: 18/Mar/15  Resolved: 18/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
Fix Version/s: 0.0-3126

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 18/Mar/15 2:06 PM ]

fixed https://github.com/clojure/clojurescript/commit/9c1230ec912c930239eed1a4ab0b2b22e2ff5964





[CLJS-1145] numeric type inference should accept JVM primitive numeric type hints Created: 18/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None





[CLJS-1144] Expose MultiFn assessors Created: 18/Mar/15  Updated: 27/Mar/15  Resolved: 27/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
Fix Version/s: 0.0-3196

Type: Enhancement Priority: Major
Reporter: Joel Holdbrooks Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File 1144.patch    

 Description   

The MultiFn fields default-dispatch-val and dispatch-fn are useful in some cases. It would be nice to have accessors for these fields instead of having to use property access directly.



 Comments   
Comment by Joel Holdbrooks [ 18/Mar/15 12:31 PM ]

Added patch

Comment by David Nolen [ 27/Mar/15 7:35 AM ]

fixed https://github.com/clojure/clojurescript/commit/4eebd45bd82f40c8e656d97ee996ed91c48a3ec5





[CLJS-1143] Build module example from cljs.closure fails with file not found error. Created: 18/Mar/15  Updated: 18/Mar/15  Resolved: 18/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: John Chijioke Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None


 Description   

Running the build-modules example from the comments results in a file not found error when the file does not exist on disk. My expectation is that the whole process should be able to check if the file exists and write it if it doesn't but it fails to do that.

The code:

(build-modules
  [(map->javascript-file
     (ana/parse-ns 'cljs.core (io/file "out/cljs/core.js") nil))
   (map->javascript-file
     (ana/parse-ns 'cljs.reader (io/file "out/cljs/reader.js") nil))]
   {:optimizations  :advanced
    :output-dir     "out"
    :cache-analysis true
    :modules        {:core
                     {:output-to "out/modules/core.js"
                      :entries   '#{cljs.core}}
                     :landing
                     {:output-to  "out/modules/reader.js"
                      :entries    '#{cljs.reader}
                      :depends-on #{:core}}}})

In my case the file "out/cljs/reader.js" does not exist.



 Comments   
Comment by David Nolen [ 18/Mar/15 9:10 AM ]

This is comment code, not official documentation of an API. The failure is in parse-ns which has nothing to do with modules support. That said there's not enough introductory information around :modules. There is a simple task to provide a step by step walk through of :modules support CLJS-1129. Happy to see this taken up by someone.





[CLJS-1142] ClojureScript stream socket REPL Created: 18/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Port relevant bits of CLJ-1671






[CLJS-1141] memoization of js-dependency-index and get-upstream-deps needs knobs Created: 18/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File CLJS_1141.patch     Text File CLJS-1141-with-js-dep-caching-latest.patch    

 Description   

knobs should be exposed for more dynamic compilation environments like Figwheel which may desire to add dependencies to the classpath on the fly.



 Comments   
Comment by Bruce Hauman [ 21/Mar/15 3:51 PM ]

A patch that caches upstream dependencies in the compiler env.

Comment by Bruce Hauman [ 21/Mar/15 3:59 PM ]

Actually I'm going to submit another patch that includes the memoize calls in js-deps.

Comment by Bruce Hauman [ 28/Mar/15 12:50 PM ]

New patch that moves cljs.js-deps memoization to current env/compiler as well as get-upstream-deps.

Unfortunately there is a circular dep between cljs.env and cljs.js-deps, if we want to cache in env/compiler. I overcame this with a resolve.

Compile performance is either completely unchanged or slightly improved based on several test runs.

Comment by Bruce Hauman [ 28/Mar/15 2:22 PM ]

Hold off on this. Its not behaving as expected. Doesn't seem to be caching in certain situations.

Comment by David Nolen [ 28/Mar/15 2:26 PM ]

Thanks for the update. This will definitely not land until after the pending REPL/piggieback release anyhow.

Comment by Bruce Hauman [ 28/Mar/15 2:44 PM ]

Yeah there is an obvious bug and a subtle one. Hopefully will finish it up soonish.

Comment by Bruce Hauman [ 28/Mar/15 3:43 PM ]

Alright, this latest patch works. There was a subtle memoizing nil value bug.





[CLJS-1140] typo in cljs.repl/repl, `:need-prompt prompt` instead of `:need-prompt need-prompt` Created: 18/Mar/15  Updated: 18/Mar/15  Resolved: 18/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 18/Mar/15 5:40 PM ]

fixed https://github.com/clojure/clojurescript/commit/ebb012172db02700410d5c9c0760a610e7148a04





[CLJS-1139] Repeated applications of `ns` form at the REPL are not additive Created: 17/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: Michael Griffiths Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Quick start guide with Node REPL



 Description   

In a Clojure REPL, it is possible to declare the same namespace again, without existing namespaces aliases being altered or removed:

user=> (ns my-test-ns.core (:require [clojure.string :as string]))
nil
my-test-ns.core=> (def a string/blank?)
#'my-test-ns.core/a
my-test-ns.core=> (ns my-test-ns.core)
nil
my-test-ns.core=> (def a string/blank?)
#'my-test-ns.core/a
my-test-ns.core=>

ClojureScript REPLs do not behave in the same way:

ClojureScript:cljs.user> (ns my-test-ns.core (:require [clojure.string :as string]))
true
ClojureScript:my-test-ns.core> (def a string/blank?)
#<function clojure$string$blank_QMARK_(s){
return goog.string.isEmptySafe(s);
}>
ClojureScript:my-test-ns.core> (ns my-test-ns.core)
nil
ClojureScript:my-test-ns.core> (def a string/blank?)
WARNING: No such namespace: string, could not locate string.cljs at line 1 <cljs repl>
WARNING: Use of undeclared Var string/blank? at line 1 <cljs repl>
repl:13
throw e__3919__auto__;
      ^
ReferenceError: string is not defined
    at repl:1:109
    at repl:9:3
    at repl:14:4
    at Object.exports.runInThisContext (vm.js:74:17)
    at Domain.<anonymous> ([stdin]:41:34)
    at Domain.run (domain.js:197:16)
    at Socket.<anonymous> ([stdin]:40:25)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
ClojureScript:my-test-ns.core>





[CLJS-1138] Add page to Wiki "Slow dev builds" Created: 17/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Task Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: newbie


 Description   

A common mistake with cljsbuild is to include test directories in the source paths. Due to :recompile-dependents defaulting to true, tests will get unnecessarily recompiled.






[CLJS-1137] :cljs/quit fails to actually quit Created: 17/Mar/15  Updated: 20/Mar/15  Resolved: 20/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
Fix Version/s: 0.0-3196

Type: Defect Priority: Blocker
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None
Environment:

Quick Start Browser REPL (OS X / Safari)



 Description   

If you run through Quick Start through the Browser REPL section (https://github.com/clojure/clojurescript/wiki/Quick-Start#browser-repl), :cljs/quit will hang if a user tries it:

$ rlwrap java -cp cljs.jar:src clojure.main repl.clj
Compiling client js ...
Waiting for browser to connect ...
To quit, type: :cljs/quit
ClojureScript:cljs.user> :cljs/quit

The root problem appears to be agent threads running; here is what a kill -3 shows:

2015-03-17 12:50:25
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.31-b07 mixed mode):

"DestroyJavaVM" #19 prio=5 os_prio=31 tid=0x00007fc9201cf800 nid=0xf07 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"clojure-agent-send-pool-0" #18 prio=5 os_prio=31 tid=0x00007fc9209d8000 nid=0x5e03 waiting on condition [0x0000000129214000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000006e09bfdf8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Service Thread" #9 daemon prio=9 os_prio=31 tid=0x00007fc91c038800 nid=0x5103 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #8 daemon prio=9 os_prio=31 tid=0x00007fc91b810800 nid=0x4f03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #7 daemon prio=9 os_prio=31 tid=0x00007fc91c822800 nid=0x4d03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #6 daemon prio=9 os_prio=31 tid=0x00007fc91c822000 nid=0x4b03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #5 daemon prio=9 os_prio=31 tid=0x00007fc91c037800 nid=0x4903 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007fc91c03a800 nid=0x3c17 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fc91c064000 nid=0x3503 in Object.wait() [0x0000000125685000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
	- locked <0x00000006e04631b8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fc91c063000 nid=0x3303 in Object.wait() [0x0000000125582000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
	- locked <0x00000006e0184378> (a java.lang.ref.Reference$Lock)

"VM Thread" os_prio=31 tid=0x00007fc91c060800 nid=0x3103 runnable 

"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fc91c00e800 nid=0x10f runnable 

"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fc91c00f000 nid=0x230f runnable 

"GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007fc91c00f800 nid=0x2503 runnable 

"GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007fc91c010800 nid=0x2703 runnable 

"GC task thread#4 (ParallelGC)" os_prio=31 tid=0x00007fc91c011000 nid=0x2903 runnable 

"GC task thread#5 (ParallelGC)" os_prio=31 tid=0x00007fc91c011800 nid=0x2b03 runnable 

"GC task thread#6 (ParallelGC)" os_prio=31 tid=0x00007fc91c012000 nid=0x2d03 runnable 

"GC task thread#7 (ParallelGC)" os_prio=31 tid=0x00007fc91c013000 nid=0x2f03 runnable 

"VM Periodic Task Thread" os_prio=31 tid=0x00007fc91c07b800 nid=0x5303 waiting on condition 

JNI global references: 76

Heap
 PSYoungGen      total 124928K, used 115712K [0x0000000775580000, 0x000000077d880000, 0x00000007c0000000)
  eden space 115712K, 100% used [0x0000000775580000,0x000000077c680000,0x000000077c680000)
  from space 9216K, 0% used [0x000000077cf80000,0x000000077cf80000,0x000000077d880000)
  to   space 9216K, 0% used [0x000000077c680000,0x000000077c680000,0x000000077cf80000)
 ParOldGen       total 102400K, used 10119K [0x00000006e0000000, 0x00000006e6400000, 0x0000000775580000)
  object space 102400K, 9% used [0x00000006e0000000,0x00000006e09e1dc0,0x00000006e6400000)
 Metaspace       used 21921K, capacity 22079K, committed 22400K, reserved 1067008K
  class space    used 4104K, capacity 4140K, committed 4224K, reserved 1048576K


 Comments   
Comment by Mike Fikes [ 17/Mar/15 11:56 AM ]

A minor correction:

The thread dump in the description was produced with :watch "src" commented out of my repl.clj. Restoring that to adhere to Quick Start produces the same end result, but with additional non-daemon threads:

2015-03-17 12:53:46
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.31-b07 mixed mode):

"DestroyJavaVM" #20 prio=5 os_prio=31 tid=0x00007fc02f155800 nid=0xf07 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Thread-9" #19 daemon prio=5 os_prio=31 tid=0x00007fc02f155000 nid=0x6503 waiting on condition [0x000000012e3be000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000007757e8110> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"clojure-agent-send-pool-0" #18 prio=5 os_prio=31 tid=0x00007fc02a6b5000 nid=0x6303 waiting on condition [0x000000012ed01000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000006e08f4438> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"clojure-agent-send-off-pool-6" #17 prio=5 os_prio=31 tid=0x00007fc02e17e000 nid=0x6103 waiting on condition [0x000000012e993000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000006e0500628> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"clojure-agent-send-off-pool-5" #16 prio=5 os_prio=31 tid=0x00007fc02bc39800 nid=0x5f03 waiting on condition [0x000000012e890000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000007757e75f0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
	at java.util.concurrent.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:492)
	at java.util.concurrent.LinkedBlockingDeque.take(LinkedBlockingDeque.java:680)
	at sun.nio.fs.AbstractWatchService.take(AbstractWatchService.java:118)
	at cljs.closure$watch.invoke(closure.clj:1533)
	at cljs.closure$watch.invoke(closure.clj:1487)
	at cljs.repl$repl_STAR_$fn__4003$fn__4006.invoke(repl.clj:753)
	at clojure.core$binding_conveyor_fn$fn__4145.invoke(core.clj:1910)
	at clojure.lang.AFn.call(AFn.java:18)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	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)

"clojure-agent-send-off-pool-4" #15 prio=5 os_prio=31 tid=0x00007fc02e125800 nid=0x5d03 waiting on condition [0x000000012e2bb000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000006e0500628> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"clojure-agent-send-off-pool-3" #14 prio=5 os_prio=31 tid=0x00007fc02c95e000 nid=0x5b03 waiting on condition [0x000000012de5d000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000006e0500628> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"clojure-agent-send-off-pool-2" #13 prio=5 os_prio=31 tid=0x00007fc02e124800 nid=0x5903 waiting on condition [0x000000012dd5a000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000006e0500628> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"clojure-agent-send-off-pool-1" #12 prio=5 os_prio=31 tid=0x00007fc02e1e2800 nid=0x5703 waiting on condition [0x000000012dc57000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000006e0500628> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"clojure-agent-send-off-pool-0" #11 prio=5 os_prio=31 tid=0x00007fc02c027000 nid=0x5503 waiting on condition [0x000000012ee41000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000006e0500628> (a java.util.concurrent.SynchronousQueue$TransferStack)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
	at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
	at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
	at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

"Service Thread" #9 daemon prio=9 os_prio=31 tid=0x00007fc02b816800 nid=0x5103 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #8 daemon prio=9 os_prio=31 tid=0x00007fc02b800800 nid=0x4f03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #7 daemon prio=9 os_prio=31 tid=0x00007fc029894000 nid=0x4d03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #6 daemon prio=9 os_prio=31 tid=0x00007fc029875000 nid=0x4b03 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #5 daemon prio=9 os_prio=31 tid=0x00007fc029887000 nid=0x4903 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007fc029886000 nid=0x3c13 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fc029873800 nid=0x3503 in Object.wait() [0x000000012add9000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:142)
	- locked <0x00000006e00f7988> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:158)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fc029872800 nid=0x3303 in Object.wait() [0x000000012acd6000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:157)
	- locked <0x00000006e0124b90> (a java.lang.ref.Reference$Lock)

"VM Thread" os_prio=31 tid=0x00007fc029870000 nid=0x3103 runnable 

"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fc02981e000 nid=0x10f runnable 

"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fc02981e800 nid=0x230f runnable 

"GC task thread#2 (ParallelGC)" os_prio=31 tid=0x00007fc02981f000 nid=0x2503 runnable 

"GC task thread#3 (ParallelGC)" os_prio=31 tid=0x00007fc02981f800 nid=0x2703 runnable 

"GC task thread#4 (ParallelGC)" os_prio=31 tid=0x00007fc029820800 nid=0x2903 runnable 

"GC task thread#5 (ParallelGC)" os_prio=31 tid=0x00007fc029821000 nid=0x2b03 runnable 

"GC task thread#6 (ParallelGC)" os_prio=31 tid=0x00007fc029821800 nid=0x2d03 runnable 

"GC task thread#7 (ParallelGC)" os_prio=31 tid=0x00007fc029822000 nid=0x2f03 runnable 

"VM Periodic Task Thread" os_prio=31 tid=0x00007fc02b817000 nid=0x5303 waiting on condition 

JNI global references: 92

Heap
 PSYoungGen      total 124928K, used 23388K [0x0000000775580000, 0x0000000781880000, 0x00000007c0000000)
  eden space 115712K, 19% used [0x0000000775580000,0x0000000776b973b8,0x000000077c680000)
  from space 9216K, 8% used [0x000000077c680000,0x000000077c740000,0x000000077cf80000)
  to   space 15872K, 0% used [0x0000000780900000,0x0000000780900000,0x0000000781880000)
 ParOldGen       total 100352K, used 10109K [0x00000006e0000000, 0x00000006e6200000, 0x0000000775580000)
  object space 100352K, 10% used [0x00000006e0000000,0x00000006e09df468,0x00000006e6200000)
 Metaspace       used 22439K, capacity 22609K, committed 22656K, reserved 1067008K
  class space    used 4175K, capacity 4207K, committed 4224K, reserved 1048576K
Comment by Mike Fikes [ 17/Mar/15 12:27 PM ]

It would be interesting if there is a clever solution to this. Ambly is currently using an explicit directive in its start script: https://github.com/omcljs/ambly/blob/master/Clojure/script/jscrepljs#L14 which works (https://github.com/omcljs/ambly/blob/master/Clojure/src/ambly/repl/jsc.clj#L217), but is not suitable for use in environments where a user may already have a REPL running that they'd like :cljs/quit to return to.

Comment by David Nolen [ 20/Mar/15 5:23 PM ]

fixed https://github.com/clojure/clojurescript/commit/6e2c8175b102eb3213dffc84cc44a9b7e1443be4

Comment by Mike Fikes [ 20/Mar/15 5:35 PM ]

Confirmed fixed for me (with no :watch directive).





[CLJS-1136] Initial require fails to fully load added symbols Created: 17/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Minor
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Quick Start Browser REPL (OS X / Safari)



 Description   

In the Quick Start, a portion runs the user through adding a symbol (a function named foo) and then requiring the namespace and using that symbol. I'm finding that require fails and that I need to add the :reload directive.

To reproduce:

  1. Run through the Quick Start up through the browser REPL section.
  2. Set src/hello_world/core.cljs so that it does not have the foo function defined.
  3. Remove the out directory: rm -rf out
  4. Start up the REPL: rlwrap java -cp cljs.jar:src clojure.main repl.clj
  5. Connect Safari by going to http://localhost:9000
  6. Show the error console in Safari. (You'll see Hello world.)
  7. Run tail -f out/watch.log
  8. Add the foo function that adds a b to src/hello_world/core.cljs and save it.
  9. Observe that watch.log reflects recompilation
  10. Do {{ (require '[hello-world.core :as hello]) }}
  11. Do {{ (hello/foo 2 3) }}

At this point you will get:
TypeError: undefined is not an object (evaluating 'hello_world.core.foo.call')

But:

ClojureScript:cljs.user> (ns-interns 'hello-world.core)
{foo #'hello-world.core/foo, conn #'hello-world.core/conn}
ClojureScript:cljs.user> (source hello/foo)
(defn foo [a b]
  (+ a b))
nil

Now, if you :reload

ClojureScript:cljs.user> (require '[hello-world.core :as hello] :reload)
nil
ClojureScript:cljs.user> (hello/foo 2 3)
5


 Comments   
Comment by Mike Fikes [ 17/Mar/15 11:30 AM ]

Prior to step 8:

ClojureScript:cljs.user> (ns-interns 'hello-world.core)
{}

Between steps 9 and 10:

ClojureScript:cljs.user> (ns-interns 'hello-world.core)
{foo #'hello-world.core/foo, conn #'hello-world.core/conn}

My guess: Watching is causing symbols to be interned, but not usable, and this is interfering with require forcing you to include :reload.

Comment by David Nolen [ 22/Mar/15 9:46 AM ]

I'm not sure that this is actually an issue, the browser has already required the namespace, it's the entry point. Thus you really do need a :reload. But the reason you see interned symbols is that the watch process shares the compilation environment with the REPL. It may be the case that with the dramatically improved REPLs the watch option becomes entirely unnecessary and counterintuitive, let's see how it goes.





[CLJS-1135] Present more cljs.foo.api interfaces for stable parts of cljs.analyzer, cljs.compiler, and cljs.closure Created: 17/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Task Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None





[CLJS-1134] Lift protocols from cljs.closure into cljs.protocols ns Created: 17/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Task Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

This is task towards presenting a stable API to users without reaching into the implementation namespaces.






[CLJS-1133] REPL require results in warnings to be emitted twice Created: 17/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Minor
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Quick Start Browser REPL with :watch off



 Description   

Run through the Quick Start and go down through to the Browser REPL portion (https://github.com/clojure/clojurescript/wiki/Quick-Start#browser-repl), but exclude the :watch option from repl.clj.

Then further down, where the new symbol is introduced

;; ADDED
(defn foo [a b]
  (+ a b))

instead cause some duplicate symbols to be introduced in order to provoke compiler warnings:

(def a 1)
(def a 1)

(defn foo [a b]
  (+ a b))
(defn foo [a b]
  (+ a b))

Then evaluate the require statement in the tutorial and observe that the warnings are emitted twice:

ClojureScript:cljs.user> (require '[hello-world.core :as hello])
WARNING: a at line 11 is being replaced at line 12 /Users/mfikes/Desktop/hello_world/src/hello_world/core.cljs
WARNING: foo at line 14 is being replaced at line 16 /Users/mfikes/Desktop/hello_world/src/hello_world/core.cljs
WARNING: a at line 11 is being replaced at line 12 /Users/mfikes/Desktop/hello_world/src/hello_world/core.cljs
WARNING: foo at line 14 is being replaced at line 16 /Users/mfikes/Desktop/hello_world/src/hello_world/core.cljs
nil





[CLJS-1132] compile-file analysis pass optimization broken under Closure optimization and :cache-analysis true Created: 16/Mar/15  Updated: 16/Mar/15  Resolved: 16/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3119
Fix Version/s: 0.0-3123

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 16/Mar/15 5:29 PM ]

fixed https://github.com/clojure/clojurescript/commit/7a6ce7f5f680b304a44d20692353abdef68a5592





[CLJS-1131] cljs.closure/add-dependencies needs to be more aggressively set oriented Created: 16/Mar/15  Updated: 16/Mar/15  Resolved: 16/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3119
Fix Version/s: 0.0-3123

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 16/Mar/15 5:34 PM ]

fixed https://github.com/clojure/clojurescript/commit/9a276fb84c135e4199929c08f55e8a986efc72b7





[CLJS-1130] :foreign-libs regression under Closure optimized builds Created: 16/Mar/15  Updated: 16/Mar/15  Resolved: 16/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3117
Fix Version/s: 0.0-3119

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

:foreign-libs support has regressed in master



 Comments   
Comment by David Nolen [ 16/Mar/15 12:48 PM ]

fix https://github.com/clojure/clojurescript/commit/d94e6c6e88541b8cd3d559be4281c76bb8c408d9





[CLJS-1129] :modules tutorial for wiki Created: 16/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Task Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: documentation, newbie


 Description   

The documentation is nice but something that walks people through the steps would be nicer.






[CLJS-1128] Describe internationalization strategies via Google Closure on the wiki Created: 16/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Task Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: documentation, newbie


 Description   

This can be done via Google Closure defines or via pulling a specific locale. A page should document how this can be done.






[CLJS-1127] validate compiled file written to disk Created: 16/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

If we validate the file written to disk then we can catch common error of running multiple build processes and abort.






[CLJS-1126] File are not recompiled when build affecting options changes Created: 16/Mar/15  Updated: 16/Mar/15  Resolved: 16/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3115
Fix Version/s: 0.0-3117

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 16/Mar/15 8:15 AM ]

fixed https://github.com/clojure/clojurescript/commit/badf3cdf6b78cdce8de8b31233b61d76a33b83a0





[CLJS-1125] Simple corrupted compiled file detection Created: 16/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

We should include a line at the end of the file that we check for to determine that the file was not corrupted due to either an incomplete write or a clobbered write. It should be be the SHA of the ClojureScript source it was generated from.






[CLJS-1124] Have cljs.repl.browser/repl-env serve more static file types Created: 16/Mar/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Minor
Reporter: Sander Dijkhuis Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: newbie
Environment:

cljs 0.0-3115


Attachments: Text File CLJS-1124-attempt001.patch     GZip Archive CLJS-1124-test.tar.gz     GZip Archive CLJS-1124-test.tar.gz    

 Description   

I'm developing a webpage using CLJS that can be served statically. To iterate quickly on the script, I'm hosting the page using

(cljs.repl/repl
(cljs.repl.browser/repl-env :static-dir ["." "out/" "img/" "fonts/"])
:watch "src")

I expect images and webfonts from the img/ and fonts/ directories to be served as well, but the server dispatch code only seems to deal with some other file types:

https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/repl/browser.clj#L104

(server/dispatch-on :get
(fn [{:keys [path]} _ _]
(or
(= path "/")
(.endsWith path ".js")
(.endsWith path ".cljs")
(.endsWith path ".map")
(.endsWith path ".html")
(.endsWith path ".css")))
send-static)

Could this be extended to support all types of files in the static directories? Or could more cases be added for .jpg, .woff and .png?

My workaround is to load index.html from a separate static server, and use the REPL server only for the REPL connection. But in this setup, somehow (require my-ns.core :reload) keeps reloading the old code. This problem doesn't occur when I load index.html from the REPL server.



 Comments   
Comment by Sander Dijkhuis [ 16/Mar/15 8:04 AM ]

Here’s a quick first attempt. It tries to serve all static files that can be found. I don’t see downsides to this approach yet.

Now images get downloaded but don’t render. I guess this is because the served files’ Content-Type is wrong: e.g. image/jpeg; charset=utf-8. If I’m not mistaken no charset should be specified, and this requires some more checking in cljs.repl.server/end-and-close.

Is it OK to stretch the experimental server’s use to support binary files, or should I look for a more specialised development server?

Comment by Sander Dijkhuis [ 18/Mar/15 3:35 AM ]

I’m giving up on my patch for now. It’s not enough to remove the charset from the Content-Type header. I guess cljs.repl.browser/send-static needs to be adjusted to deal with binary streams instead of slurping binary files into strings. It should also have a more extensive list of MIME types. But then I’m not sure if cljs wants to be a complete experimentation server.

In the attachment is a minimal test case:
1. put a cljs.jar inside the extracted directory
2. run make
3. open http://localhost:9000/

Comment by Sander Dijkhuis [ 18/Mar/15 3:47 AM ]

(Slightly friendlier version of the test case.)





[CLJS-1123] this-as unexpectedly binds js/window when used within function with post-condition Created: 15/Mar/15  Updated: 16/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Joshua Choi Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Adding a post-condition to any function that uses cljs.core/this-as will unexpectedly cause this-as's "this" symbol to be bound to the root object (e.g., js/window) instead.

(defn f-no-post-condition [argument]
  (this-as this
    (js/console.log argument this)))

(defn f-with-post-condition [argument]
  {:post [true]}
  (this-as this
    (js/console.log argument this)))

(def test-object
  #js {:methodNoPostcondition f-no-post-condition
       :methodWithPostcondition f-with-post-condition})

(f-with-post-condition "A") ; Correctly prints js/window
(.methodNoPostcondition test-object "B") ; Correctly prints test-object
(.methodWithPostcondition test-object "C") ; Incorrectly prints js/window


 Comments   
Comment by David Nolen [ 16/Mar/15 6:17 AM ]

This is almost certainly a different manifestation of CLJS-719.

Comment by Thomas Heller [ 16/Mar/15 6:21 AM ]

Just looked at the generated javascript. As David mentioned the problem is the extra function generated to get the result for the :post condition.

dummy.f_no_post_condition = (function f_no_post_condition(argument){
var this$ = this;
var G__82157 = argument;
var G__82158 = this$;
return console.log(G__82157,G__82158);
});
dummy.f_with_post_condition = (function f_with_post_condition(argument){
var _PERCENT_ = (function (){var this$ = this;
var G__82161 = argument;
var G__82162 = this$;
return console.log(G__82161,G__82162);
})();


return _PERCENT_;
});
dummy.test_object = {"methodWithPostcondition": dummy.f_with_post_condition, "methodNoPostcondition": dummy.f_no_post_condition};
dummy.f_with_post_condition("A");
dummy.test_object.methodNoPostcondition("B");
dummy.test_object.methodWithPostcondition("C");




[CLJS-1122] The "print" REPL option is called with multiple arguments instead of only one. Created: 14/Mar/15  Updated: 15/Mar/15  Resolved: 15/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: grosjean Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None


 Description   

The cljs.repl/repl* function calls the "print" function with multiple arguments. It should always call it with only one argument.



 Comments   
Comment by David Nolen [ 15/Mar/15 8:28 AM ]

The behavior is the same as clojure.main/repl which uses prn which accepts multiple arguments.

Comment by grosjean [ 15/Mar/15 3:17 PM ]

Sorry to insist, but the docstring says : "- :print, function of one argument, prints its argument to the output
default: println". Whether the docstring must be changed or prn must be called with 1 argument.





[CLJS-1121] QuickStart a little unclear for browser REPL Created: 13/Mar/15  Updated: 14/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Brent Vukmer Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Yosemite (10.10.2), Google Chrome


Attachments: File core.cljs     File repl.clj    

 Description   

I'm at the point in the QuickStart where it says "Point your web browser at http://localhost:9000. You should get a REPL."

I don't see the browser REPL when I go to http://localhost:9000, just a blank page. I'm attaching my repl.clj and core.cljs.



 Comments   
Comment by Brent Vukmer [ 14/Mar/15 9:08 AM ]

If "We also need to modify our script to load the browser REPL" refers to core.cljs, it would be clearer to say so.





[CLJS-1120] analyze-deps does not appear to work when analyzing analysis caches Created: 13/Mar/15  Updated: 13/Mar/15  Resolved: 13/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 13/Mar/15 7:19 PM ]

fixed https://github.com/clojure/clojurescript/commit/5d141f724af60353a1813c0ea4b5afab6eea2d57





[CLJS-1119] constant table emission logic is incorrect Created: 13/Mar/15  Updated: 13/Mar/15  Resolved: 13/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

Constant table needs to emitted after the all dependencies have been compiled. This eliminates a fundamental blocker to repeatable advanced compiled builds without a full clean first.



 Comments   
Comment by David Nolen [ 13/Mar/15 6:28 PM ]

fixed https://github.com/clojure/clojurescript/commit/6097d1ce18f61a01b1cf6cfcc14e0071b99e413a





[CLJS-1118] cljs.repl/doc support for protocols Created: 13/Mar/15  Updated: 14/Mar/15  Resolved: 14/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Protocols do not include doc information at all. We should have special doc printing for protocols.



 Comments   
Comment by David Nolen [ 14/Mar/15 1:24 PM ]

fixed https://github.com/clojure/clojurescript/commit/d551a4d18ad056169175df1345e9f30661d3f607





[CLJS-1117] Dependencies in JARs don't use cached analysis Created: 13/Mar/15  Updated: 13/Mar/15  Resolved: 13/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 13/Mar/15 9:27 AM ]

fixed https://github.com/clojure/clojurescript/commit/4a97e048488281f0958ddf60d8fdf503ff9e24eb





[CLJS-1116] Long cold compile times even under :none Created: 12/Mar/15  Updated: 18/Mar/15  Resolved: 18/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3196

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Some users have reported long cold compile times even under none. Compiling in dependency order CLJS-1113 will likely help a lot here. Also redundant analysis of files in JARs CLJS-1117.



 Comments   
Comment by David Nolen [ 14/Mar/15 6:18 AM ]

After the fixes to master it's unclear what more can be done in a reasonable amount of time for the next release. For cold builds it is imperative to analyze all dependencies when recompiling a particular file. For example if a file uses core.async it's not enough to analyze just cljs.core.async because the go macro will use cljs.core.asyn.impl nses (which are required by cljs.core.async. These must be analyzed in order to emit correct errors/warnings.

Comment by David Nolen [ 18/Mar/15 5:41 PM ]

the complaints disappeared with https://github.com/clojure/clojurescript/commit/9a276fb84c135e4199929c08f55e8a986efc72b7





[CLJS-1115] Reusable repl-bootstrap! fn Created: 12/Mar/15  Updated: 13/Mar/15  Resolved: 13/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

The browser REPLs bootstrapping of the target browser is finicky code that shouldn't be copy pasted. It should be split out into a function so that it can be reused easily by REPLs like Weasel.



 Comments   
Comment by David Nolen [ 13/Mar/15 6:29 AM ]

fixed https://github.com/clojure/clojurescript/commit/f0dfb7a9c4aa493f52504a86c8a9e0fd6f0d1cb6





[CLJS-1114] browser REPL script loading race condition Created: 12/Mar/15  Updated: 12/Mar/15  Resolved: 12/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 12/Mar/15 9:13 PM ]

fixed https://github.com/clojure/clojurescript/commit/a78e0009253a7fd5bdf042a037b2c20441fb66ae#





[CLJS-1113] Compile in dependency order Created: 12/Mar/15  Updated: 12/Apr/15  Resolved: 12/Apr/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Because we do not compile in dependency order we do a lot of needless analysis.



 Comments   
Comment by David Nolen [ 14/Mar/15 6:13 AM ]

With the latest changes to master this will only improve the performance of the first compile.

Comment by David Nolen [ 12/Apr/15 4:56 PM ]

as of https://github.com/clojure/clojurescript/commit/e89950e1962d4aece70262dacc7fab6428fb5625, we always compile everything in dependency order. There is a separate further step which is to compile everything at once in order.





[CLJS-1112] :repl-requires option for REPL evaluation environment Created: 12/Mar/15  Updated: 12/Mar/15  Resolved: 12/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Analogous clojure.main/repl-requires. Should be an option to the top-level cljs.repl/repl entry point as well as something which REPL evaluation environments may provide.



 Comments   
Comment by David Nolen [ 12/Mar/15 6:15 PM ]

fixed https://github.com/clojure/clojurescript/commit/ffa7a437ce80f0ebe5f272046f7ae64ed23d1875





[CLJS-1111] browser REPL should have no side effects until -setup Created: 12/Mar/15  Updated: 12/Mar/15  Resolved: 12/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

The current behavior makes customization and configuration completely unintuitive.



 Comments   
Comment by David Nolen [ 12/Mar/15 3:06 PM ]

fixed https://github.com/clojure/clojurescript/commit/9c80de83636a5f879687ecbe306e7a5a6eccce7b





[CLJS-1110] cljs.closure/watch needs to print errors to *err* Created: 12/Mar/15  Updated: 12/Mar/15  Resolved: 12/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 12/Mar/15 2:28 PM ]

fixed https://github.com/clojure/clojurescript/commit/4e9b619096c570c044158f7cb5db927e9868ee95





[CLJS-1109] Record type name and advanced optimization Created: 12/Mar/15  Updated: 12/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Daniel Skarda Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

It is not possible to query type name in advanced compilation.
Code below prints correct record name in other compilation modes, but under advanced compilation it prints constructor source code.

(defrecord FooBar [a])

(def fb (FooBar. 1))

(prn (-> fb))
(prn (-> fb type))
(prn (-> fb type pr-str))





[CLJS-1108] :modules :output-to needs to create directories Created: 11/Mar/15  Updated: 11/Mar/15  Resolved: 11/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 11/Mar/15 3:29 PM ]

fixed https://github.com/clojure/clojurescript/commit/4b80a318c768fe604a7f1e8cb22b47688ed8a13c





[CLJS-1107] Using core.async at the Node.js REPL results in strange errors about undeclared vars in impl namespaces Created: 11/Mar/15  Updated: 11/Mar/15  Resolved: 11/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Not Reproducible Votes: 0
Labels: None


 Description   

Seems like the impl namespaces are not being analyzed. Checking the output directory the compiled artifacts are there.



 Comments   
Comment by David Nolen [ 11/Mar/15 2:47 PM ]

Could not replicate. Appears to be a PEBCAK.





[CLJS-1106] Compile against Clojure 1.5 Created: 11/Mar/15  Updated: 12/Mar/15  Resolved: 11/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Neil Kirsopp Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None

Attachments: Text File compile-1.5.patch    
Patch: Code

 Description   

lein with-profile +1.5 test gives an analysis error. The 2 issues are a typo in cljs.closure/src-file->goog-require and attempting to import if-some and when-some in cljs.core/import-macros.



 Comments   
Comment by David Nolen [ 11/Mar/15 11:24 AM ]

ClojureScript releases now only supports Clojure 1.5, it relies on macros and features now that require it.

Comment by Neil Kirsopp [ 11/Mar/15 11:29 AM ]

Do you mean 1.6? If so, fair enough. I only raised this as the project.clj file has a profile for 1.5. Maybe remove the misleading profile?

Comment by David Nolen [ 11/Mar/15 1:57 PM ]

fixed https://github.com/clojure/clojurescript/commit/5d87ce3c01005170b878733b4b7f7abfd6f57964

Comment by Francis Avila [ 11/Mar/15 2:41 PM ]

You removed the 1.5 profile, but there are still lein aliases that reference the now-deleted 1.5 profile.





[CLJS-1105] Keywords constants munge underscores and dashes Created: 10/Mar/15  Updated: 12/Mar/15  Resolved: 11/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: Daniel Woelfel Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File cljs-1105.patch    

 Description   

With advanced compilation, two keywords that substitute an underscore for a dash will get the same constant.

For example, (println :test_kw) (println :test-kw) will print ":test_kw" ":test_kw".



 Comments   
Comment by Daniel Woelfel [ 10/Mar/15 6:49 PM ]

Relevant commit: https://github.com/clojure/clojurescript/commit/f1326056956d288973964b47ab772ce782ccd21c

Comment by Thomas Heller [ 11/Mar/15 7:37 AM ]

Simple patch that turns "-" into "_DASH_" before calling munge.

Comment by David Nolen [ 11/Mar/15 2:08 PM ]

fixed https://github.com/clojure/clojurescript/commits/master





[CLJS-1104] Compute SHA for ClojureScript compiled file Created: 10/Mar/15  Updated: 10/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Needed for shared AOT cache






[CLJS-1103] :cache-analysis true incompatible with :optimization settings higher than :none Created: 10/Mar/15  Updated: 10/Mar/15  Resolved: 10/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 1
Labels: None


 Comments   
Comment by David Nolen [ 10/Mar/15 5:43 PM ]

fixed
https://github.com/clojure/clojurescript/commit/a79bf61d6d9e34d738777caa1ea6bf93e7ba052f
https://github.com/clojure/clojurescript/commit/57fb9ef28c2947fb7a2a02920ab12645f01ce4f7





[CLJS-1102] clojure.test should print column number of exception when available Created: 09/Mar/15  Updated: 11/Mar/15  Resolved: 11/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Enhancement Priority: Major
Reporter: Nikita Prokopov Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File cljs-1102-cljs-test-print-column.patch    

 Description   

Right now column is calculated, but not printed. This patch adds column printing.



 Comments   
Comment by David Nolen [ 11/Mar/15 2:49 PM ]

fixed https://github.com/clojure/clojurescript/commit/8cf3a53a8c4f7f8a40fcfbdfe4620b870f738de2





[CLJS-1101] cljs.test might throw when trying to detect file-and-line Created: 09/Mar/15  Updated: 12/Mar/15  Resolved: 12/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: Nikita Prokopov Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File cljs-1101-do-not-throw-in-cljs-test-file-and-line-2.patch    

 Description   

Right now on Nashorn failing tests which use cljs.test print this:

(deftest abc
  (is (= 1 2)))

ERROR in (abc) (Error:NaN)
expected: (= 1 2)
  actual:
#<Error: No item 4 in vector of length 0>

That's because nth is used in file-and-line to extract stack-element from exception stack:

(let [stacktrace
              (vec (map string/trim
                     (string/split stack #"\n")))
              stack-element (nth stacktrace depth)
              fname (js-filename stack-element)
              [line column] (js-line-and-column stack-element)
              [fname line column] (mapped-line-and-column fname line column)]
          {:file fname :line line :column column})

This patch adds default value nil to nth call so file-and-line info is ignored if it cannot be parsed.



 Comments   
Comment by Nikita Prokopov [ 09/Mar/15 5:59 AM ]

fixed patch

Comment by David Nolen [ 11/Mar/15 3:00 PM ]

This patch would not apply. Can I get one rebased to master? Thanks.

Comment by Nikita Prokopov [ 12/Mar/15 2:24 AM ]

rebased version

Comment by David Nolen [ 12/Mar/15 10:01 AM ]

fixed https://github.com/clojure/clojurescript/commit/4ddd8780499471cf1066d43afa0036917a42bb84





[CLJS-1100] docstrings with examples for all core protocols Created: 08/Mar/15  Updated: 13/Mar/15  Resolved: 13/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Maria Neise
Resolution: Completed Votes: 0
Labels: newbie

Attachments: File CLJS-1100-core-protocol-docstrings.diff    
Patch: Code

 Comments   
Comment by Maria Neise [ 09/Mar/15 9:13 PM ]

This is a great newbie task, very appreciated. I am working on this right now and plan to attach the patch in the next few days.

Comment by David Nolen [ 11/Mar/15 3:01 PM ]

Maria thanks so much. Can you please send in your Clojure CA so we can assign the ticket to you?

Comment by Maria Neise [ 11/Mar/15 4:56 PM ]

I already signed it two days ago. Let me know if there are any problems with the Clojure CA and I can fill it out again

Comment by Maria Neise [ 12/Mar/15 9:35 PM ]

I attached the patch "CLJS-1100-core-protocol-docstrings.diff", which adds docstrings to the core protocols. I am happy to modify the docstrings if less or more details is required.

Comment by David Nolen [ 13/Mar/15 9:47 AM ]

fantastic, fixed https://github.com/clojure/clojurescript/commit/aea6326254ba30f79cd0daa5b471068427b5529c





[CLJS-1099] Browser REPL should support source mapping Created: 08/Mar/15  Updated: 09/Mar/15  Resolved: 09/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 09/Mar/15 9:28 AM ]

fixed https://github.com/clojure/clojurescript/commit/c9b04e438076bb54395bb32be31d9fa4070468e6

Only IE support is missing, low hanging fruit for a contributor.





[CLJS-1098] Browser REPL needs to support :reload and :reload-all Created: 08/Mar/15  Updated: 08/Mar/15  Resolved: 08/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 08/Mar/15 5:51 PM ]

fixed https://github.com/clojure/clojurescript/commit/7de018dcf616de9f530df031134941872234d2c9





[CLJS-1097] source map url for AOTed cljs.core is wrong Created: 08/Mar/15  Updated: 08/Mar/15  Resolved: 08/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 08/Mar/15 1:30 PM ]

fixed https://github.com/clojure/clojurescript/commit/e752b94b350d457a808a61b4f5d040c2edd94e9b





[CLJS-1096] Update js/Date -equiv and -compare semantics based on Date.valueOf() value Created: 08/Mar/15  Updated: 11/Mar/15  Resolved: 11/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Enhancement Priority: Major
Reporter: Nikita Prokopov Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File cljs-1096-date-equiv-compare.patch    

 Description   

Right now js/Date hash is based on date.valueOf() value. This patch updates js/Date -equiv method and adds -compare to match this semantics. IComparable is useful for dates so they can participate in sorted sets/priority maps/sort fn.



 Comments   
Comment by David Nolen [ 11/Mar/15 3:06 PM ]

fixed https://github.com/clojure/clojurescript/commit/571cbff4a959145414064198e13d2569e3fe840b





[CLJS-1095] UUID to implement IComparable, similar to Java Created: 08/Mar/15  Updated: 11/Mar/15  Resolved: 11/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Enhancement Priority: Major
Reporter: Nikita Prokopov Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File cljs-1095-uuid-icomparable.patch    

 Description   

It's useful to have UUIDs implement IComparable so they can participate in sorted sets, priority maps etc

(deftype UUID [uuid]
  IComparable
  (-compare [_ other]
    (garray/defaultCompare uuid (.-uuid other))))


 Comments   
Comment by David Nolen [ 11/Mar/15 3:09 PM ]

fixed https://github.com/clojure/clojurescript/commit/2bfe320ae3b46546a31144ca80103e7617aeba4e





[CLJS-1094] read option not used by cljs.repl/repl* Created: 08/Mar/15  Updated: 08/Mar/15  Resolved: 08/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: Robert Krahn Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

The read-eval-print function in cljs.repl/repl* ignores the :read option, directly using repl-read. This makes it impossible to have customized repl input feeds.



 Comments   
Comment by David Nolen [ 08/Mar/15 11:14 AM ]

fixed https://github.com/clojure/clojurescript/commit/8ed0640941493de5a68c05706790f14d909f98d6





[CLJS-1093] Better compiler defaults Created: 07/Mar/15  Updated: 08/Mar/15  Resolved: 08/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

:optimizations :none should default to :source-map true, :output-dir should default to "out". cljs.closure/watch should default :verbose true.

This is to enhance the experience out of the box.



 Comments   
Comment by David Nolen [ 08/Mar/15 11:39 AM ]

fixed https://github.com/clojure/clojurescript/commit/0e7671de113ecfb6a1cef5901ce7db9a6126b100





[CLJS-1092] Basic CommonJS processing Created: 07/Mar/15  Updated: 07/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None


 Description   

Given a CommonJS file we should able to produce an IJavaScript map with :requires, :provides, etc.






[CLJS-1091] Compose JavaScript dependency indexes Created: 07/Mar/15  Updated: 07/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Currently hard coded to Google Closure deps.js and the one produced for a build. Users should be able to supply JS dependency indexes that can get merged in.






[CLJS-1090] macros imported from clojure.core missing docs Created: 06/Mar/15  Updated: 12/Mar/15  Resolved: 12/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 12/Mar/15 9:57 AM ]

fixed https://github.com/clojure/clojurescript/commit/70e73c5d7cc38904f11b9c121eaf632a6589c25f





[CLJS-1089] AOT analysis cache has bad :file paths Created: 06/Mar/15  Updated: 06/Mar/15  Resolved: 06/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

Should always emit "cljs/core.cljs", not full path.



 Comments   
Comment by David Nolen [ 06/Mar/15 9:42 PM ]

fixed https://github.com/clojure/clojurescript/commit/0809de97b9c90c2a4681905d8123d8a087cb7f0a





[CLJS-1088] Improve build script to handle AOT core Created: 06/Mar/15  Updated: 07/Mar/15  Resolved: 07/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Task Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 07/Mar/15 3:41 PM ]

fixed https://github.com/clojure/clojurescript/commit/744a92c250542880ecf3c87fc7e9bbae48dfa8c9





[CLJS-1087] with-out-str unexpectedly affected by *print-newline* Created: 06/Mar/15  Updated: 08/Mar/15  Resolved: 08/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Minor
Reporter: Joshua Choi Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: bug


 Description   

Uses of println and prn within with-out-str are affected by the global binding of print-newline. This means that the following:

(with-out-str (println "A") (println "B"))

...unexpectedly returns "AB" rather than "A\nB\n" if (enable-console-print!) or (set! print-newline false) have been called.

This bug was encountered in real code while using with-out-str to capture cljs.test output to display in the UI of an application in which (enable-console-print!) is also used. It can be worked around by using (with-out-str (binding [*print-newline* true] ...)) instead.



 Comments   
Comment by David Nolen [ 08/Mar/15 11:52 AM ]

fixed https://github.com/clojure/clojurescript/commit/fe28e87a960620386494045044f6b76e0374f1bb





[CLJS-1086] Keyword constants should have stable names Created: 06/Mar/15  Updated: 06/Mar/15  Resolved: 06/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: Thomas Heller Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

As mentioned in CLJS-978 the constants handling is still problematic and it doesn't take much to break it.

Here is a step by step example to highlight one issue (Tested against: ClojureScript 0.0-3004)

git clone https://github.com/clojure/clojurescript.git
cd clojurescript
./script/bootstrap
./script/build
mkdir -p test-data/cljs/bug
lein repl

Then in the REPL:

(require '[cljs.closure :as c])

(spit "test-data/cljs/bug/b.cljs" "(ns bug.b) (def just :a-constant)")

(c/build "test-data/cljs" {:output-dir "test-data/out" :optimize-constants true :optimizations :none})

(spit "test-data/cljs/bug/a.cljs" "(ns bug.a) (def also-uses :a-constant)")

(c/build "test-data/cljs" {:output-dir "test-data/out" :optimize-constants true :optimizations :none})

We now have the project in a state where a constant is in the sources but doesn't exist anymore

;; test-data/out/bug/b.js
bug.b.just = cljs.core.constant$keyword$20;
;; test-data/out/bug/a.js
bug.a.also_uses = cljs.core.constant$keyword$40;

;; test-data/out/constants_table.js
cljs.core.constant$keyword$40 = new cljs.core.Keyword(null,"a-constant","a-constant",-1089152345);
;; cljs.core.constant$keyword$20 doesn't exist anymore and if it did we'd have (not (keyword-identical? :a-constant :a-constant))

There are probably more ways to cause this issue but :recompile-dependents is not a solution, neither is "lein clean".



 Comments   
Comment by Thomas Heller [ 06/Mar/15 6:56 AM ]

Oops just realized that this doesn't even use :cache-analysis, well the problem will probably stay the same.

Comment by Thomas Heller [ 06/Mar/15 7:00 AM ]

Confirmed, same problem: (c/build "test-data/cljs" {:output-dir "test-data/out" :optimize-constants true :optimizations :none :cache-analysis true :verbose true})

Comment by Thomas Heller [ 06/Mar/15 7:09 AM ]

Another unrelated thing:

user=> (c/build "test-data/cljs" {:output-dir "test-data/out" :optimize-constants true :optimizations :none :cache-analysis true :verbose true})
Reading analysis cache for file:/Users/zilence/tmp/test-bug/clojurescript/src/cljs/cljs/core.cljs
Analyzing test-data/cljs/bug/a.cljs
Analyzing test-data/cljs/bug/b.cljs
Compiling /Users/zilence/tmp/test-bug/clojurescript/src/cljs/cljs/core.cljs
Using cached cljs.core /Users/zilence/tmp/test-bug/clojurescript/src/cljs/cljs/core.cljs
Compiling /Users/zilence/tmp/test-bug/clojurescript/src/cljs/cljs/core.cljs
Using cached cljs.core /Users/zilence/tmp/test-bug/clojurescript/src/cljs/cljs/core.cljs

Why does it compile core twice?

Comment by David Nolen [ 06/Mar/15 7:25 AM ]

Please don't include unrelated information on tickets. It just makes it more difficult to sift through now and further down the line.

:optimize-constants is not intended to be used with anything other than :advanced. Not enforced but that's the only use case.

Only interested in issues around :advanced and :optimized-constants nothing else.

Comment by David Nolen [ 06/Mar/15 7:26 AM ]

Declined. Only issues where constant optimizations and analysis caches interact badly with advanced optimizations will be considered.

Comment by Thomas Heller [ 06/Mar/15 7:50 AM ]

Wow, I wish you would show a little more consideration. Sorry for the extra noise but that does not justify shooting this down so quickly.

(c/build "test-data/cljs" {:output-to "test-data/out.js" :optimize-constants true :optimizations :advanced :cache-analysis true :verbose true})

EXACTLY THE SAME ISSUE. I only used :none because I don't have to deal with dead code elimination which all of my example code is. Not a single bit of this problem is related to the Closure Compiler which is why :advanced is not really relevant here.

Comment by David Nolen [ 06/Mar/15 7:58 AM ]

Sorry the current state of this ticket is exactly the type of thing that nearly impossible to for me understand or follow given the constantly changing compiler settings, the title of ticket and so on.

Comment by Thomas Heller [ 06/Mar/15 8:01 AM ]

Modified example (just added a console log so it won't DCE):

(spit "test-data/cljs/bug/b.cljs" "(ns bug.b) (def just :a-constant) (.log js/console just)")
(c/build "test-data/cljs" {:output-to "test-data/out.js" :optimize-constants true :optimizations :advanced :cache-analysis true :verbose true :pseudo-names true :pretty-print true})
(spit "test-data/cljs/bug/a.cljs" "(ns bug.a) (def also-uses :a-constant) (.log js/console also-uses)")
(c/build "test-data/cljs" {:output-to "test-data/out.js" :optimize-constants true :optimizations :advanced :cache-analysis true :verbose true :pseudo-names true :pretty-print true})

Result minus the cljs.core stuff:

var $cljs$core$constant$0keyword$0100$$ = new $cljs$core$Keyword$$(null, "a-constant", "a-constant", -1089152345);
console.log($cljs$core$$.$constant$keyword$60$); // <-- not sure if this is :pseudo-names or something else 
console.log($cljs$core$constant$0keyword$0100$$);
Comment by David Nolen [ 06/Mar/15 8:52 AM ]

I don't have a good answer in general for constants but we've never moved beyond keywords as it's the most impactful. In mean time name stability is easy for keywords.

Comment by David Nolen [ 06/Mar/15 8:53 AM ]

fixed https://github.com/clojure/clojurescript/commit/f1326056956d288973964b47ab772ce782ccd21c





[CLJS-1085] Allow to pass test environment to cljs.test/run-all-tests Created: 06/Mar/15  Updated: 15/Mar/15  Resolved: 15/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Enhancement Priority: Major
Reporter: Kimmo Koskinen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Now run-all-tests internally uses run-all-tests. Allowing to pass a custom env (like with run-tests, would allow to use a custom reporter and still be able to select which tests to run with a regex.



 Comments   
Comment by Kimmo Koskinen [ 12/Mar/15 12:37 AM ]

Oops: s/internally uses run-all-tests/internally uses (cljs.test/empty-env)/.

Comment by David Nolen [ 15/Mar/15 9:58 AM ]

fixed https://github.com/clojure/clojurescript/commit/c244759740bcf252ee8f5464a4e465ad482780a8





[CLJS-1084] once a REPL require is borked cannot recover Created: 05/Mar/15  Updated: 05/Mar/15  Resolved: 05/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Not Reproducible Votes: 0
Labels: None


 Description   

Once a (require ...) has failed cannot recover, we should restore the old namespace if this occurs if possible.



 Comments   
Comment by David Nolen [ 05/Mar/15 7:01 PM ]

Can't duplicate this outside of the JS reserved keyword namespace segment issue





[CLJS-1083] cljs.closure/source-for-namespace does not do proper namespace munging Created: 05/Mar/15  Updated: 05/Mar/15  Resolved: 05/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

(require 'foo.bar.function) will not munge function to {{function$}



 Comments   
Comment by David Nolen [ 05/Mar/15 6:40 PM ]

fixed https://github.com/clojure/clojurescript/commit/b7e3935996b4d7d6d255640482b0f4d5fc7fd36f





[CLJS-1082] analysis memoization bug Created: 05/Mar/15  Updated: 05/Mar/15  Resolved: 05/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

cljs.compiler/compile-file removes ns entries from :cljs.analyzer/namespaces in the compilation environment but cljs.analyzer/analyze-file uses :cljs.analyzer/analyzed-cljs as memoization hook. This means namespace analysis will get dropped and never restored.



 Comments   
Comment by David Nolen [ 05/Mar/15 6:43 PM ]

fixed https://github.com/clojure/clojurescript/commit/746bbb1fdbee4d96cf7c88a083f34532c4edfa45





[CLJS-1081] Add script to create uberjar Created: 04/Mar/15  Updated: 04/Mar/15  Resolved: 04/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Task Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 04/Mar/15 6:20 PM ]

fixed https://github.com/clojure/clojurescript/commit/e9ebf731816069112d321226f432f188f13e2576





[CLJS-1080] Analysis cache should keep constants in visit order Created: 04/Mar/15  Updated: 04/Mar/15  Resolved: 04/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Track seen in a set but keep the constants visit order via vector.



 Comments   
Comment by David Nolen [ 04/Mar/15 5:30 PM ]

fixed https://github.com/clojure/clojurescript/commit/547d03217046ad4341276bded320fe64c480bed0





[CLJS-1079] add way to execute arbitrary fn upon watch build completion Created: 04/Mar/15  Updated: 04/Mar/15  Resolved: 04/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

Something which only runs on successful builds



 Comments   
Comment by David Nolen [ 04/Mar/15 5:12 PM ]

fixed https://github.com/clojure/clojurescript/commit/7a3286f1e2775a84476bf2d16eef139d4e4c8822





[CLJS-1078] Nashorn REPL should use persistent code cache Created: 04/Mar/15  Updated: 04/Mar/15  Resolved: 04/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

See https://blogs.oracle.com/nashorn/entry/improving_nashorn_startup_time_using



 Comments   
Comment by David Nolen [ 04/Mar/15 6:14 PM ]

fixed https://github.com/clojure/clojurescript/commit/9e00804036a22084f9aa500ca7a9d6b5b990a341





[CLJS-1077] analyze-deps infinite recursive loop Created: 02/Mar/15  Updated: 03/Mar/15  Resolved: 03/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Mike Fikes Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File CLJS-1077.patch    

 Description   

The first arity of analyze-deps unconditionally invokes itself:

https://github.com/clojure/clojurescript/blob/r2913/src/clj/cljs/analyzer.clj#L1102



 Comments   
Comment by David Nolen [ 03/Mar/15 9:23 AM ]

fixed https://github.com/clojure/clojurescript/commit/42a263f7b9ee780417119d8b63f8fed5f892ffda





[CLJS-1076] :nashorn target Created: 02/Mar/15  Updated: 02/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

To run well on Nashorn the target should supply CLOSURE_IMPORT_SCRIPT as well as setTimeout or setImmediate for core.async.






[CLJS-1075] Generic inline source map support Created: 02/Mar/15  Updated: 02/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Currently hard coded to REPLs. Would simplify jsbin and similar integration.






[CLJS-1074] Externs inference Created: 02/Mar/15  Updated: 02/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Given all externs generally need to be supplied for js/foo we could probably automatically compute externs based on js/foo usage in user code. For this to work correctly we need to account for property access through js/foo i.e. (def Bar js/foo.Bar). This should infer that Bar is also a foreign object. Things gets more complicated for higher order cases, we probably want to support a ^js type hint.

Finally externs inference needs to account for externs likely already supplied by the user - i.e. don't emit dupes, Google Closure will complain.






[CLJS-1073] :dynamic is misspelled as :dyanmic for *target* in core.cljs Created: 02/Mar/15  Updated: 02/Mar/15  Resolved: 02/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Trivial
Reporter: Matthew Davidson Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: cljs, dynamic, target
Environment:

N/A



 Description   

At the top of core.cljs, line 20:

(def ^{:dyanmic true
:jsdoc ["@define {string}"]}
target "default")

I'm not sure there are any consequences so far, since a search doesn't show target being rebound anywhere.



 Comments   
Comment by David Nolen [ 02/Mar/15 2:37 PM ]

thanks https://github.com/clojure/clojurescript/commit/8785fa9c9ff38c0fcebc32757c077070397018b7





[CLJS-1072] Calling .hasOwnProperty("source") in Clojurescript's string/replace will break with ES6 Created: 01/Mar/15  Updated: 02/Mar/15  Resolved: 02/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Matthew Davidson Assignee: Unassigned
Resolution: Completed Votes: 1
Labels: bug, cljs, es6, replace, string
Environment:

Firefox Developer Edition
Mac OS X 10.10.1
Clojurescript 0.0-2913 (but I checked, and it's still present in current master branch)



 Description   

The "replace" function in string.cljs identifies RegExp objects by calling .hasOwnProperty to check for the "source" property. If true, then it's a regex. However, in ES6, the "source" property will become part of the RegExp prototype and not the actual object, so .hasOwnProperty("source") will return false instead.

Documentation on the RegExp change is at http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/source under the "Specifications" section. The change hit Firefox two weeks ago, according to this bug report, https://bugzilla.mozilla.org/show_bug.cgi?id=1120169, so it will still be 2-3 months before it appears in the main release channel. But given that ES6 is aiming for a June release date, we should expect other browsers to show this error soon enough.

To fix the issue, the Javascript "in" operator would work, if there's a way to compile cljs to use it. Otherwise, the next best thing might be to check to see if the "source" property is non-nil. Basically, the test:

(.hasOwnProperty match "source")

could become:

(.-source match)

It's not a major code change at all, but I'm happy to provide a patch and verify tests if you prefer.



 Comments   
Comment by Elliot Block [ 02/Mar/15 12:54 AM ]

Just to slightly summarize/reiterate, this bug means that `string/replace` is always broken if you pass it a RegExp as the `match` (under the new ES6 rules, already live in FF Dev Ed.)

This further breaks plenty of applications, like it immediately breaks the `secretary` router found in many Om apps.

Comment by David Nolen [ 02/Mar/15 7:46 AM ]

fixed https://github.com/clojure/clojurescript/commit/d717b4edea074fcfd3e718a6134238ba26f76f82





[CLJS-1071] Convert symbol keys in :closure-defines to munged strings Created: 01/Mar/15  Updated: 01/Mar/15  Resolved: 01/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 01/Mar/15 9:54 AM ]

fixed https://github.com/clojure/clojurescript/commit/1f023467e95cd081851fbb71601bc2dd639ad002





[CLJS-1070] top-level boolean inference does not work Created: 28/Feb/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Defect Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Problem for using boolean Closure defines



 Comments   
Comment by Francis Avila [ 30/Mar/15 12:02 PM ]

I am unsure if this is the same issue, but forms like ^boolean (js/isFinite n) also do not seem to analyze correctly: if, and, and or will still emit a call to truth_.





[CLJS-1069] Generic :jsdoc support Created: 28/Feb/15  Updated: 28/Feb/15  Resolved: 28/Feb/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

Currently :jsdoc support is not generalized for use. This means users cannot easily leverage Google Closure defines.



 Comments   
Comment by David Nolen [ 28/Feb/15 12:14 PM ]

fixed https://github.com/clojure/clojurescript/commit/3f38fb9507a89b44c5890bb18be635944e7aceca





[CLJS-1068] CLJS_NODE_TARGET define Created: 27/Feb/15  Updated: 28/Feb/15  Resolved: 28/Feb/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

While we have our own means of tracking in the analyzer/compiler this it would be nice to expose a user-land closure define so that users can customize their own code bases now that this is out of scope for conditional reading.



 Comments   
Comment by David Nolen [ 28/Feb/15 12:15 PM ]

fixed https://github.com/clojure/clojurescript/commit/801861cc03d5dc3c783b18a375eec37725e6671b





[CLJS-1067] Shared AOT cache for dependencies in JARs Created: 26/Feb/15  Updated: 27/Feb/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

3rd party library code in JARs shouldn't be recompiled across dev and prod configurations. There should be a shared AOT cache for all builds within a project for all non-project local source.






[CLJS-1066] Rhino REPL regression Created: 26/Feb/15  Updated: 26/Feb/15  Resolved: 26/Feb/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

Uncovered by CLJS-1065



 Comments   
Comment by David Nolen [ 26/Feb/15 8:52 AM ]

fixed https://github.com/clojure/clojurescript/commit/a7d8863c740af6c00b0ffaf7fee992e085acb1b0





[CLJS-1065] Fix inconsistencies in Quick Start Guide Created: 24/Feb/15  Updated: 09/Mar/15  Resolved: 09/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3058

Type: Task Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Good feedback from Micah Martin:

  • Compiler in REPL seems broken: https://gist.github.com/slagyr/7d52ba4ba98e96172456
  • Not interested in Node.js so I skipped all that
  • Development Mode: Okay... this is where I'm confused.
  • The wiki says include 'hello.js'.
  • hello-dev.html explicitely includes goog.base.js.
  • hello-dev.html also requires hello.core.
  • The generated hello.js loads goog.base if it isn't already.
  • out/cljs_deps.js looks like cljsbuild's :output-to file
  • cljbuild doesn't generate anything like sample/hello.js
  • maybe I'll learn about all these difference later in the guide
  • It seems that "Development Mode" requires a modest but significant change in the way the js is included in the page. This is not obvious in the guide. It would be nice if no change was needed.
  • At the end of the Quick Start page... where do I go from here? Would be nice if there was a recomendation.
  • The 'lein cljsbuild' page doesn't address the confusion mentioned above
  • "Source maps" mentions :source-map-path... Am I supposed to add this to [:cljsbuild :builds :name :compiler]? Doesn't seem to do anything.

In the end, I have better picture of the ClojureScript landscape. I see where my assumptions failed me, and huzzah, got source maps working.



 Comments   
Comment by David Nolen [ 26/Feb/15 8:55 AM ]

The Rhino REPL issue has been addressed in master.

Comment by David Nolen [ 03/Mar/15 6:35 PM ]

Master is now setup to build an AOTed uberjar. We should attach this to releases moving forward. Then Quick Start can written in the style of Clojure, just run Java against a single JAR. This in fact considerably cooler than what Google Closure Compiler can offer, we ship with a scripting language which means a command line centric interface can be avoided for the time being and AOT means we can start fast.

Comment by David Nolen [ 09/Mar/15 11:01 AM ]

Quick Start is completely overhauled.

Comment by Khalid Jebbari [ 09/Mar/15 5:35 PM ]

Sorry to post here, I may pollute the issue. I'll be happy to create another one if necessary.

I've followed the Quick Start guide after seeing David's tweet and had a few issues with the browser REPL. It may be due to my lack of knowledge of the CLJS REPL.

1. After adding the foo function (but named it op), I issued {{ (require '[hello-world.core :as hello] :reload) }}, then (hello/foo 2 3). As foo wasn't defined, I got this :

ClojureScript:cljs.user> (hello/foo 2 3)
WARNING: Use of undeclared Var hello-world.core/foo at line 1 <cljs repl>
#<TypeError: hello_world.core.foo is undefined>

2. So I invoked the function with the proper name, op, but got this instead :

ClojureScript:cljs.user> (hello/op 2 3)
#<TypeError: hello_world.core.op is undefined>

3. So I re-require'd the namespace using {{ (require '[hello-world.core :as hello]) }}, and got the exact same result than #3 (yes, without :reload, it may be the reason).

4. I fixed the function name so that it's foo, I invoked it and it worked ! :

ClojureScript:cljs.user> (require '[hello-world.core :as hello])
nil
ClojureScript:cljs.user> (hello/foo 2 3)
5

5. When I realized it may come from my misuse of require, I wanted to read its docs, but no luck :/

ClojureScript:cljs.user> (doc require)
nil

6. I wondered if require had any doc, so I tried twice in a row for the function first, but it worked only the second time :

ClojureScript:cljs.user> (doc first)
nil
ClojureScript:cljs.user> (doc first)
-------------------------
cljs.core/first
([coll])
Returns the first item in the collection. Calls seq on its
argument. If coll is nil, returns nil.
nil

7. Then I tried evaluating {{ (ffirst [1]) }} in the REPL, got the expected error. Then I reload the namespace and changed foo to substract instead of add the number, and got this :

ClojureScript:cljs.user> (require '[hello-world.core :as hello] :reload)
nil
ClojureScript:cljs.user> (hello/foo 2 3)
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
at cljs.repl.server$send_and_close.invoke(server.clj:127)
at cljs.repl.browser$send_for_eval.invoke(browser.clj:43)
at cljs.repl.browser$send_for_eval.invoke(browser.clj:40)
at cljs.repl.browser$browser_eval.invoke(browser.clj:173)
at cljs.repl.browser.BrowserEnv._evaluate(browser.clj:463)
at cljs.repl$evaluate_form.invoke(repl.clj:429)
at cljs.repl$eval_cljs.invoke(repl.clj:500)
at cljs.repl$repl_STAR_$read_eval_print__3959.invoke(repl.clj:722)
at cljs.repl$repl_STAR_$fn_3965$fn_3970.invoke(repl.clj:762)
at cljs.repl$repl_STAR_$fn__3965.invoke(repl.clj:761)
at cljs.compiler$with_core_cljs.invoke(compiler.clj:961)
at cljs.repl$repl_STAR_.invoke(repl.clj:724)
at cljs.repl$repl.doInvoke(repl.clj:842)
at clojure.lang.RestFn.invoke(RestFn.java:486)
at user$eval7.invoke(repl.clj:5)
at clojure.lang.Compiler.eval(Compiler.java:6703)
at clojure.lang.Compiler.load(Compiler.java:7130)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)
at clojure.main$script_opt.invoke(main.clj:336)
at clojure.main$main.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.lang.Var.invoke(Var.java:379)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)

8. Point #7 worked after reloading the page.

ClojureScript:cljs.user> (hello/foo 2 3)
-1

During the process, I often had to reload the page to make things work, but couldn't understand why it was necessary.

I realize there may be several things at the same time in this report : potential bugs, lack of explanations/guidance in the guide, lack of knowledge/mistakes from myself, answers somewhere else in the Wiki (haven't read it yet I admit).

I hope I was as clear as I could as complete beginner in the CLJS REPL world. The funny thing is that I'm comfortable with the CLJ REPL (using Cursive)...

Comment by David Nolen [ 09/Mar/15 6:07 PM ]

I've added REPL special function doc strings.

As to the other issues the browser REPL works best in Chrome & Firefox in my experience, not so well in Safari. And yes refreshing the browser will often set things straight. Further enhancements/fixes will have to await another release, have held off on this one long enough.

Thanks for the report!





[CLJS-1064] ex-info is not printable Created: 24/Feb/15  Updated: 01/Mar/15  Resolved: 01/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   
(str (ex-info "foo" {}))

Fails under master.



 Comments   
Comment by David Nolen [ 01/Mar/15 12:26 PM ]

fixed https://github.com/clojure/clojurescript/commit/de130a335bd761d580d04dadb8a5a43d3c0a35b4





[CLJS-1063] Regression for Rhino REPL part of Quick Start tutorial Created: 24/Feb/15  Updated: 28/Feb/15  Resolved: 28/Feb/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: David Nolen Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None


 Description   

Curiously bin/repljs appears to work. When trying the tutorial we get a bunch of "already declared" errors which seems like a REPL bootstrapping issue.



 Comments   
Comment by David Nolen [ 28/Feb/15 10:24 AM ]

fixed https://github.com/clojure/clojurescript/commit/a7d8863c740af6c00b0ffaf7fee992e085acb1b0





[CLJS-1062] Incorrect deftype/defrecord definition leads to complex error messages Created: 24/Feb/15  Updated: 14/Mar/15  Resolved: 14/Mar/15

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
Fix Version/s: 0.0-3115

Type: Enhancement Priority: Major
Reporter: Julien Eluard Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: File deftype-fields.diff    

 Description   

Every once in a while I forget to define fields in deftype/defrecord. In this case compilation fails with a low level error message hard to understand.
Clojure compilation prints a better error message in this case: "No fields vector given."

I propose to backport Clojure error message.



 Comments   
Comment by David Nolen [ 11/Mar/15 3:10 PM ]

This looks good but can we please get a properly formatted patch with the leading ticket information. Thanks!

Comment by David Nolen [ 14/Mar/15 6:12 AM ]

fixed https://github.com/clojure/clojurescript/commit/18fae8ba1de5a1d997dde34956afc8e1482f5104





[CLJS-1061] Enhanced control over printing configuration Created: 23/Feb/15  Updated: 10/Apr/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3196
Fix Version/s: Next

Type: Enhancement Priority: Major
Reporter: Joel Holdbrooks Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

enable-console-print! is convenient from some developers on a team who like println to print to the console. However, for others, like myself, it is more desirable to print directly to the REPL (e.g. w/in Emacs) instead of the browser console. On occasion enable-console-print! get's checked and can cause errors that result from calling println before the *print-fn* is set. It then becomes a hassle to either comment out the println or the enable-console-print!. Having a disable-console-print! which could restore the previous *print-fn*, whatever that may have been, would be nice to have.

As it currently stands, one must do this manually, which frankly is kind of awkward and not immediately obvious. It is much like having a light you can turn on but not off unless you cut the main power.



 Comments   
Comment by Thomas Heller [ 24/Feb/15 6:01 AM ]

I think the whole print-fn handling is not optimal. The problem is that each namespace can set it and will override the previous setting and the last one wins. While this is most likely one of "my" namespaces and "my" print-fn it may be someone else's while initializing (loading dependant namespaces). So you might run into issues where some log output goes to console and some goes to util.print or whichever other method the library author decided to use. Some libraries already call (enable-console-print!) as the very first thing their namespace.

What I recently added to shadow-build is an option to make this a compiler option (eg. {:print-fn :console}). Code can just use prn, println and never worry about that *print-fn* might not be set. I think this is a very convenient option that can default to :console and one less hurdle new users may stumble over. I don't need to initialize println in Clojure either.

Maybe this option should make it into core.

Comment by David Nolen [ 12/Mar/15 10:03 AM ]

Not going to do disable-console-print!. This ticket is important but it needs further consideration.

Comment by Joel Holdbrooks [ 12/Mar/15 5:39 PM ]

I'm okay with that. I'm just interested in the solution. Thanks for considering it.

Comment by David Nolen [ 15/Mar/15 10:26 AM ]

Putting this in the Backlog for now. It needs more hammock time. More solution ideas welcome on this ticket.