<< Back to previous view

[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: Next

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: 28/Mar/15  Resolved: 28/Mar/15

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

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





[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: Next

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: 27/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
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: 27/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
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: Next

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: Next

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: Next

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: Next

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: 25/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: Next, 0.0-3126
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: Next
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: Next

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: 23/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
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: 23/Mar/15

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

Type: Defect Priority: Major
Reporter: Nikita Prokopov Assignee: Unassigned
Resolution: Unresolved Votes: 0
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.





[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: Next
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: Next

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: Next

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: Next

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: Next

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: Next

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: Next

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: Next

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: 21/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3126
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: 18/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
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: Next

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: 18/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
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: 28/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
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: Next

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: 17/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
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: 19/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
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: Next

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: 22/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
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: 17/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
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: 17/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
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: 17/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3123
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: 19/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3117
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: 19/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3117
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: 16/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3117
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: 16/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3115
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: 18/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3115
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: Next

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: 16/Mar/15

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

Type: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Unresolved 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.





[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: 30/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3115
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: 15/Mar/15

Status: Open
Project: ClojureScript
Component/s: None
Affects Version/s: 0.0-3058
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.





[CLJS-1060] simplify nREPL integration Created: 23/Feb/15  Updated: 23/Feb/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   

-setup and -teardown need to be elidable. If cljs.env/*compiler* already bound use that. The eval of (ns cljs.user ...) form for auto-import of cljs.repl helpers needs to respect *cljs-ns* and restore it afterwards.






[CLJS-1059] Simple interface wanted to convert cljs forms to js Created: 22/Feb/15  Updated: 23/Feb/15

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

Type: Enhancement Priority: Major
Reporter: Stuart Mitchell Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: analyzer, compiler

Patch: Code

 Description   

In our project (a clojurescript debugger) we want to convert cljs forms or a sequence of forms into javascript so that they can be executed in the javascript console.

We would like something similar to closure/compile-form-seq (https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj#L308)

However, we need to supply, the namespace requires and locals in an env like this

{:ns {:name "test.core" :requires {(quote gstring) (quote goog.string)}} :locals {}}

This code seems to do what we want.

(defn compile-form-seq
    \"Compile a sequence of forms to a JavaScript source string.\"
    [forms env]
    (env/ensure
    (compiler/with-core-cljs nil
      (fn []
        (with-out-str
            (doseq [form forms]
              (compiler/emit (analyzer/analyze env form))))))))

I am not sure why I need env/ensure.

Would you be able to patch compile-form-seq to provide the needed interface, or suggest what we should be doing.

Thanks
Stu



 Comments   
Comment by Mike Thompson [ 22/Feb/15 10:09 PM ]

Just to be clear:
1. when our debugger is at a breakpoint,
2. the user can type in an expression at the repl
3. in response, our debugger has to compile the user-typed-in expression to javascript (and then execute it, showing a result)
4. taking into account any local bindings. <---- this is the key bit.

To satisfy point 4, our tool extracts all the 'locals' from the current call-frame, and then supplies all these local bindings in env/locals, so the compiler doesn't stick a namespace on the front of them.

For example, if there was a local binding for 'x' in the callstack, and the user's repl-entered-expression involves 'x', then we want the compiler to leave the symbol 'x' alone and to not put some namespace on the front of it. In the final javascript, it must still be 'x', not 'some.namespace.x'

Our method to achieve this is to put 'x' into env/locals when compiling – and it all works. Except, with the recent changes this has become more of a challenge. Hence this ticket asking for a way to pass in env.

Comment by Thomas Heller [ 23/Feb/15 3:19 AM ]

You could wrap the user expression in an fn, that would allow you to skip messing with the locals. The REPL basically does the same trick for *1,*2,...

(fn [x]
  ~user-expression-here)




[CLJS-1058] Arities listed in doc output are wrapped in (quote ...) Created: 22/Feb/15  Updated: 23/Feb/15  Resolved: 22/Feb/15

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

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


 Description   

The arities listed in the doc output have an extra (quote ...) wrapping them.

Example:

ClojureScript:cljs.user> (doc +)
-------------------------
cljs.core/+
(quote ([] [x] [x y] [x y & more]))
  Returns the sum of nums. (+) returns 0.
nil


 Comments   
Comment by Mike Fikes [ 22/Feb/15 4:38 PM ]

This is a regression that occurred with the commit for CLJS-1055.

Comment by David Nolen [ 22/Feb/15 11:36 PM ]

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

Comment by Mike Fikes [ 23/Feb/15 6:37 AM ]

Confirmed fixed.





[CLJS-1057] Nashorn REPL should not use EDN rep for errors Created: 22/Feb/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: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Nashorn REPL should just convert the JVM stacktrace into a string form that mirrors JavaScript stack property and implement IParseStacktrace. This seems like pointless work but it simplifies cljs.repl/pst which needs to grab the error value out of Nashorn runtime anyway. The current strategy will not work work cljs.repl/pst.



 Comments   
Comment by David Nolen [ 06/Mar/15 8:30 PM ]

fixed https://github.com/clojure/clojurescript/commit/40d34c5e3450bd335149fffd6f1b4f37d42bea25





[CLJS-1056] declaring an already-defined var clobbers its metadata Created: 22/Feb/15  Updated: 04/Mar/15  Resolved: 03/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: Michael Griffiths Assignee: David Nolen
Resolution: Declined Votes: 0
Labels: None


 Description   

For example, in om.core, path is defined at https://github.com/omcljs/om/blob/master/src/om/core.cljs#L106 and then declared later in the file at https://github.com/omcljs/om/blob/master/src/om/core.cljs#L152. Examining its meta at the REPL using

(meta #'om.core/path)

yields:

{:arglists (),
 :test nil,
 :name path,
 :column 1,
 :line 152,
 :file "resources/public/js/out/om/core.cljs",
 :doc nil,
 :ns om.core}

Note that {:arglists} is empty and {:line} points to the line of the declare.

Examining the compiler env using e.g.

(get-in @cljs.env/*compiler* [:cljs.analyzer/namespaces 'om.core :defs 'path])

yields:

{:file "file:/Users/griffithsm/.m2/repository/om/om/0.6.2/om-0.6.2.jar!/om/core.cljs",
 :line 113,
 :column 1,
 :end-line 113,
 :end-column 23,
 :declared true,
 :test true,
 :name om.core/path}


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

The behavior is the same as Clojure. This bug should be filed with the library.

Comment by Michael Griffiths [ 04/Mar/15 5:01 AM ]

Will do, thanks for looking into it!

Comment by Nicola Mometto [ 04/Mar/15 5:47 AM ]

David, I'm not sure that it is true that this is the same behaviour as Clojure.
In clojure not only

(declare foo)
(defn foo [a])
(:arglists (meta #'foo))

returns ([a]) but every `def` replaces the current var metadata with the new meta.

user=> (def ^:foo foo)
#'user/foo
user=> (meta #'foo)
{:ns #<Namespace user>, :name foo, :file "NO_SOURCE_PATH", :column 1, :line 6, :foo true}
user=> (def ^:bar foo)
#'user/foo
user=> (meta #'foo)
{:bar true, :ns #<Namespace user>, :name foo, :file "NO_SOURCE_PATH", :column 1, :line 9}
Comment by David Nolen [ 04/Mar/15 6:16 AM ]

Nicola none of those cases are what this ticket is about. The ticket is about (declare foo) after defn foo [] ...). There may be other issues but it's not this one.

Comment by Nicola Mometto [ 04/Mar/15 6:33 AM ]

Ah, sorry, I got the declare/defn order wrong reading the ticket description.





[CLJS-1055] cljs.repl/doc should support namespaces and special forms Created: 22/Feb/15  Updated: 22/Feb/15  Resolved: 22/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: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 22/Feb/15 10:11 AM ]

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





[CLJS-1054] add clojure.repl/source functionality to cljs.repl Created: 22/Feb/15  Updated: 22/Feb/15  Resolved: 22/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: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 22/Feb/15 9:09 AM ]

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





[CLJS-1053] REPLs need import special fn Created: 22/Feb/15  Updated: 22/Feb/15  Resolved: 22/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


 Comments   
Comment by David Nolen [ 22/Feb/15 8:21 AM ]

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





[CLJS-1052] Cannot require ns from within the ns at the REPL for reloading purposes Created: 21/Feb/15  Updated: 21/Feb/15  Resolved: 21/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: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 21/Feb/15 9:28 AM ]

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





[CLJS-1051] :modules validation, :output-to should be unique Created: 20/Feb/15  Updated: 12/Mar/15  Resolved: 20/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


 Comments   
Comment by David Nolen [ 20/Feb/15 8:26 PM ]

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





[CLJS-1050] Warn on code that will obviously prevent dead code elimination or cross module code motion Created: 20/Feb/15  Updated: 20/Feb/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   

Might make sense to support a module level flag like *warn-on-reflection*, perhaps *warn-on-deoptimization*? Simple cases of this are top-level data structures and and top-level side effects.






[CLJS-1049] Include macro information in compilation environment Created: 20/Feb/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: David Nolen Assignee: David Nolen
Resolution: Completed Votes: 1
Labels: None


 Description   

The fundamental issue around CLJS-964. Macro information doesn't appear in any of the analysis helpers.



 Comments   
Comment by David Nolen [ 22/Feb/15 12:48 PM ]

This is an important problem. Because this information is missing macros are not of part of the various reflection helpers that are now a big part of ClojureScript REPLs.

Comment by David Nolen [ 06/Mar/15 7:43 AM ]

For various reasons due to the current nature of the compiler actually returning macro information from cljs.analyzer/resolve-var is far more trouble than it's worth. However it is desirable to support the various REPL introspection macros like doc etc. A simple way to support this is to add :macros entries into the compilation environment. For example cljs.core would have both :defs and a :macros entry. This split would prevent macros from appearing in the results of cljs.analyzer/resolve-var but provide a way for cljs.analyzer.api fns to return the union of :defs and :macros for introspection purposes.

Comment by David Nolen [ 06/Mar/15 3:11 PM ]

fixed https://github.com/clojure/clojurescript/commit/68008cc718c924388d8e8396b15a350b16f8ac32





[CLJS-1048] support function values in static vars compile time metadata Created: 20/Feb/15  Updated: 20/Feb/15

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

Type: Enhancement Priority: Minor
Reporter: Ivan Mikushin Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Function values are currently only supported for :test metadata key as a special case.






[CLJS-1047] externs checking for js/foo Created: 19/Feb/15  Updated: 23/Feb/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   

Worth looking into validating `js/foo` forms again the known externs set. Can probably be done by leveraging the Closure JS Parser.



 Comments   
Comment by Michael Griffiths [ 22/Feb/15 12:03 PM ]

Would you consider making the results of parsing available to tooling (e.g. in cljs.env/*compiler*)? I would use this to add support for autocompletion of js/ forms to CIDER.

Comment by David Nolen [ 23/Feb/15 8:15 AM ]

Definitely open to the idea of exposing this information to other tooling when we get there.





[CLJS-1046] static vars do not respect user compile time metadata Created: 18/Feb/15  Updated: 20/Feb/15  Resolved: 20/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: 1
Labels: None

Attachments: Text File 1046.patch     Text File 1046-upd0.patch    

 Description   

We should probably generalize the :test function value support.



 Comments   
Comment by Ivan Mikushin [ 19/Feb/15 7:12 AM ]

I've submitted a patch.

Comment by David Nolen [ 19/Feb/15 7:35 AM ]

Thanks! Have you submitted your CA?

The patch looks good, it doesn't address the case where a user may accidentally include function values but this can be addressed separately in an enhancement ticket.

Comment by Ivan Mikushin [ 19/Feb/15 7:47 AM ]

I've signed the CA before uploading the patch.

Comment by Ivan Mikushin [ 19/Feb/15 8:20 AM ]

I'll add the ticket later today. Can you give me a pointer where to look for the current :test function value support?

Comment by David Nolen [ 19/Feb/15 8:52 AM ]

It will need to be handled in def analyzer case as that's the environment function values must be interpreted in. See https://github.com/clojure/clojurescript/blob/6019e4908b6643cf1e9dd2c403f9bfdf15ab7495/src/clj/cljs/analyzer.clj#L764

Comment by Ivan Mikushin [ 20/Feb/15 6:07 AM ]

CLJS-1048

Comment by Ivan Mikushin [ 20/Feb/15 7:25 AM ]

rebase the patch and rm some noise

Comment by David Nolen [ 20/Feb/15 8:10 AM ]

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

Ivan, I did not use the supplied patch as is because it leaked internal analyzer and compiler metadata into user space. I did copy over the supplied tests.

Let me know if this works for you thanks.

Comment by Ivan Mikushin [ 20/Feb/15 1:21 PM ]

Awesome, thanks! It works great.

Comment by David Nolen [ 20/Feb/15 1:37 PM ]

Ivan glad to hear it! Thanks for the confirmation.





[CLJS-1045] cljs.repl/repl should mirror the expectations and behavior of the standard Clojure REPL as closely as possible Created: 17/Feb/15  Updated: 20/Feb/15  Resolved: 20/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: David Nolen
Resolution: Completed Votes: 1
Labels: None


 Description   

All the differences simply creates trouble and needless indirection for other tooling.



 Comments   
Comment by David Nolen [ 17/Feb/15 4:20 PM ]

Worth investigating if we can't implement cljs REPLs on top the Clojure REPL as suggested by Chas Emerick.

Comment by David Nolen [ 17/Feb/15 8:31 PM ]

Not going to reuse clojure.main/repl it's more trouble than it's worth and we need more options and other contextual things. However the option set that clojure.main/repl accepts is simple, clean and well considered. Happy to make this set the meeting place for the default behavior and customizations needed by tools like nREPL.

Comment by David Nolen [ 20/Feb/15 4:36 PM ]

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





[CLJS-1044] Investigate Closure CommonJS Support Created: 16/Feb/15  Updated: 16/Feb/15

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

Type: Task Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None


 Description   

It appears Google Closure has basic support for CommonJS modules. Apparently mixing CommonJS and Closure style libraries seems somewhat supported but this is not a necessary goal. For our purposes it may be satisfactory to simply allow CommonJS libs to be a part of the build, likely as a separate pass, in which require is compiled away.






[CLJS-1043] top-level locals issues Created: 16/Feb/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: Defect Priority: Major
Reporter: David Nolen Assignee: David Nolen
Resolution: Duplicate Votes: 0
Labels: None


 Description   
(let [x #js {"Foo" #js {"Bar" (fn [])}}
      y (new x.Foo.Bar.)])

x will get renamed and not considered a local. This seems like a fundamental problem with whatever top level let special casing we may have in place.



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

http://dev.clojure.org/jira/browse/CLJS-693





[CLJS-1042] Google Closure Modules :source-map support Created: 15/Feb/15  Updated: 18/Feb/15  Resolved: 18/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: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Should be pretty straightforward but means we probably want to make cljs.closure/emit-optimized-source-map a bit more generic so that it may be reused for this ticket.



 Comments   
Comment by David Nolen [ 18/Feb/15 7:02 PM ]

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





[CLJS-1041] Google Closure Modules :foreign-libs support Created: 15/Feb/15  Updated: 16/Feb/15  Resolved: 16/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   

We should probably just move :foreign-libs into :cljs-base. If a user wants to lock a foreign library to a module they can add it to that module's :entries. If multiple modules need to share some subset of :foreign-libs these should be lifted manually into their own module.



 Comments   
Comment by David Nolen [ 16/Feb/15 9:37 PM ]

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





[CLJS-1040] Source-mapped script stack frames for the Nashorn repl Created: 15/Feb/15  Updated: 15/Feb/15  Resolved: 15/Feb/15

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

Type: Enhancement Priority: Major
Reporter: Pieter van Prooijen Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

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

 Description   

Add the new source map support for stack frames to the Nashorn repl. It now also reports the actual javascript stackframes (when applicable) to exceptions which happen during repl evaluation.



 Comments   
Comment by David Nolen [ 15/Feb/15 9:31 AM ]

fixed https://github.com/clojure/clojurescript/commit/664c8d54599d4e93a598423777bcb7f579099430





[CLJS-1039] Under Emacs source directory watching triggers spurious recompilation Created: 14/Feb/15  Updated: 20/Feb/15  Resolved: 20/Feb/15

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

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


 Description   

Emacs is noisy when it comes to the writing disk. We currently filter out only JS and CLJS files but we probably need to do a little more.



 Comments   
Comment by David Nolen [ 20/Feb/15 4:58 PM ]

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





[CLJS-1038] Namespace aliasing does not appear to work in the built in browser REPL Created: 14/Feb/15  Updated: 21/Feb/15  Resolved: 21/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   

When creating a simple "Hello world" style project, requiring and aliasing the main namespace does not appear to work. Warnings are emitted about the namespace not existing. Sneaking suspicion that this is a code path issue for browser REPL - it's the oldest REPL outside of Rhino and has received the fewest updates.



 Comments   
Comment by David Nolen [ 21/Feb/15 10:11 AM ]

Cannot replicate this on master





[CLJS-1037] cls.analyzer/ns-dependents fails for common cases Created: 13/Feb/15  Updated: 13/Feb/15  Resolved: 13/Feb/15

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

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

CLJS 2843


Attachments: Text File CLJS_1037.patch     Text File CLJS_1037-tests-and-fix.patch    

 Description   

Because of the order of execution in ns-dependents namespaces can be eliminated and not included in the final return set.



 Comments   
Comment by Bruce Hauman [ 13/Feb/15 2:52 PM ]

I attached a patch with the failing test. There are lots of fixes for this I'm going to submit one in just a few.

Comment by Bruce Hauman [ 13/Feb/15 3:19 PM ]

Attached a path with a fix, but would prefer to rewrite the function.

Comment by David Nolen [ 13/Feb/15 3:25 PM ]

fixed https://github.com/clojure/clojurescript/commit/1a67860fa81488ee4692b53dcd3a8de46afa21d3





[CLJS-1036] cljs.closure/build does not find upstream dependencies when called from worker thread Created: 13/Feb/15  Updated: 20/Feb/15  Resolved: 20/Feb/15

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

Type: Defect Priority: Major
Reporter: Michael Griffiths Assignee: Unassigned
Resolution: Completed Votes: 1
Labels: cljs, closure, compiler

Attachments: Text File CLJS-1036--001.patch    

 Description   

Example stacktrace: https://www.refheap.com/97198 (context is using figwheel in a clojure REPL from CIDER)

Because cljs.closure/build calls the 0-arity form of get-upstream-deps, it is implicitly using the current thread's classloader to find the deps.cljs resources. It is then assoc'ing the result into opts, so the caller has no way of gathering the dependencies themselves and passing them in.



 Comments   
Comment by Michael Griffiths [ 13/Feb/15 1:40 PM ]

Patch CLJS-1036--001.patch, attached, uses merge instead of assoc to allow passing of the upstream dependency data via opts.

Comment by Michael Griffiths [ 13/Feb/15 1:45 PM ]

We could also allow passing of a :resources-classloader opt so callers don't have to gather the dependencies themselves, if you'd prefer a patch that does that.

Comment by Bruce Hauman [ 15/Feb/15 2:17 PM ]

This is a problem with calling cljs.closure/build inside nREPL in general when upstream deps are involved.

Comment by David Nolen [ 15/Feb/15 2:34 PM ]

I would like Chas Emerick to chime in on this thread before considering it.

Comment by Chas Emerick [ 16/Feb/15 9:02 AM ]

Could someone point me to a simple (sample?) project that uses upstream dependencies? I haven't used them yet, and don't have such a thing handy.

The proposed patch is confusing to me; if the problem is in resolving dependencies due to classloader state/configuration, how does it help to give opts the opportunity to clobber what get-upstream-deps returns? That is, doesn't this just move the problem downstream to who/whatever is calling build?

Comment by Michael Griffiths [ 16/Feb/15 10:10 AM ]

Chas: yes, the proposed patch simply moves the responsibility to the caller. I was under the assumption that changing how get-upstream-deps/build resolves the classloader by default would be too-breaking of a change, and had not even considered the fact that this might be a broader issue with nREPL itself.

Example usage of get-upstream-deps in the wild (that even mentions classloader issues): https://github.com/immutant/immutant-release/blob/ea538feb548bde86ebce20ec679da7a19b639259/integration-tests/apps/ring/basic-ring/src/basic_ring/core.clj#L51

Note that Weasel (at least) is currently gathering the upstream deps itself too: https://github.com/tomjakubowski/weasel/commit/5cd7009f584100f0d89fc7f00079458bb1f2c016

I'll set up an example project tonight if you like, but I think all you need is to add [cljsjs/react "0.12.2-5"] as a dependency to an existing cljs project and then require [cljsjs.react] in one of its namespaces.

Comment by Bruce Hauman [ 16/Feb/15 1:04 PM ]

Chas, David here is a very quick example:

If you do a

lein new om-mies hello-world
cd hello-world
lein repl
user> (require '[cljs.closure :as cc])
user> (cc/build "src" {})

Assuming lein repl started an nREPL repl. This will produce the error mentioned above. The problem is that om is utilizing the new deps.js facility to autmatically import cljsjs.react. get-upstream-deps depends on being run on the main thread.

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

A solution that fixes this in get-upstream-deps* would be preferable.

Is this simple solution to use the system classloader when not on the main thread:

(if (not= (.getName (Thread/currentThread)) "main")
  (java.lang.ClassLoader/getSystemClassLoader)
  (. (Thread/currentThread) (getContextClassLoader)))

To naive? My experience with Java threads and classloaders is minimal.

Or should we always use the (java.lang.ClassLoader/getSystemClassLoader) in this case?

Comment by Chas Emerick [ 17/Feb/15 3:35 PM ]

Using the system classloader isn't necessary. get-upstream-deps is currently using .findResources, not .getResources; the difference is that the former looks only for matching resources in the target classloader, while the latter first delegates to the parent classloader, and only looks locally if nothing is found there. So, just using .getResources instead will make all current usage work as expected, I think. e.g.

;; `lein repl` nREPL here
user=> (enumeration-seq (.getResources (. (Thread/currentThread) (getContextClassLoader))  "deps.cljs"))
(#<URL jar:file:/home/chas/.m2/repository/cljsjs/react/0.12.2-5/react-0.12.2-5.jar!/deps.cljs>)
user=> (enumeration-seq (.findResources (. (Thread/currentThread) (getContextClassLoader))  "deps.cljs"))
nil

There are some classloader edge cases that might motivate making get-upstream-deps perform a more comprehensive search, explicitly pinging all classloaders for matching resources. This is sometimes necessary for these sorts of scanning scenarios if e.g. a deps.cljs file is available via a parent classloader, which will therefore "shadow" other deps.cljs files in child classloaders. In that case, you need something like cemerick.pomegranate/resources.

Hope that helps.

Comment by David Nolen [ 17/Feb/15 3:46 PM ]

Chas's suggested fix has been committed to master. It works on the simple tests I've run but I'd like to hear more confirmation. Thanks everyone.

https://github.com/clojure/clojurescript/commit/79208f5bf15825a2ba2d0ce95aae6d2b71966494

Comment by David Nolen [ 20/Feb/15 4:36 PM ]

Closing this one. Chas's solution is the correct one.





[CLJS-1035] Built in REPLs and 3rd party REPLs should support :watch option Created: 13/Feb/15  Updated: 13/Feb/15  Resolved: 13/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   

We should try running cljs.closure/watch in a future and see what problems arise. How much coordination do we need if we are auto building and a user can (require ... :reload) at the same time?



 Comments   
Comment by Mike Fikes [ 13/Feb/15 9:59 AM ]

There would probably be interesting interactions of this feature with CLJS-901.

Comment by David Nolen [ 13/Feb/15 2:51 PM ]

fixed https://github.com/clojure/clojurescript/commit/606ccce775706b9f9f6f40ecdcc40d6947226824

Comment by Mike Fikes [ 13/Feb/15 3:44 PM ]

Confirmed fixed.





[CLJS-1034] Support REPL-defined functions in stacktrace infrastructure Created: 12/Feb/15  Updated: 03/Mar/15  Resolved: 03/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: Mike Fikes Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

Some new machinery has recently been added to ClojureScript facilitating dealing with exception stack traces and their source-mapping with the REPL-author-facing documentation here.

As an enhancement, support REPL-defined functions which have namespaces / functions, but no source to refer to. Clojure REPLs accomplish this via NO_SOURCE_FILE; this enhancement ticket asks for the same in ClojureScript.

To accomplish this probably involves expanding the definition of the canonical stactrace format (allowing :file key to me missing or with a nil value, or some such, along with similar ideas for :line and :column), along with some special conditional handling in the underlying source-mapping machinery to conditionally handle REPL-defined functions as a special case.



 Comments   
Comment by Mike Fikes [ 12/Feb/15 8:19 PM ]

A motivating example for this enhancement is detailed in a ticket for the Ambly REPL.

Comment by David Nolen [ 03/Mar/15 6:29 PM ]

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

Comment by Mike Fikes [ 03/Mar/15 6:58 PM ]

Confirmed fixed.

The only issue I could see in testing is that REPL-defined functions appear as munged, but David points out that can be covered with CLJS-937.





[CLJS-1033] take and drop accept nil as n argument Created: 12/Feb/15  Updated: 12/Feb/15

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

Type: Defect Priority: Minor
Reporter: Sean Grove Assignee: Sean Grove
Resolution: Unresolved Votes: 0
Labels: None
Environment:

ClojureScript


Attachments: Text File require-integer-for-take-and-drop.patch    
Patch: Code and Test

 Description   

(take nil [1 2 3]) in Clojure raises an error
In ClojureScript, it's the same as (take 0 [1 2 3])

This patch checks that take and drop both check that n is an integer, so that it doesn't silently behave differently.






[CLJS-1032] Node.js target should support :main Created: 12/Feb/15  Updated: 12/Feb/15  Resolved: 12/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


 Comments   
Comment by David Nolen [ 12/Feb/15 7:48 AM ]

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





[CLJS-1031] Download Closure over https: in ./script/bootstrap Created: 12/Feb/15  Updated: 12/Mar/15  Resolved: 12/Feb/15

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

Type: Enhancement Priority: Trivial
Reporter: Chris Cowan Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None


 Description   

Line 69 of ./script/bootstrap downloads Google's Closure Compiler from http://dl.google.com/closure-compiler/compiler-$CLOSURE_RELEASE.zip, though the URL may be accessed securely over HTTPS too. Could the script be changed to do so?



 Comments   
Comment by David Nolen [ 12/Feb/15 5:58 AM ]

fixed https://github.com/clojure/clojurescript/commit/8b30ecb2327d7942aae1485865fa9540f2eab9e1





[CLJS-1030] Add cljs.repl/pst for printing error values Created: 11/Feb/15  Updated: 22/Feb/15  Resolved: 22/Feb/15

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

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

Attachments: Text File CLJS-1030-2.patch     Text File CLJS-1030-3.patch     Text File CLJS-1030.patch    

 Description   

This would mirror clojure.repl/pst and leverage the new stacktrace mapping support.



 Comments   
Comment by Mike Fikes [ 11/Feb/15 9:04 PM ]

We now have *e and cljs.repl/IParseStacktrace (as well as optional cljs.repl/IPrintStacktrace) support so the pieces needed to do this appear to exist.

Comment by Mike Fikes [ 12/Feb/15 12:33 AM ]

I investigated: Since the values of interest (*e and others) are in the JavaScript engine, but the REPL has the stack trace parsing/mapping/printing support in the Clojure implementation, one approach is to define a new REPL special function, pst.

I was interested in feedback on whether this strategy makes sense, and if so, I'd be happy to pursue fleshing out a proper patch that supports this, mirroring clojure.repl/pst as much as possible.

Defining cljs.repl/pst as:

(defn pst
  ([repl-env env args] (pst repl-env env args nil))
  ([repl-env env args opts]
    (let [desc-js (comp/emit-str (ana/no-warn (ana/analyze env '(pr-str *e) opts)))
          desc-ret  (-evaluate repl-env "filename" 1 desc-js)
          rst-js (comp/emit-str (ana/no-warn (ana/analyze env '(.-stack *e) opts)))
          rst-ret (-evaluate repl-env "filename" 1 rst-js)
          ret {:value (:value desc-ret) :stacktrace (:value rst-ret)}]
      (display-error repl-env ret nil opts))))

and hooking in an appropriate 'pst in the cljs.repl/default-special-fns implementation yields promising behavior that could be polished:

ClojureScript:cljs.user> (ffirst 1)
Error: 1 is not ISeqable
	 cljs.core/seq (.ambly_jsc_repl/cljs/core.cljs:727:13)
	 cljs.core/first (.ambly_jsc_repl/cljs/core.cljs:736:7)
	 cljs.core/ffirst (.ambly_jsc_repl/cljs/core.cljs:1155:3)
nil
ClojureScript:cljs.user> *e
#<Error: 1 is not ISeqable>
ClojureScript:cljs.user> (pst)
#<Error: 1 is not ISeqable>
	 cljs.core/seq (.ambly_jsc_repl/cljs/core.cljs:727:13)
	 cljs.core/first (.ambly_jsc_repl/cljs/core.cljs:736:7)
	 cljs.core/ffirst (.ambly_jsc_repl/cljs/core.cljs:1155:3)

Another approach I tried, but failed with, is to mimic the way doc works; this fails because it doesn't allow you access to the REPL environment.

Comment by David Nolen [ 12/Feb/15 5:53 AM ]

Yeah I don't see how it can easily be done outside of a special function. Happy to see a patch along these lines.

Comment by Mike Fikes [ 14/Feb/15 9:50 PM ]

Patch attached.

Here is a sample run in the Ambly REPL (long paths elided for readability) illustrating exercising various arities:

ClojureScript:cljs.user> (ffirst 1)
Error: 1 is not ISeqable
	 cljs.core/seq (.../cljs/core.cljs:727:13)
	 cljs.core/first (.../cljs/core.cljs:736:7)
	 cljs.core/ffirst (.../cljs/core.cljs:1155:3)
nil
ClojureScript:cljs.user> (pst)
Error: 1 is not ISeqable
	 cljs.core/seq (.../cljs/core.cljs:727:13)
	 cljs.core/first (.../cljs/core.cljs:736:7)
	 cljs.core/ffirst (.../cljs/core.cljs:1155:3)

ClojureScript:cljs.user> (pst 2)
Error: 1 is not ISeqable
	 cljs.core/seq (.../cljs/core.cljs:727:13)
	 cljs.core/first (.../cljs/core.cljs:736:7)

ClojureScript:cljs.user> (def foo *e)
#<Error: 1 is not ISeqable>
ClojureScript:cljs.user> (pst foo)
Error: 1 is not ISeqable
	 cljs.core/seq (.../cljs/core.cljs:727:13)
	 cljs.core/first (.../cljs/core.cljs:736:7)
	 cljs.core/ffirst (.../cljs/core.cljs:1155:3)

ClojureScript:cljs.user> (pst foo 1)
Error: 1 is not ISeqable
	 cljs.core/seq (.../cljs/core.cljs:727:13)
Comment by Mike Fikes [ 15/Feb/15 8:41 AM ]

I'm going to submit a simpler patch that employs (.-message e) eliminating the additional function that strips the unreadable bits off.

Comment by Mike Fikes [ 15/Feb/15 9:00 AM ]

Simpler patch that uses (.-message e) and additionally strips description off front of stacktrace if it is already there (otherwise it appears twice in Node REPL).

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

I upgraded to Node v0.12.0 and the patches in this ticket are somewhat thwarted by the same kind of stuff described at the bottom of CLJS-1018.

Comment by David Nolen [ 15/Feb/15 9:27 AM ]

Mostly looks good but even with the second patch I still see the error twice at the top. I tested using rlwrap ./scripts/noderepljs in the project repo.

Comment by Mike Fikes [ 15/Feb/15 9:34 AM ]

Right. The code to eliminate the double message worked under the previous version of node. Under Node v0.12.0 the (.-message e) is no longer strictly the first part of what is in the stack trace text.

For this aspect, it makes me feel that, just like parsing of the stack trace into a canonical vector form is delegated to REPLs, the same is perhaps the right approach here for the message part. Dunno yet, but it is feeling like a bit of a mess with the Node v0.12.0 error indicator appearing in parts of the message and stack trace making naive processing fragile.

I have no problem holding off on this patch if your opinion is that this needs to be better addressed. (We just need to sort out where to address it.)

Comment by Mike Fikes [ 15/Feb/15 11:58 AM ]

Third patch eliminates the doubling in Node.js REPL. The way it accomplishes this is to synthesize the first part of what a Node.js stack looks like and to remove it if it finds a match.

I've tested this on Node v0.12.0 and v0.10.25, as well as Ambly, and it works.

The negative is that this essentially has a little of Node v0.12.0 aspects in the base ClojureScript real code.

Comment by David Nolen [ 22/Feb/15 12:45 PM ]

fixed https://github.com/clojure/clojurescript/commit/5218a4f4d88db4483eefea80da66acfac20cc907





[CLJS-1029] Investigate how ns aliasing can be supported in ClojureScript macro files Created: 11/Feb/15  Updated: 11/Feb/15

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

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


 Description   

Currently we just require the file. Perhaps possible to control compilation of the macro file such that ClojureScript ns aliases are established. This may not bear fruit but worth thinking about.



 Comments   
Comment by David Nolen [ 11/Feb/15 4:05 PM ]

Any design ideas along this path needs to keep .cljc files in mind.





[CLJS-1028] Roll back "single-segmented namespace" warning Created: 10/Feb/15  Updated: 10/Feb/15  Resolved: 10/Feb/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: Declined Votes: 0
Labels: None


 Description   

This is about changed merged from CLJS-1004

I don't see why single-segment namespace is bad. Something like (ns rum) can have collision with <div id=rum>, but either can (ns rum.id) or (ns rum.lang) or ns rum.style.display).

If our goal is really robust semantic for namespaces, maybe it will be better to provide some warning when (require) instruction references non-ns object (I assume we can identify at runtime if JS object is ns or not?).

Anyway, I think CLJS-1004 patch should be rolled back



 Comments   
Comment by David Nolen [ 10/Feb/15 12:47 PM ]

We're not rolling this back. Single segment namespaces have many potential problems.

Comment by Nikita Prokopov [ 10/Feb/15 1:18 PM ]

Not for the sake of argue, but can you name a few? I really want to understand the subject

Comment by David Nolen [ 10/Feb/15 1:26 PM ]

Clashes with global objects & classpath problems. By using two or more segments you are exponentially decreasing the likelihood of either surfacing in your program.

This will not be rolled back. Disable the warning with the compiler flag if you want to suppress the warning. For third party libraries it's simply too bad. This anti-pattern has never been encouraged in Clojure ever.





[CLJS-1027] server side source map helper for mapping canonicalized stack traces under :none & concatenating builds Created: 10/Feb/15  Updated: 11/Mar/15  Resolved: 11/Mar/15

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

Type: Defect Priority: Minor
Reporter: David Nolen Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None


 Comments   
Comment by David Nolen [ 11/Mar/15 2:24 PM ]

Nothing preventing anyone from reusing cljs.repl functionality to do this given JS stacktrace.





[CLJS-1026] CLJS Repl doesn't respond well to clients refreshing. Created: 10/Feb/15  Updated: 10/Feb/15  Resolved: 10/Feb/15

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

Type: Defect Priority: Minor
Reporter: Bruce Hauman Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None
Environment:

CLJS 2815



 Description   

It's not uncommon for CLJS browser clients to be refreshed. This blows away the cljs.user data on the client side. And this results in the REPL erroring whenever the repl user tries to define something in the cljs.user ns in the REPL.

I solved this in figwheel repl client code by ensuring that there is at least an empty #js {} in cljs.user before evaling code sent from the REPL.

I also require cljs.repl in my figwheel repl client code to ensure its existence through reload.



 Comments   
Comment by David Nolen [ 10/Feb/15 9:36 AM ]

Is there any reason you can't resend the init client state form, (ns cljs.user ...), when the client connects again? The existing REPL infrastructure sends it once for you but having to resend on reconnect is kind of a issue specific to certain kinds of REPLs semantics.

Comment by Bruce Hauman [ 10/Feb/15 10:44 AM ]

Yeah, Say I'm in IJavaScript/-evaluate because a connection was lost and I'm waiting for a new one, after connect I'll have to call cljs.repl/evaluate-form? It just doesn't seem like the best place to do it. It seems like strange behavior could result in certain circumstances.

Does my solution above not work?

Comment by David Nolen [ 10/Feb/15 11:34 AM ]

This one is out of scope.





[CLJS-1025] Source mapping could support clients more generally. Created: 10/Feb/15  Updated: 11/Feb/15  Resolved: 11/Feb/15

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

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


 Description   

Currently print-mapped-stacktrace takes a path from the root of the project.

(print-mapped-stacktrace
  [{:file "samples/hello/out/hello/core.js" <-- path from project root
    :function "first"
    :line 2
    :column 1}]))

Some clients are getting their code from a server and thus don't have project root relative paths.

In fact, the client side paths can be arbitrary in a way that is difficult and non trivial
for repl server code like IJavaScriptEnv's to deduce the correct project root path from.

For instance if a browser (figwheel) client is getting its code from localhost/arbtirary/path/to/example/core.js
but :output-dir is "out"