<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Questions without answers in ClojureScript</title>
<link>https://ask.clojure.org/index.php/unanswered/clojurescript</link>
<description>Powered by Question2Answer</description>
<item>
<title>some-&gt; intermediate step suppresses JavaScript extern inference</title>
<link>https://ask.clojure.org/index.php/15232/some-intermediate-suppresses-javascript-extern-inference</link>
<description>&lt;p&gt;ClojureScript does not seem to infer an extern or emit an inference warning for a JavaScript method call after an intermediate &lt;code&gt;some-&amp;gt;&lt;/code&gt; step. &lt;/p&gt;
&lt;p&gt;Advanced compilation then renames the call across an npm boundary and causes a runtime error.&lt;/p&gt;
&lt;p&gt;I reproduced this with ClojureScript 1.12.145 and with an uberjar built from &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/commit/b45dff9f9aeb506864ecb5618ba686ff2ee8de77&quot;&gt;master at &lt;code&gt;b45dff9f&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;Reproduction&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;deps.edn&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:deps {org.clojure/clojure {:mvn/version &quot;1.12.4&quot;}
        org.clojure/clojurescript {:mvn/version &quot;1.12.145&quot;}}
 :paths [&quot;src&quot;]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;package.json&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{&quot;dependencies&quot;:{&quot;formatter-lib&quot;:&quot;file:formatter-lib&quot;},&quot;private&quot;:true}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;formatter-lib/package.json&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{&quot;main&quot;:&quot;index.js&quot;,&quot;name&quot;:&quot;formatter-lib&quot;,&quot;version&quot;:&quot;1.0.0&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;formatter-lib/index.js&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;class Formatter {
  constructor(value) {
    this.value = value;
  }

  toPattern(pattern) {
    return `${this.value}:${pattern}`;
  }
}

module.exports = (value) =&amp;gt; new Formatter(value);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;src/repro/core.cljs&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns repro.core
  (:require [&quot;formatter-lib&quot; :as formatter]))

(set! *warn-on-infer* true)

(defn -main []
  (println (some-&amp;gt; (formatter 42) identity (.toPattern &quot;yyyy&quot;))))

(set! *main-cli-fn* -main)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;build.edn&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:infer-externs true
 :install-deps false
 :main repro.core
 :npm-deps {&quot;formatter-lib&quot; &quot;1.0.0&quot;}
 :optimizations :advanced
 :output-dir &quot;target/out&quot;
 :output-to &quot;target/main.js&quot;
 :target :nodejs}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Run:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npm install
clojure -M -m cljs.main -co build.edn -c repro.core
node target/main.js
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The compile emits no extern inference warning. The generated call is renamed and Node fails:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;TypeError: a.Yb is not a function
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The same result occurs with the uberjar built from master:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;java -cp /path/to/clojurescript/target/cljs.jar:src \
  clojure.main -m cljs.main -co build.edn -c repro.core
node target/main.js
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Control&lt;/h3&gt;
&lt;p&gt;Removing the intermediate &lt;code&gt;identity&lt;/code&gt; step:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(println (some-&amp;gt; (formatter 42) (.toPattern &quot;yyyy&quot;)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;causes the compiler to infer the extern:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;WARNING: Adding extern to Object for property toPattern due to ambiguous expression
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The generated method remains &lt;code&gt;toPattern&lt;/code&gt;, and Node prints:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;42:yyyy
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I expected the version with the intermediate step to infer the same extern, or at least emit a warning that the target type could not be inferred.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15232/some-intermediate-suppresses-javascript-extern-inference</guid>
<pubDate>Mon, 07 Sep 2026 23:32:03 +0000</pubDate>
</item>
<item>
<title>Browser REPL on different port</title>
<link>https://ask.clojure.org/index.php/15170/browser-repl-on-different-port</link>
<description>&lt;p&gt;Clojurescript&#039;s built-in browser REPL is on port 9000 by default but that clashes with ZScaler on my work laptop so I use port 8090 instead. It took a few goes to get it working but now I have it sorted.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;clojure -M -m cljs.main -v -p 8090 -co &#039;{:closure-defines {&quot;clojure.browser.repl.PORT&quot; 8090}}&#039; -c foo.core -r&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;There are some points in the documentation that might benefit from clarification. The &lt;code&gt;-p&lt;/code&gt; flag is not mentioned on &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurescript.org/reference/repl-and-main&quot;&gt;The REPL and main entry points&lt;/a&gt; but seems to serve the same purpose as :port described on &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurescript.org/reference/repl-options&quot;&gt;REPL Options&lt;/a&gt; because this also works:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;clojure -M -m cljs.main -v -ro &#039;{:port 8090}&#039; -co &#039;{:closure-defines {&quot;clojure.browser.repl.PORT&quot; 8090}}&#039; -c foo.core -r&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;What is a little bit surprising is that :port is only mentioned under the Node REPL Options section but applies to browser REPLs too.&lt;/p&gt;
&lt;p&gt;Not really a question in all this but I wanted to share this for others who might get stuck.&lt;/p&gt;
&lt;p&gt;Versions for posterity: Clojure CLI version (deps.clj) 1.12.2.1565 on Windows 11 and ClojureScript 1.11.54.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15170/browser-repl-on-different-port</guid>
<pubDate>Wed, 08 Jul 2026 07:16:39 +0000</pubDate>
</item>
<item>
<title>Missing protocol error will hang on infinite `(range)` input in ClojureScript but not Clojure</title>
<link>https://ask.clojure.org/index.php/15026/missing-protocol-error-infinite-range-clojurescript-clojure</link>
<description>&lt;p&gt;functions like &lt;code&gt;transient&lt;/code&gt;, &lt;code&gt;assoc&lt;/code&gt;, etc  will throw helpful missing-protocol error when receiving invalid input but it will hang if it receives infinite &lt;code&gt;(range)&lt;/code&gt;.&lt;br&gt;
this is related to issue below&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://ask.clojure.org/index.php/14578/even-range-hangs?show=14578#q14578&quot;&gt;https://ask.clojure.org/index.php/14578/even-range-hangs?show=14578#q14578&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;however, missing-protocol only hang in clojurescript but not clojure so I am wondering if this difference is intended.&lt;/p&gt;
&lt;p&gt;example calls that should throws&lt;br&gt;
- &lt;code&gt;(transient (range))&lt;/code&gt;&lt;br&gt;
- &lt;code&gt;(assoc (range) :a 1)&lt;/code&gt;&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/15026/missing-protocol-error-infinite-range-clojurescript-clojure</guid>
<pubDate>Fri, 03 Apr 2026 11:16:47 +0000</pubDate>
</item>
<item>
<title>TypedArrays don&#039;t implement ICounted in cljs</title>
<link>https://ask.clojure.org/index.php/14919/typedarrays-dont-implement-icounted-in-cljs</link>
<description>&lt;p&gt;I just discovered that JS TypedArrays (&lt;code&gt;Uint8Array&lt;/code&gt; et al) do not implement &lt;code&gt;ICounted&lt;/code&gt; out of the box, even though it&#039;s trivial to make them do so. As a result &lt;code&gt;count&lt;/code&gt; doesn&#039;t work on them; this is in contrast to Clojure where &lt;code&gt;count&lt;/code&gt; works on arrays of primitives. Can/should this be added, or is the current behaviour intended?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(count (js/Uint8Array. [1 2 3]))
;; Execution error (Error) at (&amp;lt;cljs repl&amp;gt;:1).
;; No protocol method ICounted.-count defined for type object: 1,2,3
;=&amp;gt; :repl/exception!

(extend-protocol ICounted
 js/Uint8Array 
 (-count [this] (alength this)))
;=&amp;gt; #object [Function]

(count (js/Uint8Array. [1 2 3]))
;=&amp;gt; 3
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14919/typedarrays-dont-implement-icounted-in-cljs</guid>
<pubDate>Thu, 05 Feb 2026 12:37:54 +0000</pubDate>
</item>
<item>
<title>Possible ClojureScript bug: corner case with regex literal compilation</title>
<link>https://ask.clojure.org/index.php/14717/possible-clojurescript-corner-regex-literal-compilation</link>
<description>&lt;p&gt;I&#039;ve found what I believe to be a bug in ClojureScript regarding compilation of certain regex literals to JavaScript, a specific example being &lt;code&gt;#&quot;(?i)&quot;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In some cases, &lt;code&gt;#&quot;(?i)&quot;&lt;/code&gt; will be compiled to the JavaScript syntax &lt;code&gt;//i&lt;/code&gt;, which is in fact &lt;em&gt;not&lt;/em&gt; a JavaScript regex literal, but rather a JavaScript single line comment.  This then comments out all remaining code on the same generated line, resulting in a syntax error when the code is run on a JavaScript runtime.&lt;/p&gt;
&lt;p&gt;This minimal unit test example demonstrates the issue:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;(ns regex-test&lt;/code&gt;&lt;br&gt;
&lt;code&gt;  (:require [cljs.test :refer-macros [deftest testing is]]))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;(deftest failing-test&lt;/code&gt;&lt;br&gt;
&lt;code&gt;  (testing &quot;Minimal reproduction&quot;&lt;/code&gt;&lt;br&gt;
&lt;code&gt;    (is (not (nil? #&quot;(?i)&quot;)))))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;As a side note, it&#039;s worth mentioning that &lt;code&gt;(?i)&lt;/code&gt; is not a valid native JavaScript regex in the first place, so I assume ClojureScript is trying to emulate compatibility with JVM regexes (where this is valid), and converting it to the nearest valid JS equivalent - either &lt;code&gt;(?i:)&lt;/code&gt; (e.g. at the REPL), or &lt;code&gt;//i&lt;/code&gt; (in compiled code, but which is syntactically not a JS regex literal at all).&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14717/possible-clojurescript-corner-regex-literal-compilation</guid>
<pubDate>Sun, 21 Sep 2025 02:59:22 +0000</pubDate>
</item>
<item>
<title>regular expression with Classes for Unicode scripts, blocks, categories and binary properties</title>
<link>https://ask.clojure.org/index.php/14513/regular-expression-classes-unicode-categories-properties</link>
<description>&lt;p&gt;In Clojure, the following expression works fine:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(re-matches #&quot;\p{Lu}&quot; &quot;Á&quot;) ;; =&amp;gt; &quot;Á&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But in Clojurescript, it returns &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;It is not that Javascript doesn&#039;t support that kind of Unicode classess, but you have to activate them explicitly, whether in Java, they are activated by default.&lt;/p&gt;
&lt;p&gt;E.g. In Javascript, the following code returns true:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/\p{Lu}/u.test(&quot;Á&quot;) // =&amp;gt; true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But if I omit the Unicode flag (&lt;code&gt;/u&lt;/code&gt;) I get false:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/\p{Lu}/.test(&quot;Á&quot;) // =&amp;gt; false
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I think this is probably because Clojure Script doesn&#039;t activates the Unicode flag for us.&lt;/p&gt;
&lt;p&gt;If that the case, I think consistency between Clojurescript and Clojure could benefit a lot if the flag is activated by default.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14513/regular-expression-classes-unicode-categories-properties</guid>
<pubDate>Tue, 22 Apr 2025 15:39:14 +0000</pubDate>
</item>
<item>
<title>Is cljs.test swallowing exceptions?</title>
<link>https://ask.clojure.org/index.php/14509/is-cljs-test-swallowing-exceptions</link>
<description>&lt;p&gt;Hi! Thanks for ClojureScript - we&#039;re using it more and more and it&#039;s amazing.&lt;/p&gt;
&lt;p&gt;Something has been bothering me about testing in the repl, and I figured out what it is today.&lt;/p&gt;
&lt;p&gt;Check this out:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;harold@straylight:~/src/cljs-test-exception$ cat deps.edn 
{:deps {org.clojure/clojurescript {:mvn/version &quot;1.11.132&quot;}}}
harold@straylight:~/src/cljs-test-exception$ clj -M --main cljs.main --repl
ClojureScript 1.11.132
cljs.user=&amp;gt; (require &#039;[cljs.test :refer [deftest]])
nil
cljs.user=&amp;gt; (deftest foo [] (throw (js/Error. &quot;oops!&quot;)))
#&#039;cljs.user/foo
cljs.user=&amp;gt; (foo)

ERROR in (foo) (Error:NaN:NaN)
Uncaught exception, not in assertion.
expected: nil
  actual: #object[Error Error: oops!]
nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When I have a test that&#039;s calling into buggy code and an exception is thrown, I don&#039;t get the stack trace.&lt;/p&gt;
&lt;p&gt;Compare this with &lt;code&gt;clojure.test&lt;/code&gt;, which has more helpful output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user&amp;gt; (require &#039;[clojure.test :refer [deftest]])
nil
user&amp;gt; (deftest foo [] (throw (Exception. &quot;Ooops!&quot;)))
#&#039;user/foo
user&amp;gt; (foo)

ERROR in (foo) (NO_SOURCE_FILE:13)
Uncaught exception, not in assertion.
expected: nil
  actual: java.lang.Exception: Ooops!
 at user$fn__10841.invokeStatic (NO_SOURCE_FILE:13)
    user/fn (NO_SOURCE_FILE:13)
    clojure.test$test_var$fn__9894.invoke (test.clj:717)
    clojure.test$test_var.invokeStatic (test.clj:717)
    clojure.test$test_var.invoke (test.clj:708)
    user$foo.invokeStatic (NO_SOURCE_FILE:13)
    user$foo.invoke (NO_SOURCE_FILE:13)
    user$eval10844.invokeStatic (NO_SOURCE_FILE:15)
    user$eval10844.invoke (NO_SOURCE_FILE:15)
    clojure.lang.Compiler.eval (Compiler.java:7700)
    nrepl.middleware.interruptible_eval$evaluator$run__1435$fn__1446.invoke (interruptible_eval.clj:106)
    nrepl.middleware.interruptible_eval$evaluator$run__1435.invoke (interruptible_eval.clj:101)
    nrepl.middleware.session$session_exec$session_loop__1519.invoke (session.clj:230)
    nrepl.SessionThread.run (SessionThread.java:21)
nil
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;p&gt;Maybe cljs.test could be improved to also include this useful information. I believe it would help with repl test/debugging workflows.&lt;/p&gt;
&lt;p&gt;Thanks so much for your time and consideration.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Edit:&lt;/p&gt;
&lt;p&gt;Eugene makes an interesting point in the comments.&lt;/p&gt;
&lt;p&gt;There is a similar difference in exception/error printing:&lt;/p&gt;
&lt;p&gt;In cljs:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;harold@straylight:~/src/cljs-test-exception$ clj -M --main cljs.main --repl
ClojureScript 1.11.132
cljs.user=&amp;gt; (ex-info &quot;hi&quot; {})
#error {:message &quot;hi&quot;, :data {}}
cljs.user=&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In clj:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;user&amp;gt; (ex-info &quot;hi&quot; {})
#error {
 :cause &quot;hi&quot;
 :data {}
 :via
 [{:type clojure.lang.ExceptionInfo
   :message &quot;hi&quot;
   :data {}
   :at [user$eval8563 invokeStatic &quot;NO_SOURCE_FILE&quot; 11]}]
 :trace
 [[user$eval8563 invokeStatic &quot;NO_SOURCE_FILE&quot; 11]
  [user$eval8563 invoke &quot;NO_SOURCE_FILE&quot; 11]
  [clojure.lang.Compiler eval &quot;Compiler.java&quot; 7700]
  [nrepl.middleware.interruptible_eval$evaluator$run__1435$fn__1446 invoke &quot;interruptible_eval.clj&quot; 106]
  [nrepl.middleware.interruptible_eval$evaluator$run__1435 invoke &quot;interruptible_eval.clj&quot; 101]
  [nrepl.middleware.session$session_exec$session_loop__1519 invoke &quot;session.clj&quot; 230]
  [nrepl.SessionThread run &quot;SessionThread.java&quot; 21]]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;However, in the testing case, &lt;code&gt;clojure.test&lt;/code&gt; explicitly prints the stack trace:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojure/blob/fb22fd778a272b034684a4ee94509552b46ee8a9/src/clj/clojure/test.clj#L394&quot;&gt;https://github.com/clojure/clojure/blob/fb22fd778a272b034684a4ee94509552b46ee8a9/src/clj/clojure/test.clj#L394&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;While cljs does not:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/blob/d701b452b3f0b09f13191094bff9d5763a449191/src/main/cljs/cljs/test.cljs#L338-L344&quot;&gt;https://github.com/clojure/clojurescript/blob/d701b452b3f0b09f13191094bff9d5763a449191/src/main/cljs/cljs/test.cljs#L338-L344&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;It does still seem like the Error object is being swallowed, I don&#039;t see a way to gain access to it after running the test that threw.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14509/is-cljs-test-swallowing-exceptions</guid>
<pubDate>Fri, 18 Apr 2025 16:09:48 +0000</pubDate>
</item>
<item>
<title>How to load couple of modules with cljs.loader/load?</title>
<link>https://ask.clojure.org/index.php/13807/how-to-load-couple-of-modules-with-cljs-loader-load</link>
<description>&lt;p&gt;I didn&#039;t expect any problems with the task initially. Just loaded them one by one with cljs.loader/load until....&lt;br&gt;
Until I got &#039;beforeLoadModuleCode called with module module2 while module module1 is loading&#039;&lt;br&gt;
First I realized that load was asynchronous and module loading wasn&#039;t actually finished when load exited. Digging goog.module.ModuleManager left me with an impression that its load() function is capable to queue new module loading until the previous one finishes loading.&lt;/p&gt;
&lt;p&gt;My impression that the problem is that cljs.loader/load calls beforeLoadModuleCode() at the wrong moment of time. It seems that it must be called at the very begining of evaluating the module code, not before it even starts to download it as it is now, i.e., setLoaded is the last instruction of the module and beforeLoadModuleCode must be the first.&lt;br&gt;
However, I&#039;m still unsure I&#039;m getting the whole idea behind ModuleManager correctly so I need a confirmation that I&#039;m correct.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13807/how-to-load-couple-of-modules-with-cljs-loader-load</guid>
<pubDate>Sat, 06 Apr 2024 08:19:03 +0000</pubDate>
</item>
<item>
<title>Clojurescript unable to use arrow constructors in body of defrecord, while Clojure does</title>
<link>https://ask.clojure.org/index.php/13785/clojurescript-unable-arrow-constructors-defrecord-clojure</link>
<description>&lt;p&gt;I get a warning if I try to compile a defrecord where a method tries to call the arrow constructor.&lt;/p&gt;
&lt;p&gt;This:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defrecord Foo [a b]
  SomeProtocol
  (some-method [_]
    (-&amp;gt;Foo new-a new-b)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;gives the message &quot;WARNING: Use of undeclared Var some.ns/-&amp;gt;Foo at line X&quot;. Clojure accepts this form ok.&lt;/p&gt;
&lt;p&gt;If I switch to the dot constructor version, like &lt;code&gt;(Foo. _ _)&lt;/code&gt; it compiles.&lt;/p&gt;
&lt;p&gt;I noticed that in the clj &lt;code&gt;defrecord&lt;/code&gt; macro, the symbols for &lt;code&gt;-&amp;gt;Foo&lt;/code&gt; and &lt;code&gt;map-&amp;gt;Foo&lt;/code&gt; are declared first thing, but in cljs, the related &lt;code&gt;build-positional-factory&lt;/code&gt; and &lt;code&gt;build-map-factory&lt;/code&gt; fns are called at the end, after &lt;code&gt;emit-defrecord&lt;/code&gt;. Perhaps that&#039;s the issue?&lt;/p&gt;
&lt;p&gt;It looks like deftype should have a similar issue, but I haven&#039;t tested it.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13785/clojurescript-unable-arrow-constructors-defrecord-clojure</guid>
<pubDate>Sat, 16 Mar 2024 08:14:12 +0000</pubDate>
</item>
<item>
<title>Incorrect deprecation warnings</title>
<link>https://ask.clojure.org/index.php/13645/incorrect-deprecation-warnings</link>
<description>&lt;p&gt;Using this minimal project, I get deprecation warnings regarding unused library code:&lt;/p&gt;
&lt;p&gt;deps.edn&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;clojure&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:deps {org.clojure/clojurescript {:mvn/version &quot;1.11.54&quot;}
com.taoensso/timbre {:mvn/version &quot;6.3.1&quot;}
}}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;src/hello_world/core.cljs&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;clojure&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns hello-world.core
  (:require [taoensso.timbre :as log]))

(log/info &quot;Hello&quot;)
(println &quot;Hello world!&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;br&gt;
&lt;code&gt;`&lt;/code&gt;clojure&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;yenda@project2503:~/test-warning$ clj -M -m cljs.main -c hello-world.core
WARNING: taoensso.encore/compile-ns-filter is deprecated at line 6125 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/rate-limiter* is deprecated at line 6202 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/rate-limiter* is deprecated at line 6209 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/rate-limiter* is deprecated at line 6211 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/distinctv is deprecated at line 6266 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/-swap-val! is deprecated at line 6306 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/sub-indexes is deprecated at line 6334 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/sub-indexes is deprecated at line 6343 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/sentinel? is deprecated at line 6349 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/singleton? is deprecated at line 6352 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13645/incorrect-deprecation-warnings</guid>
<pubDate>Sun, 28 Jan 2024 16:39:42 +0000</pubDate>
</item>
<item>
<title>Setting `warning-handlers` in a config file fails with &quot;Wrong number of args (3) passed to: clojure.lang.Symbol&quot;</title>
<link>https://ask.clojure.org/index.php/13175/setting-warning-handlers-config-number-passed-clojure-symbol</link>
<description>&lt;p&gt;This config:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:main             warning-handlers
 :warning-handlers [cljs.analyzer/default-warning-handler]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Which set &lt;code&gt;:warning-handlers&lt;/code&gt; to the default as listed in &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurescript.org/reference/compiler-options#warning-handlers&quot;&gt;https://clojurescript.org/reference/compiler-options#warning-handlers&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Compiled using: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -M --main cljs.main --compile-opts compile.edn --compile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Fails with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   {:type clojure.lang.ExceptionInfo,
    :message
    &quot;Wrong number of args (3) passed to: clojure.lang.Symbol at line 1 /Users/danie/matter/source/cljs-config/src/warning_handlers.cljs&quot;,
    :data
    {:file
     #object[java.io.File 0x27f8f1cc &quot;/Users/danie/matter/source/cljs-config/src/warning_handlers.cljs&quot;],
     :line 1,
     :column 1,
     :tag :cljs/analysis-error},
    :at [cljs.analyzer$error invokeStatic &quot;analyzer.cljc&quot; 780]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Full repro here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/danieroux/cljs-config&quot;&gt;https://github.com/danieroux/cljs-config&lt;/a&gt;&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13175/setting-warning-handlers-config-number-passed-clojure-symbol</guid>
<pubDate>Sun, 20 Aug 2023 23:30:21 +0000</pubDate>
</item>
<item>
<title>Why does this work in CLJS but doesn&#039;t in JVM Clojure?</title>
<link>https://ask.clojure.org/index.php/12903/why-does-this-work-in-cljs-but-doesnt-in-jvm-clojure</link>
<description>&lt;p&gt;This looks like a bug in ClojureScript 1.11.54 :&lt;/p&gt;
&lt;p&gt;&lt;code&gt;(conj {} [:a 1] &#039;([:b 2] [:c 3]) &#039;([:d 4]))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;In Clojure on the JVM this is an error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.user&amp;gt; (conj {} [:a 1] &#039;([:b 2] [:c 3]) &#039;([:d 4]))
{:a 1, :b 2, :c 3, :d 4}
cljs.user&amp;gt; :cljs/quit
nil
user&amp;gt; (conj {} [:a 1] &#039;([:b 2] [:c 3]) &#039;([:d 4]))
Execution error (ClassCastException) at user/eval17754 (REPL:25).
class clojure.lang.PersistentVector cannot be cast to class java.util.Map$Entry (clojure.lang.PersistentVector is in unnamed module of loader &#039;app&#039;; java.util.Map$Entry is in module java.base of loader &#039;bootstrap&#039;)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12903/why-does-this-work-in-cljs-but-doesnt-in-jvm-clojure</guid>
<pubDate>Thu, 27 Apr 2023 19:12:03 +0000</pubDate>
</item>
<item>
<title>Issue with ClojureScript macroexpansion equivalence</title>
<link>https://ask.clojure.org/index.php/12389/issue-with-clojurescript-macroexpansion-equivalence</link>
<description>&lt;p&gt;In ClojureScript  forms can&#039;t always be replaced by they macroexpanded forms. This is the case for defrecord and defn on its multi arity version.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; clj -Sdeps &#039;{:deps {org.clojure/clojurescript {:mvn/version &quot;1.11.60&quot;}}}&#039; -M -m cljs.main                                                                          
ClojureScript 1.11.60
                                                                                                                                                   
cljs.user=&amp;gt; (defrecord ARecord [a])                                                                                                                                     
cljs.user/ARecord                                                                                                                                                  

cljs.user=&amp;gt; (macroexpand &#039;(defrecord ARecord [a]))
(let* [] (do (defrecord* ...)))

cljs.user=&amp;gt; (let* [] (do (defrecord* ...)))
WARNING: Wrong number of args (4) passed to ARecord at line 1 &amp;lt;cljs repl&amp;gt;
WARNING: Wrong number of args (4) passed to ARecord at line 1 &amp;lt;cljs repl&amp;gt;
WARNING: Wrong number of args (4) passed to ARecord at line 1 &amp;lt;cljs repl&amp;gt;
WARNING: Wrong number of args (4) passed to ARecord at line 1 &amp;lt;cljs repl&amp;gt;
WARNING: Wrong number of args (4) passed to ARecord at line 1 &amp;lt;cljs repl&amp;gt;
WARNING: Wrong number of args (4) passed to cljs.user/ARecord at line 1 &amp;lt;cljs repl&amp;gt;
WARNING: Wrong number of args (4) passed to cljs.user/ARecord at line 1 &amp;lt;cljs repl&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Same thing happens trying to evaluate the forms resulting from this macroexpansion:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(macroexpand &#039;(defn foo ([a] (foo a 5)) ([a b] (+ a b))))
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12389/issue-with-clojurescript-macroexpansion-equivalence</guid>
<pubDate>Tue, 15 Nov 2022 13:14:49 +0000</pubDate>
</item>
<item>
<title>Can CLJ-1445 (pprint metadata) be ported to ClojureScript?</title>
<link>https://ask.clojure.org/index.php/12174/can-clj-1445-pprint-metadata-be-ported-to-clojurescript</link>
<description>&lt;p&gt;Currently, the &lt;code&gt;*print-meta*&lt;/code&gt; dynamic var works in Clojure but doesn&#039;t work for ClojureScript.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12174/can-clj-1445-pprint-metadata-be-ported-to-clojurescript</guid>
<pubDate>Wed, 07 Sep 2022 19:06:51 +0000</pubDate>
</item>
<item>
<title>Are there any active projects to enable incremental static regeneration for server-rendered cljs/React?</title>
<link>https://ask.clojure.org/index.php/11778/active-projects-enable-incremental-regeneration-rendered</link>
<description>&lt;p&gt;Modern React frameworks like Next.js allow for incremental static regeneration of pages (&lt;a rel=&quot;nofollow&quot; href=&quot;https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration&quot;&gt;https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration&lt;/a&gt;). I’ve looked at projects like Rum which do server-side rendering directly via the JVM, and have seen thheller’s proof of concept for using cljs directly with Next (&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/thheller/next-cljs&quot;&gt;https://github.com/thheller/next-cljs&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Are there any efforts to enable incremental static regeneration for clj/cljs servers with a JVM-based backend? Or, have there been any efforts beyond thheller’s proofs of concept with Gatsby and Next to make an extremely-thin wrapper/compiler library for cljs + React designed explicitly to work well with existing Node.js frameworks?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11778/active-projects-enable-incremental-regeneration-rendered</guid>
<pubDate>Mon, 18 Apr 2022 20:28:39 +0000</pubDate>
</item>
<item>
<title>Warning from library gets emitted to Clojurescript-compiled JS file</title>
<link>https://ask.clojure.org/index.php/11111/warning-from-library-gets-emitted-clojurescript-compiled</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&#039;ve run into a bug where &lt;code&gt;print&lt;/code&gt; output from a library(&lt;code&gt;environ&lt;/code&gt;) is showing up in a compiled JS file.&lt;/p&gt;
&lt;p&gt;I&#039;ve created a repo to reproduce the issue here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/samrat/cljs-warning-bug&quot;&gt;https://github.com/samrat/cljs-warning-bug&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is likely happening because &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/weavejester/environ/blob/master/environ/src/environ/core.cljc#L57&quot;&gt;the library&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/compiler.cljc#L220&quot;&gt;CLJS compiler&lt;/a&gt; are both using print, and the &lt;code&gt;print&lt;/code&gt; is getting invoked during compile-time.&lt;/p&gt;
&lt;p&gt;If there is any other information I could share that might help, I&#039;d be happy to provide it.&lt;br&gt;
Thanks,&lt;br&gt;
Samrat&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/11111/warning-from-library-gets-emitted-clojurescript-compiled</guid>
<pubDate>Tue, 28 Sep 2021 14:14:19 +0000</pubDate>
</item>
<item>
<title>symbol collision bug in clojurescript?</title>
<link>https://ask.clojure.org/index.php/10886/symbol-collision-bug-in-clojurescript</link>
<description>&lt;p&gt;This this expression in a clojurescript repl:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [{:keys [a-b a_b]} {:a-b 0 :a_b 1}] [a-b a_b])
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;will surprisingly return:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[1 1]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I did some further investigation by creating a clean project like in Clojurescript official guide:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns helloworld.core)

;; two identical code blocks

;; first one is at top level
(let [{:keys [a-b a_b]} {:a-b 0 :a_b 1}] [a-b a_b])
;; second one nested inside a function call
(println (let [{:keys [a-b a_b]} {:a-b 0 :a_b 1}] [a-b a_b]))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and compiled with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -M --main cljs.main --compile helloworld.core
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;here&#039;s the js file:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Compiled by ClojureScript 1.10.866 {:optimizations :none}
goog.provide(&#039;helloworld.core&#039;);
goog.require(&#039;cljs.core&#039;);
var map__528_529 = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,&quot;a-b&quot;,&quot;a-b&quot;,-1660985764),(0),new cljs.core.Keyword(null,&quot;a_b&quot;,&quot;a_b&quot;,-1795286609),(1)], null);
var map__528_530__$1 = cljs.core.__destructure_map.call(null,map__528_529);
var a_b_531 = cljs.core.get.call(null,map__528_530__$1,new cljs.core.Keyword(null,&quot;a-b&quot;,&quot;a-b&quot;,-1660985764));
var a_b_532 = cljs.core.get.call(null,map__528_530__$1,new cljs.core.Keyword(null,&quot;a_b&quot;,&quot;a_b&quot;,-1795286609));
new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a_b_531,a_b_532], null);
cljs.core.println.call(null,(function (){var map__533 = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,&quot;a-b&quot;,&quot;a-b&quot;,-1660985764),(0),new cljs.core.Keyword(null,&quot;a_b&quot;,&quot;a_b&quot;,-1795286609),(1)], null);
var map__533__$1 = cljs.core.__destructure_map.call(null,map__533);
var a_b = cljs.core.get.call(null,map__533__$1,new cljs.core.Keyword(null,&quot;a-b&quot;,&quot;a-b&quot;,-1660985764));
var a_b = cljs.core.get.call(null,map__533__$1,new cljs.core.Keyword(null,&quot;a_b&quot;,&quot;a_b&quot;,-1795286609));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [a_b,a_b], null);
})());

//# sourceMappingURL=core.js.map
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;as you can see:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the &lt;code&gt;a-b&lt;/code&gt; and &lt;code&gt;a_b&lt;/code&gt; symbols in first block ended up as &lt;code&gt;var a_b_531&lt;/code&gt; and &lt;code&gt;var a_b_532&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;in the second block they both ended up as &lt;code&gt;var a_b&lt;/code&gt;, therefore their values collided.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I also get the same result with macroexpanded version using &lt;code&gt;cljs.core/let*&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let* [m {:a-b 0, :a_b 1}
       a-b
       (cljs.core/get m :a-b)
       a_b
       (cljs.core/get m :a_b)]
  [a-b a_b])

(println 
 (let* [m {:a-b 0, :a_b 1}
        a-b
        (cljs.core/get m :a-b)
        a_b
        (cljs.core/get m :a_b)]
   [a-b a_b]))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;so we can eliminate the case that something is wrong with &lt;code&gt;cljs.core/let&lt;/code&gt; macro&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10886/symbol-collision-bug-in-clojurescript</guid>
<pubDate>Thu, 29 Jul 2021 11:01:41 +0000</pubDate>
</item>
<item>
<title>How do I prevent REPL from hanging on errors?</title>
<link>https://ask.clojure.org/index.php/10398/how-do-i-prevent-repl-from-hanging-on-errors</link>
<description>&lt;p&gt;I&#039;m using rebel-readline-cljs {:mvn/version &quot;0.1.4&quot;} along with figwheel to autoreload my CLJS.  One thing that cost me a lot of time is that when there&#039;s a serious error such as invoking a method that isn&#039;t defined for the type invoked on the REPL will just hang and refuse all further input.  The only fix is to Cntr^C and kill the session.  This means a complete restart though and I lose all my defs.  Does anyone know what&#039;s going on here and how to stop it?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/10398/how-do-i-prevent-repl-from-hanging-on-errors</guid>
<pubDate>Sun, 04 Apr 2021 04:33:35 +0000</pubDate>
</item>
<item>
<title>Large code output for a large fixed set of strings</title>
<link>https://ask.clojure.org/index.php/9958/large-code-output-for-a-large-fixed-set-of-strings</link>
<description>&lt;p&gt;When I want to encode a fixes large set of strings into the code, using #{...} generates a twice as large code than (set #js [...]) which generates the set at the start. By checking the code output with no optimization, I am getting the following code for #{...}:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;my_set = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1504, [&quot;studio&quot;,null,&quot;etisalat&quot;,null,&quot;mortgage&quot;,null,&quot;xn--gecrj9c&quot;,null,&quot;technology&quot;,null,&quot;nl&quot;,null,&quot;lilly&quot;,null,&quot;wolterskluwer&quot;,null,&quot;schmidt&quot;,null,&quot;hisamitsu&quot;,null,&quot;total&quot;,null,&quot;blue&quot;,null,&quot;aw&quot;,null,&quot;zw&quot;,null,&quot;properties&quot;,null,&quot;amex&quot;,null,&quot;linde&quot;,null,&quot;arpa&quot;,null,&quot;ieee&quot;,null, ... [a lot more] ...,&quot;fairwinds&quot;,null,&quot;lk&quot;,null,&quot;itau&quot;,null], null), null);&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And the following code for (set #js [...]):&lt;/p&gt;
&lt;p&gt;&lt;code&gt;`&lt;/code&gt;my_set = cljs.core.set([&quot;aaa&quot;,&quot;aarp&quot;,&quot;abarth&quot;,&quot;abb&quot;,&quot;abbott&quot;,&quot;abbvie&quot;, ... [a lot more] ...,&quot;yoga&quot;,&quot;yokohama&quot;,&quot;you&quot;,&quot;youtube&quot;,&quot;yt&quot;,&quot;yun&quot;,&quot;za&quot;,&quot;zappos&quot;,&quot;zara&quot;,&quot;zero&quot;,&quot;zip&quot;,&quot;zm&quot;,&quot;zone&quot;,&quot;zuerich&quot;,&quot;zw&quot;]);&lt;code&gt;`&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;(which is further optimized in advanced compilation). For this list of all 1500 TLDs, the former results in 20kB of generated code in advanced mode, and the latter only takes 10kB. Why is inner PersistentArrayMap constructed? Couldn&#039;t just JS array be passed there instead?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9958/large-code-output-for-a-large-fixed-set-of-strings</guid>
<pubDate>Sun, 20 Dec 2020 15:24:38 +0000</pubDate>
</item>
<item>
<title>Update Closure Library</title>
<link>https://ask.clojure.org/index.php/9741/update-closure-library</link>
<description>&lt;p&gt;Available version of Closure Library on maven is from October 2019.&lt;/p&gt;
&lt;p&gt;This is now out of date and is missing modules. ex. &lt;code&gt;goog.url&lt;/code&gt;&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9741/update-closure-library</guid>
<pubDate>Wed, 28 Oct 2020 23:48:51 +0000</pubDate>
</item>
<item>
<title>Recommended webpack config for clojurescript bundle target</title>
<link>https://ask.clojure.org/index.php/9602/recommended-webpack-config-for-clojurescript-bundle-target</link>
<description>&lt;p&gt;I&#039;m trying to port a re-frame app to use the new :bundle target based on the webpack tutorial.  Prior to this I used the approach from the old webpack tutorial.&lt;/p&gt;
&lt;p&gt;I&#039;m finding webpack takes inpractically long (10 minutes) to perform chunk asset optimisation. &lt;/p&gt;
&lt;p&gt;&lt;code&gt;% webpack --progress resources/public/js/index.js -o resources/public/js/app.js
92% chunk asset optimization TerserPlugin
...&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If I configure the TerserPlugin and set compress: false it improves to a few seconds.&lt;/p&gt;
&lt;p&gt;I suspect the slowness is caused by webpack chewing on the ~2mb advanced build output from my app.&lt;/p&gt;
&lt;p&gt;Are there recommended webpack settings to avoid pointless &quot;compress the compressed file&quot; slowness?&lt;/p&gt;
&lt;p&gt;PS.  I&#039;ve created a &lt;a rel=&quot;nofollow&quot; href=&quot;https://gist.github.com/olivergeorge/aa3b7dd8d8826b595bcca293cac6c3bc&quot;&gt;gist with a few of my tests/results&lt;/a&gt;.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9602/recommended-webpack-config-for-clojurescript-bundle-target</guid>
<pubDate>Sun, 13 Sep 2020 22:59:41 +0000</pubDate>
</item>
<item>
<title>find not implemented on transient hashmaps in ClojureScript</title>
<link>https://ask.clojure.org/index.php/9525/find-not-implemented-on-transient-hashmaps-clojurescript</link>
<description>&lt;p&gt;Posting as a followup from a conversation on the Clojurians Slack.&lt;/p&gt;
&lt;p&gt;The following shows that &lt;code&gt;find&lt;/code&gt; is not implemented for ClojureScript on transient maps:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.user=&amp;gt; (def m (transient {}))
#&#039;cljs.user/m
cljs.user=&amp;gt; (def m (assoc! m :a 1))
#&#039;cljs.user/m
cljs.user=&amp;gt; (find m :a)
nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Alex Miller believes that this was addressed in Clojure in &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/projects/CLJ/issues/CLJ-700&quot;&gt;https://clojure.atlassian.net/projects/CLJ/issues/CLJ-700&lt;/a&gt;&lt;br&gt;
That ticket addresses &lt;code&gt;contains?&lt;/code&gt; on transient hash-maps, which is likely similar, but this function already works in ClojureScript:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.user=&amp;gt; (contains? m :a)
true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that &lt;code&gt;(get m :a)&lt;/code&gt; also works.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/9525/find-not-implemented-on-transient-hashmaps-clojurescript</guid>
<pubDate>Wed, 05 Aug 2020 17:30:11 +0000</pubDate>
</item>
<item>
<title>Fresh install Re-natal init MyApp doesn&#039;t work</title>
<link>https://ask.clojure.org/index.php/8435/fresh-install-re-natal-init-myapp-doesnt-work</link>
<description>&lt;p&gt;Hey there.  Just trying to get the default &quot;re-natal init SomeApp&quot; result to work and I&#039;m running into issues.&lt;br&gt;
I&#039;ve installed re-natal and all dependencies as described in the readme at  &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/drapanjanas/re-natal&quot;&gt;https://github.com/drapanjanas/re-natal&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then ran the following after configuring an avd emulator instance and starting it:&lt;br&gt;
$ re-natal use-android-device avd&lt;br&gt;
$ re-natal use-figwheel&lt;br&gt;
$ lein figwheel android&lt;/p&gt;
&lt;p&gt;(seperate terminal)&lt;br&gt;
react-native run-android&lt;/p&gt;
&lt;p&gt;The result is  the following:&lt;/p&gt;
&lt;p&gt;error: bundling failed: SyntaxError: C:\Repositories\dots-world\node_modules\react-native\scripts\figwheel-bridge.js: Unexpected token (75:20)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;at Parser.raise (C:\Repositories\dots-world\node_modules\@babel\parser\lib\index.js:6325:17)
at Parser.unexpected (C:\Repositories\dots-world\node_modules\@babel\parser\lib\index.js:7642:16)
at Parser.parseExprAtom (C:\Repositories\dots-world\node_modules\@babel\parser\lib\index.js:8841:20)
at Parser.parseExprSubscripts (C:\Repositories\dots-world\node_modules\@babel\parser\lib\index.js:8412:23)
at Parser.parseMaybeUnary (C:\Repositories\dots-world\node_modules\@babel\parser\lib\index.js:8392:21)
at Parser.parseExprOps (C:\Repositories\dots-world\node_modules\@babel\parser\lib\index.js:8267:23)
at Parser.parseMaybeConditional (C:\Repositories\dots-world\node_modules\@babel\parser\lib\index.js:8240:23)
at Parser.parseMaybeAssign (C:\Repositories\dots-world\node_modules\@babel\parser\lib\index.js:8187:21)
at Parser.parseParenAndDistinguishExpression (C:\Repositories\dots-world\node_modules\@babel\parser\lib\index.js:8978:28)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The frustrating thing is that everything was working 2 days ago when I first tried to use re-natal init also from a fresh environment.&lt;/p&gt;
&lt;p&gt;Any thoughts?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8435/fresh-install-re-natal-init-myapp-doesnt-work</guid>
<pubDate>Wed, 21 Aug 2019 03:41:44 +0000</pubDate>
</item>
</channel>
</rss>