<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions in ClojureScript</title>
<link>https://ask.clojure.org/index.php/questions/clojurescript</link>
<description></description>
<item>
<title>TypedArrays don'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's trivial to make them do so. As a result &lt;code&gt;count&lt;/code&gt; doesn'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>false positive warning: &quot;cljs.core/+, all arguments must be numbers&quot;</title>
<link>https://ask.clojure.org/index.php/14870/false-positive-warning-cljs-core-all-arguments-must-numbers</link>
<description>&lt;p&gt;The &lt;code&gt;inc&lt;/code&gt; function below will never receive a nil, but falsely warns that it might:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version &quot;1.12.134&quot;}}}' -M -m cljs.main -re node
ClojureScript 1.12.134

cljs.user=&amp;gt; (some-&amp;gt; 1 (#(when (pos? %) %)) inc)
WARNING: cljs.core/+, all arguments must be numbers, got [#{nil clj-nil} number] instead at line 1 &amp;lt;cljs repl&amp;gt;
2
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14870/false-positive-warning-cljs-core-all-arguments-must-numbers</guid>
<pubDate>Tue, 06 Jan 2026 16:51:22 +0000</pubDate>
</item>
<item>
<title>ClojureScript :preloads doesn't work with just cljs.main --repl</title>
<link>https://ask.clojure.org/index.php/14863/clojurescript-preloads-doesnt-work-with-just-cljs-main-repl</link>
<description>&lt;p&gt;Running cljs.main with just &lt;code&gt;--repl&lt;/code&gt; doesn't preload whatever is on :preloads.&lt;/p&gt;
&lt;p&gt;Given that the quickest way of trying ClojureScript is by running a command like :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version &quot;1.12.134&quot;}}}}' -M -m cljs.main --repl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;it would be great (and I think expected) to be able to run a repl with some dev tooling, like :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version &quot;1.12.134&quot;} binaryage/devtools {:mvn/version &quot;1.0.7&quot;}}}}' -M -m cljs.main -co '{:preloads [devtools.preload]}' --repl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but it doesn't work.&lt;/p&gt;
&lt;p&gt;It reads the file (it complains if you misspell the preload namespace) but then nothing gets loaded.&lt;/p&gt;
&lt;p&gt;The problem seems to be related to ClojureScript not compiling the preload namespace when you run with just --repl&lt;/p&gt;
&lt;p&gt;If you create a small single file project (like on the start guide) and then do :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version &quot;1.12.134&quot;} binaryage/devtools {:mvn/version &quot;1.0.7&quot;}}}}' -M -m cljs.main -co '{:preloads [devtools.preload]}' --compile hello-world.core --repl
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;it works.&lt;br&gt;
After the compile generates the &lt;code&gt;out&lt;/code&gt; folder you can run just with &lt;code&gt;--repl&lt;/code&gt; and the preload will work.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14863/clojurescript-preloads-doesnt-work-with-just-cljs-main-repl</guid>
<pubDate>Wed, 24 Dec 2025 15:13:56 +0000</pubDate>
</item>
<item>
<title>`(max &quot;x&quot; &quot;y&quot;)` used to return &quot;y&quot;, now it returns &quot;x&quot;</title>
<link>https://ask.clojure.org/index.php/14847/max-x-y-used-to-return-y-now-it-returns-x</link>
<description>&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;With cljs 1.12.42:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.user=&amp;gt; (max &quot;x&quot; &quot;y&quot;)
&quot;y&quot;
cljs.user=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With cljs 1.12.134:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.user=&amp;gt; (max &quot;x&quot; &quot;y&quot;)
&quot;x&quot;
cljs.user=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Probably related to &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJS-3425&quot;&gt;CLJS-3425&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/commit/274701280de787b598071460cdac0a3709a5bc11&quot;&gt;this commit&lt;/a&gt; which added &lt;code&gt;NaN&lt;/code&gt; checks:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn ^number max
  &quot;Returns the greatest of the nums.&quot;
  ([x] x)
  ([x y]
   (cond
     (NaN? x) x
     (NaN? y) y
     (&amp;gt; x y) x
     :else y))
  ([x y &amp;amp; more]
   (reduce max (cljs.core/max x y) more)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.user=&amp;gt; (NaN? &quot;x&quot;)
true
cljs.user=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hence the result.&lt;/p&gt;
&lt;p&gt;Not sure what the expected result should be since min/max are only supposed to work with numbers but current behavior is surprising.&lt;/p&gt;
&lt;p&gt;See also: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jank-lang/clojure-test-suite/pull/839&quot;&gt;https://github.com/jank-lang/clojure-test-suite/pull/839&lt;/a&gt;.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14847/max-x-y-used-to-return-y-now-it-returns-x</guid>
<pubDate>Mon, 22 Dec 2025 13:45:04 +0000</pubDate>
</item>
<item>
<title>How does `parents` work for JavaScript inheritance?</title>
<link>https://ask.clojure.org/index.php/14764/how-does-parents-work-for-javascript-inheritance</link>
<description>&lt;p&gt;Hello &lt;/p&gt;
&lt;p&gt;In Clojure, I can do:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(parents String)
; #{java.lang.constant.ConstantDesc java.lang.Object java.lang.CharSequence java.io.Serializable java.lang.constant.Constable java.lang.Comparable}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But in ClojureScript:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(parents js/String)
; nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;ClojureScript's &lt;code&gt;parents&lt;/code&gt; doc does mention &quot;JavaScript type inheritance&quot;: &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Returns the immediate parents of tag, &lt;strong&gt;either via a JavaScript type&lt;br&gt;
inheritance relationship&lt;/strong&gt; or a relationship established via derive. h&lt;br&gt;
must be a hierarchy obtained from make-hierarchy, if not supplied&lt;br&gt;
defaults to the global hierarchy&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Is there something wrong with the syntax I used?&lt;/p&gt;
&lt;p&gt;Is &lt;code&gt;parents&lt;/code&gt; really supposed to work with JavaScript inheritance on ClojureScript?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14764/how-does-parents-work-for-javascript-inheritance</guid>
<pubDate>Sun, 23 Nov 2025 14:28:23 +0000</pubDate>
</item>
<item>
<title>`derive [tag] [parent]` accepts non namespaced keyword/symbol as `tag` ?</title>
<link>https://ask.clojure.org/index.php/14759/derive-tag-parent-accepts-non-namespaced-keyword-symbol-tag</link>
<description>&lt;p&gt;Hello &lt;/p&gt;
&lt;p&gt;&lt;code&gt;derive&lt;/code&gt;'s doc says:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Establishes a parent/child relationship between parent and&lt;br&gt;
  tag. &lt;strong&gt;Parent must be a namespace-qualified symbol or keyword and&lt;br&gt;
  child can be either a namespace-qualified symbol or keyword or a&lt;br&gt;
  class.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;But in practice,  ClojureScript accepts non-namespaced tag:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(derive :a ::b)
; nil
(isa? :a ::b)
; true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Clojure throws.&lt;/p&gt;
&lt;p&gt;Is ClojureScript behavior expected or a bug?&lt;/p&gt;
&lt;p&gt;Same question for the &lt;code&gt;derive [h tag parent]&lt;/code&gt; form, which seems to accept non-namespaced keyword/symbol for both tag and parent, this time on both Clojure and ClojureScript:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(derive (make-hierarchy) :a :b)
; {:parents {:a #{:b}}, :ancestors {:a #{:b}}, :descendants {:b #{:a}}}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14759/derive-tag-parent-accepts-non-namespaced-keyword-symbol-tag</guid>
<pubDate>Wed, 19 Nov 2025 21:23:15 +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'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'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>Cannot compile namespace including `+` in clojurescript</title>
<link>https://ask.clojure.org/index.php/14551/cannot-compile-namespace-including-in-clojurescript</link>
<description>&lt;p&gt;Trying to compile any namespace including &lt;code&gt;+&lt;/code&gt; fails in clojurescript&lt;/p&gt;
&lt;p&gt;e.g.:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(ns test+.core)

(println &quot;Hello, World!&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;compiled with clojurescript &quot;1.12.42&quot; &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -M --main cljs.main --compile test+.core
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;results in&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; `Namespace test+.core does not exist.`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Trying to include the namespace from another gives:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Unexpected error (ExceptionInfo) compiling at (REPL:1).
No such namespace: test+.core, could not locate test_PLUS_/core.cljs, test_PLUS_/core.cljc, or JavaScript source providing &quot;test+.core&quot; (Please check that namespaces with dashes use underscores in the ClojureScript file name) in file /home/sigvesn/clojure/cljs-test/src/other.cljs
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that it is possible to compile the namespace from regular clojure.&lt;/p&gt;
&lt;p&gt;This is relevant because the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/tonsky/clojure-plus/&quot;&gt;clojure walk library&lt;/a&gt;  uses &lt;code&gt;+&lt;/code&gt; in the namespace&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/sigvesn/cljs-ns-special-char-error&quot;&gt;Repo with code to reproduce &lt;/a&gt;&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14551/cannot-compile-namespace-including-in-clojurescript</guid>
<pubDate>Tue, 20 May 2025 10:12:48 +0000</pubDate>
</item>
<item>
<title>Bug in Clojurescript string/split with limit?</title>
<link>https://ask.clojure.org/index.php/14514/bug-in-clojurescript-string-split-with-limit</link>
<description>&lt;p&gt;This seems like a bug to me? Using limit in clojure.string/split (in Clojurescript) gives the wrong result on a simple split.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;;; NB Clojurescript
(clojure.string/split &quot;a|b&quot; #&quot;|&quot;)
;=&amp;gt; [&quot;a&quot; &quot;|&quot; &quot;b&quot;]
(clojure.string/split &quot;a|b&quot; #&quot;|&quot; 3)
;=&amp;gt; [&quot;&quot; &quot;&quot; &quot;a|b&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Results should be the same?&lt;/p&gt;
&lt;p&gt;Corresponding code in Javascript&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&quot;a|b&quot;.split(/|/)
;=&amp;gt; ['a', '|', 'b']
&quot;a|b&quot;.split(/|/, 3)
;=&amp;gt; ['a', '|', 'b']
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14514/bug-in-clojurescript-string-split-with-limit</guid>
<pubDate>Wed, 23 Apr 2025 12:03:38 +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'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'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're using it more and more and it'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 '[cljs.test :refer [deftest]])
nil
cljs.user=&amp;gt; (deftest foo [] (throw (js/Error. &quot;oops!&quot;)))
#'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's calling into buggy code and an exception is thrown, I don'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 '[clojure.test :refer [deftest]])
nil
user&amp;gt; (deftest foo [] (throw (Exception. &quot;Ooops!&quot;)))
#'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'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>Protocol function with placeholder _ arguments doesn't work as in Clojure</title>
<link>https://ask.clojure.org/index.php/14469/protocol-function-with-placeholder-arguments-doesnt-clojure</link>
<description>&lt;p&gt;A protocol like below will work in Clojure without issue, but in ClojureScript the _'s will apparently (quietly) override each other left to right.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defprotocol Linkable
  (-href [_ _ _]))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Even if the extend-protocol has unique names for the args, the dispatch seems to happen on the last argument.&lt;/p&gt;
&lt;p&gt;Repro at &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/valerauko/proto-repro/commit/a8ad51a225ed44ed134b28a18cc83d272d0d8321&quot;&gt;https://github.com/valerauko/proto-repro/commit/a8ad51a225ed44ed134b28a18cc83d272d0d8321&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Using distinct argument names in the defprotocol solves the issue. I think if it doesn't / can't work like in JVM Clojure it should warn about this issue.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14469/protocol-function-with-placeholder-arguments-doesnt-clojure</guid>
<pubDate>Mon, 17 Mar 2025 14:58:32 +0000</pubDate>
</item>
<item>
<title>Source maps show the wrong row in ClojureScript</title>
<link>https://ask.clojure.org/index.php/14441/source-maps-show-the-wrong-row-in-clojurescript</link>
<description>&lt;p&gt;When some error occurs in ClojureScript, the source map usually shows the line above the actual error, but sometimes it's even worse. An example is on my own plug-in Lazuli, where using Reagent with the newer React causes a very weird source map, as following GIF:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/kbruZy6.gif&quot; alt=&quot;GIF with the stacktrace&quot;&gt;&lt;/p&gt;
&lt;p&gt;The stracktrace shows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;lazuli$connections$conn_view            @ connections.cljs:64
(anonymous)	                            @ connections.cljs:199
lazuli$connections$connect_nrepl_BANG_  @	connections.cljs:195
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But the &lt;em&gt;correct lines&lt;/em&gt; are 63, and 197, with 195 being probably the only correct line in this &lt;/p&gt;
&lt;p&gt;Is there any way to configure this to be correct?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14441/source-maps-show-the-wrong-row-in-clojurescript</guid>
<pubDate>Wed, 05 Mar 2025 02:52:12 +0000</pubDate>
</item>
<item>
<title>ClojureScript: Destructuring two keys differing only on dash vs underscore doesn't work</title>
<link>https://ask.clojure.org/index.php/14370/clojurescript-destructuring-differing-underscore-doesnt</link>
<description>&lt;p&gt;When i try to destructure a key, supporting both kebab and snake case I run in to trouble:&lt;/p&gt;
&lt;p&gt;Sometimes both symbols pick up the same value:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [{:keys [foo-bar foo_bar] :as m} {:foo_bar 42}]
  [foo-bar (:foo-bar m) foo_bar (:foo_bar m)])
;;=&amp;gt; [42 nil 42 42]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Other times one symbol overshadows the other one:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(let [{:keys [foo-bar foo_bar
              a b c d e f g] :as m} {:foo_bar 42}]
  [foo-bar (:foo-bar m) foo_bar (:foo_bar m)])
;;=&amp;gt; [nil nil nil 42]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At least that's what I think is going on there: &lt;code&gt;foo-bar&lt;/code&gt; doesn't exist and gets the value &lt;code&gt;nil&lt;/code&gt;, overshadowing the symbol &lt;code&gt;foo_bar&lt;/code&gt; for which the value exists.&lt;/p&gt;
&lt;p&gt;This is supposedly a known limitation in ClojureScript, but I couldn't find it in &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/jira/software/c/projects/CLJS/issues&quot;&gt;the issue tracker&lt;/a&gt;. Nor does it seem like ChatGPT knows about it. Maybe it helps a bit to have it visible here for bots and humans alike.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14370/clojurescript-destructuring-differing-underscore-doesnt</guid>
<pubDate>Mon, 03 Feb 2025 16:09:41 +0000</pubDate>
</item>
<item>
<title>How to get interactive programming back when using shadow-cljs with dynamically rendered html</title>
<link>https://ask.clojure.org/index.php/14250/interactive-programming-using-shadow-dynamically-rendered</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am generating html dynamically on the server with hiccup. I am using the include-js macro to add the javascript that has been compiled from clojurescript to the hiccup template. The shadow-cljs cli just watches the clojurescript and just compiles the javascript.&lt;/p&gt;
&lt;p&gt;But when I use this approach I lose all the interactive programming that I have if I am using shadow-cljs with a statically rendered html file. &lt;/p&gt;
&lt;p&gt;Is it possible to get interactive programming with clojurescript where one evaluates expressions on the fly with a repl when using shadow-cljs while generating the html dynamically. &lt;/p&gt;
&lt;p&gt;I am assuming shadow-cljs is adding some interactive javascript to the statically rendered file that will make it possible to get the interactivity one wishes to get. Is it possible to add that missing piece to html that one is generating themselves?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14250/interactive-programming-using-shadow-dynamically-rendered</guid>
<pubDate>Fri, 15 Nov 2024 12:04:42 +0000</pubDate>
</item>
<item>
<title>For shadow-cljs, how do you get humane-test-output working for the `:browser-test` build target?</title>
<link>https://ask.clojure.org/index.php/14215/shadow-humane-test-output-working-browser-test-build-target</link>
<description>&lt;p&gt;For the &lt;code&gt;:node-test&lt;/code&gt; build target it was extremely simple to set up &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/pjstadig/humane-test-output&quot;&gt;humane-test-output&lt;/a&gt;, but I am having difficulty with the &lt;code&gt;:browser-test&lt;/code&gt; target.&lt;/p&gt;
&lt;p&gt;I am curious if anyone else has it working and can give pointers?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14215/shadow-humane-test-output-working-browser-test-build-target</guid>
<pubDate>Fri, 01 Nov 2024 17:43:29 +0000</pubDate>
</item>
<item>
<title>ClojureScript compiler does not transpile &quot;es8&quot; closure libraries</title>
<link>https://ask.clojure.org/index.php/14063/clojurescript-compiler-does-transpile-closure-libraries</link>
<description>&lt;p&gt;The ClojureScript compiler determines the type of the Closure library in the &lt;code&gt;transpile&lt;/code&gt; function. However, &lt;code&gt;:es8&lt;/code&gt;is not implemented.&lt;/p&gt;
&lt;p&gt;I have a fix for this, when a bug number has been assigned.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br&gt;
Hadil&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/14063/clojurescript-compiler-does-transpile-closure-libraries</guid>
<pubDate>Tue, 20 Aug 2024 17:42:31 +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'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 'beforeLoadModuleCode called with module module2 while module module1 is loading'&lt;br&gt;
First I realized that load was asynchronous and module loading wasn'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'm still unsure I'm getting the whole idea behind ModuleManager correctly so I need a confirmation that I'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>Is it possible to get ClojureScript hot reload in a Chrome Extension?</title>
<link>https://ask.clojure.org/index.php/13786/is-possible-get-clojurescript-hot-reload-chrome-extension</link>
<description>&lt;p&gt;I've been working with Chrome Extensions for some time and it would be amazing to get ClojureScript hot reloading capabilities there.&lt;/p&gt;
&lt;p&gt;I tried Thomas Heller example &lt;code&gt;shadow-cljs&lt;/code&gt; project for Chrome Extensions and some other stuff that I documented in &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/marcelocra/repro-cljs-chrome-extension&quot;&gt;a minimum example repo&lt;/a&gt;, but with no success.&lt;/p&gt;
&lt;p&gt;In summary, seems like the Chrome Extensions' v3 manifest prohibits &lt;code&gt;eval&lt;/code&gt;, which means we are out of luck?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13786/is-possible-get-clojurescript-hot-reload-chrome-extension</guid>
<pubDate>Sat, 16 Mar 2024 14:17:48 +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's the issue?&lt;/p&gt;
&lt;p&gt;It looks like deftype should have a similar issue, but I haven'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>Var metadata leaves functions in non-evaluated state</title>
<link>https://ask.clojure.org/index.php/13775/var-metadata-leaves-functions-in-non-evaluated-state</link>
<description>&lt;p&gt;When storing a function in a var's metadata, is behaves counterintuitively (at least to me).&lt;br&gt;
Is this a bug or the intended behavior? If the latter, what is the reasoning?&lt;/p&gt;
&lt;p&gt;Given the following &lt;code&gt;def&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def
  ^{:fn-in-meta (fn [a b] (+ a b))}
  my-var
  :value)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In Clojure things work as expected, one can get the function out of the metadata and it is still a regular function:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  ; clj
(-&amp;gt; #'my-var
    meta
    :fn-in-meta)
;; =&amp;gt; #function[myns/fn--27244]

; clj
(-&amp;gt; #'my-var
    meta
    :fn-in-meta
    type)
;; =&amp;gt; myns$fn__27244
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In clojurescript however, doing the same seems to result in some semi-compiled state that looks similar to a macroexpansion.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; ; cljs
(-&amp;gt; #'my-var
    meta
    :fn-in-meta)
;; =&amp;gt; (fn [a b] (+ a b))

; cljs
(-&amp;gt; #'my-var
    meta
    :fn-in-meta
    type)
;; =&amp;gt; cljs.core/List
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, note that adding metadata to another object, such as a vector behaves normally in noth languages.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; ; cljs
(-&amp;gt;&amp;gt; {:fn-in-meta (fn [a b] (+ a b))}
     (with-meta [])
     meta
     :fn-in-meta
     type)
;; =&amp;gt; #object[Function]


; clj
(-&amp;gt;&amp;gt; {:fn-in-meta (fn [a b] (+ a b))}
     (with-meta [])
     meta
     :fn-in-meta
     type)
;; =&amp;gt; myns$eval27282$fn__27283
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13775/var-metadata-leaves-functions-in-non-evaluated-state</guid>
<pubDate>Sat, 02 Mar 2024 21:28:11 +0000</pubDate>
</item>
<item>
<title>cljs.core/test does not work as the docstring describes</title>
<link>https://ask.clojure.org/index.php/13756/cljs-core-test-does-not-work-as-the-docstring-describes</link>
<description>&lt;p&gt;&lt;code&gt;cljs.core/test&lt;/code&gt; does not work according to its docstring description.&lt;/p&gt;
&lt;p&gt;The definition of cljs.core/test is&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn test
  &quot;test [v] finds fn at key :test in var metadata and calls it,
  presuming failure will throw exception&quot;
  [v]
  (let [f (.-cljs$lang$test v)]
    (if f
      (do (f) :ok)
      :no-test)))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It's intended use, as far as I understand it, is as such (example copied from the documented Clojure version of the same function at ClojureDocs, &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojuredocs.org/clojure.core/test#example-542692cac026201cdc326b8a&quot;&gt;https://clojuredocs.org/clojure.core/test#example-542692cac026201cdc326b8a&lt;/a&gt; ):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn my-function
  &quot;this function adds two numbers&quot;
  {:test #(do
            (assert (= (my-function 2 3) 5))
            (assert (= (my-function 4 4) 8)))}
  ([x y] (+ x y)))

(test #'my-function)  ;equal to (test (var my-function))
=&amp;gt; :ok
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, &lt;code&gt;cljs.core/test&lt;/code&gt; enables functions to self-document their capabilities via tests made available in metadata under the &lt;code&gt;:test&lt;/code&gt; key.&lt;/p&gt;
&lt;p&gt;However, repeating the above in a CLJS environment yields a different result:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn my-function
  &quot;this function adds two numbers&quot;
  {:test #(do
            (assert (= (my-function 2 3) 5))
            (assert (= (my-function 4 4) 8)))}
  ([x y] (+ x y)))

(test #'my-function)
=&amp;gt; :no-test
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The interesting thing is that, given that I evalated the above in a CLJS REPL, the metadata &lt;em&gt;is&lt;/em&gt; available, as far as I can tell:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(meta #'my-function)
=&amp;gt;
{:ns cljs.user,
 :name my-function,
 :file &quot;&amp;lt;cljs repl&amp;gt;&quot;,
 :end-column 18,
 :source &quot;my-function&quot;,
 :column 1,
 :line 1,
 :end-line 1,
 :arglists ([x y]),
 :doc &quot;this function adds two numbers&quot;, 
 :test #object[Function]}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This can be made even clearer by substituting the rather opaque function for a keyword:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defn my-function
  &quot;this function adds two numbers&quot;
  {:test :just-a-keyword}
  ([x y] (+ x y)))

(meta #'my-function)
=&amp;gt;
{:ns cljs.user,
 :name my-function,
 :file &quot;&amp;lt;cljs repl&amp;gt;&quot;,
 :end-column 18,
 :source &quot;my-function&quot;,
 :column 1,
 :line 1,
 :end-line 1,
 :arglists ([x y]),
 :doc &quot;this function adds two numbers&quot;, 
 :test :just-a-keyword}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I spoke to @theller and @hiredman about this on the Clojurians Slack, and they speculated that &lt;code&gt;cljs.core/test&lt;/code&gt; has been repurposed to execute the body of &lt;code&gt;deftest&lt;/code&gt;s, since the two pieces seem to fit together. Observe:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(require '[cljs.test :as test])
(test/deftest foo (test/is (= 1 2)))
=&amp;gt; #'cljs.user/foo

(test foo)
FAIL in () (&amp;lt;NO_SOURCE_FILE&amp;gt;:1:28)
expected: (= 1 2)
  actual: (not (= 1 2))

:ok
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;deftest&lt;/code&gt; body is executed and the keyword &lt;code&gt;:ok&lt;/code&gt; is returned (regardless of the &lt;code&gt;is&lt;/code&gt; result), as can also be gathered from reading definition of &lt;code&gt;cljs.core/test&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If it is true that &lt;code&gt;cljs.core/test&lt;/code&gt; has been repurposed in this manner, then two things are also true:&lt;/p&gt;
&lt;p&gt;A) If it ever were the intent that &lt;code&gt;cljs.core/test&lt;/code&gt; should enable testing &lt;code&gt;:test&lt;/code&gt; assertions for &lt;code&gt;defn&lt;/code&gt;s, that no longer holds.&lt;br&gt;
B) The docstring of &lt;code&gt;cljs.core/test&lt;/code&gt; is somewhat misleading.&lt;/p&gt;
&lt;p&gt;The first bit of the docstring, &lt;code&gt;&quot;test [v] finds fn at key :test in var metadata and calls it&quot;&lt;/code&gt;, may be technically correct, but mentions no connection with &lt;code&gt;deftest&lt;/code&gt;, and therefore somewhat unhelpful. &lt;/p&gt;
&lt;p&gt;The second bit of the docstring, &lt;code&gt;&quot;, presuming failure will throw exception&lt;/code&gt;&quot;, is certainly not correct when used for &lt;code&gt;deftest&lt;/code&gt; - the &lt;code&gt;cljs.test/is&lt;/code&gt; macro, which I think is fair to say that most &lt;code&gt;deftest&lt;/code&gt;s use, catches exceptions and reports instead. I think the original intent is that the execption is thrown, so &lt;code&gt;:ok&lt;/code&gt; is not returned, but in this context, that construct fails.&lt;/p&gt;
&lt;p&gt;The docstring seems to be a carbon copy of the Clojure version, so possibly, it warrants an update. Or maybe &lt;code&gt;cljs.core/test&lt;/code&gt; is simply unused and redundant at this point?&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13756/cljs-core-test-does-not-work-as-the-docstring-describes</guid>
<pubDate>Tue, 27 Feb 2024 12:33:17 +0000</pubDate>
</item>
<item>
<title>Support for js/BigInt</title>
<link>https://ask.clojure.org/index.php/13676/support-for-js-bigint</link>
<description>&lt;p&gt;Native support for BigInt in JavaScript has been around since 2020. (&lt;a rel=&quot;nofollow&quot; href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt&quot;&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt&lt;/a&gt;) &lt;/p&gt;
&lt;p&gt;Any chance of support for this in ClojureScript any time soon?&lt;/p&gt;
&lt;p&gt;Would be nice to be able to use this as a number in numeric ops and as a key in hash maps. &lt;br&gt;
Also, cljs.core could be extended with functions like &lt;code&gt;bigint&lt;/code&gt; and &lt;code&gt;integer?&lt;/code&gt; from clojure.core.&lt;/p&gt;
&lt;p&gt;BigInts would bring clojurescript one step closer to supporting Ratios.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13676/support-for-js-bigint</guid>
<pubDate>Fri, 09 Feb 2024 13:32:21 +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>ClojureScript and the deprecation of Google Closure Library</title>
<link>https://ask.clojure.org/index.php/13612/clojurescript-and-the-deprecation-google-closure-library</link>
<description>&lt;p&gt;Google &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/google/closure-library/issues/1214&quot;&gt;announced recently&lt;/a&gt; that they will be sunsetting the Closure Library (not Closure itself).&lt;/p&gt;
&lt;p&gt;Does this impact ClojureScript in any meaningful way?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13612/clojurescript-and-the-deprecation-google-closure-library</guid>
<pubDate>Fri, 12 Jan 2024 16:33:30 +0000</pubDate>
</item>
<item>
<title>MUI Select - add deselect function</title>
<link>https://ask.clojure.org/index.php/13551/mui-select-add-deselect-function</link>
<description>&lt;pre&gt;&lt;code&gt;(defn- menu-item
  [value-fn label-fn state lang index item]
(let [value (value-fn item)
    label (label-fn item lang)]
^{:key index}
[:&amp;gt; m/MenuItem {:value   value
                :data-cy (-&amp;gt; (str value) (str/lower-case) (str/replace &quot; &quot; &quot;-&quot;) (str &quot;-menu-item&quot;))}
 [:&amp;gt; m/Checkbox {:checked (= (value-fn state) value)}]
 [:&amp;gt; m/Typography {} label]
 ]))
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;(defn select
  [{:keys [data state-fn disabled? label value-fn label-fn data-cy variant]}]
  (let [rf-lang   (rf/subscribe [:current-language])
        label-fn1 (or label-fn (fn [item lang] (value-fn item)))]
    (fn [{:keys [data state-fn disabled? label value-fn data-cy variant]}]
      (let [lang  @rf-lang
            state (state-fn)
            props (cond-&amp;gt;
                    {:select      true
                     :full-width  true
                     :SelectProps {:MenuProps    {:getContentAnchorEl nil}
                                   :render-value (fn [items]
                                               (if label-fn
                                                 (label-fn state lang)
                                                 (map identity items)))
                               :data-cy      data-cy}
                 :value       (or (value-fn state) &quot;&quot;)
                 :on-change   (fn [e]
                                (let [selected (.. e -target -value)]
                                  (state-fn (first (filter #(= selected (value-fn %)) data)))))
                 :label       (i18n/translation label lang)
                 :disabled    disabled?}
                variant (assoc :variant variant))]
    [:&amp;gt; m/TextField props (map-indexed (partial menu-item value-fn label-fn1 state lang) data)]))))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I have the following piece of code to create a dropdown list with items that have a checkbox next to them. The problem is that the checkbox cannot be removed. When the user clicks on an already selected checkbox, nothing happens. And in this case, it should become deselect.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13551/mui-select-add-deselect-function</guid>
<pubDate>Wed, 13 Dec 2023 11:43:41 +0000</pubDate>
</item>
<item>
<title>sorted-map with heterogeneous keys crashes on lookup</title>
<link>https://ask.clojure.org/index.php/13396/sorted-map-with-heterogeneous-keys-crashes-on-lookup</link>
<description>&lt;p&gt;Hello,&lt;br&gt;
I encountered some odd behavior with &lt;code&gt;sorted-map&lt;/code&gt; which to me looks like a bug or a lack of documentation:&lt;/p&gt;
&lt;p&gt;Specifically, when creating a sorted map with keys of different types like so: &lt;code&gt;(sorted-map :k1 :v1 &quot;k2&quot; :v2)&lt;/code&gt; then lookup like so &lt;code&gt;(:k1 (sorted-map :k1 :v1 &quot;k2&quot; :v2))&lt;/code&gt; produces the exception: &lt;code&gt;Cannot compare k2 to :k1&lt;/code&gt;. This seems due to the use of &lt;code&gt;compare&lt;/code&gt; in the &lt;code&gt;sorted-map&lt;/code&gt; implementation.&lt;/p&gt;
&lt;p&gt;While the preferable (to me) course of action would be to fully support heterogeneous keys, It seems reasonable to require that the keys of a sorted-map are comparable, but in my opinion this should be stated in &lt;a rel=&quot;nofollow&quot; href=&quot;https://cljs.github.io/api/cljs.core/sorted-map&quot;&gt;the docs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Even if that were to be a requirement, it seems more inline with Clojure's general design spirit to return &lt;code&gt;nil&lt;/code&gt; upon such a lookup, rather than throw an exception. It would make more sense to me to throw an exception the moment that a key is added which is not comparable to other keys already in the map. What do you think?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Simon&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13396/sorted-map-with-heterogeneous-keys-crashes-on-lookup</guid>
<pubDate>Tue, 24 Oct 2023 12:43:26 +0000</pubDate>
</item>
<item>
<title>clojure.pprint/pprint prints superfluous spaces before newlines</title>
<link>https://ask.clojure.org/index.php/13378/clojure-pprint-pprint-prints-superfluous-spaces-newlines</link>
<description>&lt;p&gt;Repro:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;λ clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version &quot;1.11.54&quot;}}}}' -M -m cljs.main --repl-env node
ClojureScript 1.11.54
cljs.user=&amp;gt; (require '[clojure.pprint :refer [pprint *print-right-margin*]])
nil
cljs.user=&amp;gt; (prn (with-out-str (binding [*print-right-margin* 20] (pprint {:a 1 :b 2 :c 3 :d 4}))))
&quot;{:a 1,\n :b 2, \n :c 3, \n :d 4}\n&quot;
nil
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note the spaces before the newlines after &lt;code&gt;:b 2&lt;/code&gt; and &lt;code&gt;:c 3&lt;/code&gt;.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13378/clojure-pprint-pprint-prints-superfluous-spaces-newlines</guid>
<pubDate>Thu, 19 Oct 2023 20:04:51 +0000</pubDate>
</item>
<item>
<title>Can't add #inst values to var metadata. Error: Not supported: class java.time.Instant</title>
<link>https://ask.clojure.org/index.php/13362/cant-inst-values-metadata-error-supported-class-java-instant</link>
<description>&lt;p&gt;I wasn't able to add #inst values to var metadata. Compilation failed to &lt;code&gt;Not supported: class java.time.Instant&lt;/code&gt; error&lt;/p&gt;
&lt;p&gt;Steps to reproduce:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ mkdir src
$ echo '(ns core) (def ^{:time #inst &quot;2023-10-07&quot;} foo :foo)' &amp;gt; src/core.cljs
$ clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version &quot;1.11.60&quot;}}}' -M --main cljs.main --compile core
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Expected: Compilation is successful&lt;/p&gt;
&lt;p&gt;Actual:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Unexpected error compiling at (REPL:1).
Not supported: class java.time.Instant

Full report at:
/var/folders/0p/vtdv4p053pd6gkx8d5p98h000000gn/T/clojure-15941611179751768055.edn
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Analysis:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/jira/software/c/projects/CLJS/issues/CLJS-3291&quot;&gt;CLJS-3291&lt;/a&gt; changed the #inst reader to produce &lt;code&gt;java.time.Instant&lt;/code&gt; instead of &lt;code&gt;java.util.Date&lt;/code&gt;. The analysis cache transit writer is failing to write &lt;code&gt;java.time.Instant&lt;/code&gt; because it only knows how to serialize &lt;code&gt;java.util.Date&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Workaround:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def foo :foo)
(alter-meta #'foo assoc :time #inst &quot;2023-10-07&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Full report:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{:clojure.main/message
 &quot;Unexpected error compiling at (REPL:1).\nNot supported: class java.time.Instant\n&quot;,
 :clojure.main/triage
 {:file
  #object[java.io.File 0x608f79a8 &quot;/Users/mikko/Documents/Projects/sharetribe/instant-cljs2/src/core.cljs&quot;],
  :clojure.error/phase :compilation,
  :clojure.error/class java.lang.Exception,
  :clojure.error/cause &quot;Not supported: class java.time.Instant&quot;},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.ExceptionInfo,
    :message
    &quot;failed compiling file:/Users/mikko/Documents/Projects/sharetribe/instant-cljs2/src/core.cljs&quot;,
    :data
    {:file
     #object[java.io.File 0x608f79a8 &quot;/Users/mikko/Documents/Projects/sharetribe/instant-cljs2/src/core.cljs&quot;],
     :clojure.error/phase :compilation},
    :at
    [cljs.compiler$compile_file$fn__4809 invoke &quot;compiler.cljc&quot; 1768]}
   {:type java.lang.RuntimeException,
    :message
    &quot;java.lang.Exception: Not supported: class java.time.Instant&quot;,
    :at
    [com.cognitect.transit.impl.WriterFactory$1
     write
     &quot;WriterFactory.java&quot;
     65]}
   {:type java.lang.Exception,
    :message &quot;Not supported: class java.time.Instant&quot;,
    :at
    [com.cognitect.transit.impl.AbstractEmitter
     marshal
     &quot;AbstractEmitter.java&quot;
     195]}],
  :trace
  [[com.cognitect.transit.impl.AbstractEmitter
    marshal
    &quot;AbstractEmitter.java&quot;
    195]
   [com.cognitect.transit.impl.JsonEmitter
    emitMap
    &quot;JsonEmitter.java&quot;
    171]
   [com.cognitect.transit.impl.AbstractEmitter
    emitMap
    &quot;AbstractEmitter.java&quot;
    86]
   [com.cognitect.transit.impl.AbstractEmitter
    marshal
    &quot;AbstractEmitter.java&quot;
    185]
   [com.cognitect.transit.impl.JsonEmitter
    emitMap
    &quot;JsonEmitter.java&quot;
    171]
   [com.cognitect.transit.impl.AbstractEmitter
    emitMap
    &quot;AbstractEmitter.java&quot;
    86]
   [com.cognitect.transit.impl.AbstractEmitter
    marshal
    &quot;AbstractEmitter.java&quot;
    185]
   [com.cognitect.transit.impl.JsonEmitter
    emitMap
    &quot;JsonEmitter.java&quot;
    171]
   [com.cognitect.transit.impl.AbstractEmitter
    emitMap
    &quot;AbstractEmitter.java&quot;
    86]
   [com.cognitect.transit.impl.AbstractEmitter
    marshal
    &quot;AbstractEmitter.java&quot;
    185]
   [com.cognitect.transit.impl.JsonEmitter
    emitMap
    &quot;JsonEmitter.java&quot;
    171]
   [com.cognitect.transit.impl.AbstractEmitter
    emitMap
    &quot;AbstractEmitter.java&quot;
    86]
   [com.cognitect.transit.impl.AbstractEmitter
    marshal
    &quot;AbstractEmitter.java&quot;
    185]
   [com.cognitect.transit.impl.AbstractEmitter
    marshalTop
    &quot;AbstractEmitter.java&quot;
    212]
   [com.cognitect.transit.impl.JsonEmitter emit &quot;JsonEmitter.java&quot; 41]
   [com.cognitect.transit.impl.WriterFactory$1
    write
    &quot;WriterFactory.java&quot;
    62]
   [cljs.vendor.cognitect.transit$write invokeStatic &quot;transit.clj&quot; 171]
   [cljs.vendor.cognitect.transit$write invoke &quot;transit.clj&quot; 168]
   [cljs.analyzer$write_analysis_cache$fn__3960
    invoke
    &quot;analyzer.cljc&quot;
    4771]
   [cljs.analyzer$write_analysis_cache
    invokeStatic
    &quot;analyzer.cljc&quot;
    4770]
   [cljs.analyzer$write_analysis_cache invoke &quot;analyzer.cljc&quot; 4757]
   [cljs.compiler$emit_source invokeStatic &quot;compiler.cljc&quot; 1642]
   [cljs.compiler$emit_source invoke &quot;compiler.cljc&quot; 1557]
   [cljs.compiler$compile_file_STAR_$fn__4778
    invoke
    &quot;compiler.cljc&quot;
    1671]
   [cljs.compiler$with_core_cljs invokeStatic &quot;compiler.cljc&quot; 1477]
   [cljs.compiler$with_core_cljs invoke &quot;compiler.cljc&quot; 1466]
   [cljs.compiler$compile_file_STAR_ invokeStatic &quot;compiler.cljc&quot; 1655]
   [cljs.compiler$compile_file_STAR_ invoke &quot;compiler.cljc&quot; 1648]
   [cljs.compiler$compile_file$fn__4809 invoke &quot;compiler.cljc&quot; 1753]
   [cljs.compiler$compile_file invokeStatic &quot;compiler.cljc&quot; 1728]
   [cljs.compiler$compile_file invoke &quot;compiler.cljc&quot; 1704]
   [cljs.closure$compile_file invokeStatic &quot;closure.clj&quot; 657]
   [cljs.closure$compile_file invoke &quot;closure.clj&quot; 635]
   [cljs.closure$fn__6472 invokeStatic &quot;closure.clj&quot; 731]
   [cljs.closure$fn__6472 invoke &quot;closure.clj&quot; 725]
   [cljs.closure$fn__6381$G__6374__6388 invoke &quot;closure.clj&quot; 553]
   [cljs.closure$compile_sources$iter__6598__6602$fn__6603
    invoke
    &quot;closure.clj&quot;
    1102]
   [clojure.lang.LazySeq sval &quot;LazySeq.java&quot; 42]
   [clojure.lang.LazySeq seq &quot;LazySeq.java&quot; 51]
   [clojure.lang.Cons next &quot;Cons.java&quot; 39]
   [clojure.lang.RT next &quot;RT.java&quot; 713]
   [clojure.core$next__5451 invokeStatic &quot;core.clj&quot; 64]
   [clojure.core$dorun invokeStatic &quot;core.clj&quot; 3143]
   [clojure.core$doall invokeStatic &quot;core.clj&quot; 3149]
   [clojure.core$doall invoke &quot;core.clj&quot; 3149]
   [cljs.closure$compile_sources invokeStatic &quot;closure.clj&quot; 1098]
   [cljs.closure$compile_sources invoke &quot;closure.clj&quot; 1087]
   [cljs.closure$build invokeStatic &quot;closure.clj&quot; 3200]
   [cljs.closure$build invoke &quot;closure.clj&quot; 3104]
   [cljs.build.api$build invokeStatic &quot;api.clj&quot; 231]
   [cljs.build.api$build invoke &quot;api.clj&quot; 212]
   [cljs.cli$default_compile invokeStatic &quot;cli.clj&quot; 530]
   [cljs.cli$default_compile invoke &quot;cli.clj&quot; 486]
   [cljs.cli$compile_opt invokeStatic &quot;cli.clj&quot; 542]
   [cljs.cli$compile_opt invoke &quot;cli.clj&quot; 540]
   [cljs.cli$main invokeStatic &quot;cli.clj&quot; 703]
   [cljs.cli$main doInvoke &quot;cli.clj&quot; 692]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 139]
   [clojure.core$apply invokeStatic &quot;core.clj&quot; 669]
   [clojure.core$apply invoke &quot;core.clj&quot; 662]
   [cljs.main$_main invokeStatic &quot;main.clj&quot; 65]
   [cljs.main$_main doInvoke &quot;main.clj&quot; 56]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 137]
   [clojure.lang.Var applyTo &quot;Var.java&quot; 705]
   [clojure.core$apply invokeStatic &quot;core.clj&quot; 667]
   [clojure.main$main_opt invokeStatic &quot;main.clj&quot; 514]
   [clojure.main$main_opt invoke &quot;main.clj&quot; 510]
   [clojure.main$main invokeStatic &quot;main.clj&quot; 664]
   [clojure.main$main doInvoke &quot;main.clj&quot; 616]
   [clojure.lang.RestFn applyTo &quot;RestFn.java&quot; 137]
   [clojure.lang.Var applyTo &quot;Var.java&quot; 705]
   [clojure.main main &quot;main.java&quot; 40]],
  :cause &quot;Not supported: class java.time.Instant&quot;,
  :phase :compilation}}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13362/cant-inst-values-metadata-error-supported-class-java-instant</guid>
<pubDate>Sat, 07 Oct 2023 19:28:05 +0000</pubDate>
</item>
<item>
<title>Clojurescript issue in 1.11.121 and master when compiling</title>
<link>https://ask.clojure.org/index.php/13279/clojurescript-issue-in-1-11-121-and-master-when-compiling</link>
<description>&lt;p&gt;When compiling a file with :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;clj -Sdeps '{:paths [&quot;src&quot;] :deps {org.clojure/clojurescript {:mvn/version &quot;1.11.121&quot;}}}' -M -m cljs.main -co '{:main org.foo.myscript}' --compile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;the compilation will work fine, but if after that you run cljs.main --repl the browser repl will start, but evaluating forms on it will not work since evaluation will never finish.&lt;/p&gt;
&lt;p&gt;This exact same commands work fine in 1.11.60.&lt;/p&gt;
&lt;p&gt;After some debugging the issue seems to be caused by the current compiler never adding &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;document.write('&amp;lt;script&amp;gt;goog.require(&quot;clojure.browser.repl.preload&quot;);&amp;lt;/script&amp;gt;'); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to the resulting js file.&lt;/p&gt;
&lt;p&gt;This is caused by :&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L2500-L2501&quot;&gt;https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L2500-L2501&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;not adding the preload because :browser-repl isn't true. &lt;/p&gt;
&lt;p&gt;The breaking change comes from this line:&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/cli.clj#L498&quot;&gt;https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/cli.clj#L498&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;which removes :browser-repl from the options because we are just compiling and there is no repl involved.&lt;/p&gt;
&lt;p&gt;Looks like the behavior was explicitly changed by this commit :&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/commit/9c01d9b0a70ada1cb17cf3ce65ae93d76d0d3b08&quot;&gt;https://github.com/clojure/clojurescript/commit/9c01d9b0a70ada1cb17cf3ce65ae93d76d0d3b08&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Reverting the commit fixes the issue.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13279/clojurescript-issue-in-1-11-121-and-master-when-compiling</guid>
<pubDate>Tue, 12 Sep 2023 22:01:58 +0000</pubDate>
</item>
<item>
<title>How to transform js/Error to a clojurescript map?</title>
<link>https://ask.clojure.org/index.php/13176/how-to-transform-js-error-to-a-clojurescript-map</link>
<description>&lt;p&gt;I'm getting a &lt;code&gt;js/Error&lt;/code&gt; in my &lt;code&gt;catch&lt;/code&gt; form of &lt;code&gt;try/catch&lt;/code&gt;.  I was doing some repl work to see what I can understand about &lt;code&gt;js/Error&lt;/code&gt;s.  What I don't understand is why &lt;code&gt;(js-&amp;gt;clj js-err)&lt;/code&gt; just returns the same &lt;code&gt;js/Error&lt;/code&gt; object.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(def js-err (js/Error. &quot;testing&quot;))

js-err
;; =&amp;gt; #object[Error Error: testing]
(js-&amp;gt;clj js-err)
;; =&amp;gt; #object[Error Error: testing]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;evaluating &lt;code&gt;js-err&lt;/code&gt; and &lt;code&gt;(js-&amp;gt;clj js-err)&lt;/code&gt; result in the same thing.&lt;/p&gt;
&lt;p&gt;Here are the properties on &lt;code&gt;js-err&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(.getOwnPropertyNames js/Object js-err)
;; =&amp;gt; #js[&quot;stack&quot; &quot;message&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;what I want or expect to happen:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(js-&amp;gt;clj js-err)
;; =&amp;gt; {:message &quot;testing&quot;
;;     :stack &quot;blah\nblah&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Could someone explain why &lt;code&gt;js-&amp;gt;clj&lt;/code&gt; doesn't give me the object data as a map, and is there a idiomatic way to accomplish turning that object into a map?&lt;/p&gt;
&lt;p&gt;This is in the nodejs host&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13176/how-to-transform-js-error-to-a-clojurescript-map</guid>
<pubDate>Mon, 21 Aug 2023 14:54:16 +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>Add requiring-resolve to ClojureScript</title>
<link>https://ask.clojure.org/index.php/13099/add-requiring-resolve-to-clojurescript</link>
<description>&lt;p&gt;I'm not sure if there are any technical hurdles in adding requiring-resolve to ClojureScript, but it would be nice to have parity so REPL utilities can be written using it.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13099/add-requiring-resolve-to-clojurescript</guid>
<pubDate>Tue, 25 Jul 2023 16:49:40 +0000</pubDate>
</item>
<item>
<title>Why doesn't `type` in CLJS check `:type` on its arguments meta like CLJ does?</title>
<link>https://ask.clojure.org/index.php/13095/why-doesnt-type-cljs-check-type-its-arguments-meta-like-does</link>
<description>&lt;p&gt;In CLJ a check for &lt;code&gt;:type&lt;/code&gt; on the meta happens and then falls back to returning the constructor class. In CLJS only the constructor class is returned. It would be nice to have these consistent for usage with multimethods etc. &lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13095/why-doesnt-type-cljs-check-type-its-arguments-meta-like-does</guid>
<pubDate>Sun, 23 Jul 2023 14:56:02 +0000</pubDate>
</item>
<item>
<title>ClojureScript doesn't respect the provided :line and :column meta for functions</title>
<link>https://ask.clojure.org/index.php/13085/clojurescript-doesnt-respect-provided-line-column-functions</link>
<description>&lt;p&gt;There is currently a difference between Clojure and ClojureScript in how the readers handle the provided :line and :column meta for forms.&lt;/p&gt;
&lt;p&gt;In Clojure:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Clojure 1.11.1
user=&amp;gt; ^{:line 40} (defn foo [])
#'user/foo
user=&amp;gt; (-&amp;gt; #'foo meta :line)
40
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;while in ClojureScript:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ClojureScript 1.11.60
cljs.user=&amp;gt; ^{:line 40} (defn foo [])
#'cljs.user/foo
cljs.user=&amp;gt; (-&amp;gt; #'foo meta :line)
1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I think this is specially important in ClojureScript where there isn't a way of modifying vars meta.&lt;/p&gt;
&lt;p&gt;Tooling like editors, when sending forms to the repl, can use this mechanism to add for example line information when they know it. Keeping this information is important since other stuff like clojure.repl/source depends on it, which currently breaks as soon as you eval a form from your editor.&lt;/p&gt;
&lt;p&gt;I added a PR here with one possible solution &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/pull/210&quot;&gt;https://github.com/clojure/clojurescript/pull/210&lt;/a&gt;&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13085/clojurescript-doesnt-respect-provided-line-column-functions</guid>
<pubDate>Fri, 14 Jul 2023 18:03:55 +0000</pubDate>
</item>
<item>
<title>cljs range fn does odd things with nil, is this a bug?</title>
<link>https://ask.clojure.org/index.php/13081/cljs-range-fn-does-odd-things-with-nil-is-this-a-bug</link>
<description>&lt;p&gt;In Clojure, passing a nil as the first arg to range throws NPE, but in ClojureScript it doesn't and odd things can happen:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(range nil 0)
=&amp;gt; ()
(range nil 1)
=&amp;gt; (nil)
(range nil 2)
=&amp;gt; (nil 1)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What's worse is if you have the start and the step both being nil:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(range 0 0 0)
=&amp;gt; ()
(range nil 0 nil)
INTERNAL REPL ERROR: Got an unexpected reply from relay, check Inspect
Timeout while waiting for result.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This actually evaluates to an infinite seq of nils!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(take 10 (range nil 0 nil))
=&amp;gt; (nil nil nil nil nil nil nil nil nil nil)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:boom:&lt;/p&gt;
&lt;p&gt;(also raised for discussion on the &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurians.slack.com/archives/C03S1L9DN/p1689260492724489&quot;&gt;clojurians slack&lt;/a&gt;)&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/13081/cljs-range-fn-does-odd-things-with-nil-is-this-a-bug</guid>
<pubDate>Thu, 13 Jul 2023 15:24:38 +0000</pubDate>
</item>
<item>
<title>cljs compile warning: JavaScript file found on classpath for library `...`, but does not contain a corresponding...</title>
<link>https://ask.clojure.org/index.php/12946/compile-warning-javascript-classpath-library-corresponding</link>
<description>&lt;p&gt;First, thanks for cljs, it's the best way to do frontends and it's one of the lifebloods of our business. We are super-grateful.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;I am running some older code in a new project that has an updated cljs dependency and I am now getting an interesting compile warning:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;WARNING: JavaScript file found on classpath for library `goog.net.cookies`, but does not contain a corresponding `goog.provide` declaration: jar:file:/home/harold/.m2/repository/org/clojure/google-closure-library/0.0-20211011-0726fdeb/google-closure-library-0.0-20211011-0726fdeb.jar!/goog/net/cookies.js
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Everything seems to be working fine, but I am still interested in cleaning up this output.&lt;/p&gt;
&lt;p&gt;I built a simple (two tiny file) project that reproduces the problem:&lt;br&gt;
 - &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/harold/cookie-repro&quot;&gt;https://github.com/harold/cookie-repro&lt;/a&gt;&lt;br&gt;
 - You can clone that and then do:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;lein cljsprod
&lt;/code&gt;&lt;/pre&gt;
&lt;hr&gt;
&lt;p&gt;I did a 'bisect'-ish operation on the cljs deps in maven and found that the warning started to appear with version &lt;code&gt;1.10.891&lt;/code&gt;: &lt;br&gt;
 - &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/blob/master/changes.md#110891&quot;&gt;https://github.com/clojure/clojurescript/blob/master/changes.md#110891&lt;/a&gt;&lt;br&gt;
 - Before that version, the warning is not seen&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Wondering if others have seen this warning, or similar, and what, if any, steps would be good to take.&lt;/p&gt;
&lt;p&gt;Thanks again for your time and consideration!&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12946/compile-warning-javascript-classpath-library-corresponding</guid>
<pubDate>Wed, 17 May 2023 17:23:07 +0000</pubDate>
</item>
<item>
<title>Should documentation be added to explain the default browser console representation of CLJS collections and seqs?</title>
<link>https://ask.clojure.org/index.php/12932/documentation-explain-default-representation-collections</link>
<description>&lt;p&gt;Using &lt;code&gt;console.log&lt;/code&gt; on a CLJS collection or sequence returns an internal representation of the object that looks like &lt;code&gt;`&lt;/code&gt;Object { meta: null, cnt: 3, shift: 5, root: {…}, tail: (3) […], __hash: null, &quot;cljs$lang$protocol_mask$partition0$&quot;: 167666463, &quot;cljs$lang$protocol_mask$partition1$&quot;: 139268 }&lt;code&gt;`&lt;/code&gt;. This seems like an easy pitfall for a beginner since &lt;code&gt;console.log&lt;/code&gt; is a standard debugging tool for JS developers. Referring users to something like &lt;code&gt;binaryage/devtools&lt;/code&gt; or any of the built-in functions for converting CLJS types to JS types might be helpful.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12932/documentation-explain-default-representation-collections</guid>
<pubDate>Thu, 11 May 2023 16:04:18 +0000</pubDate>
</item>
<item>
<title>Custom printing method for records</title>
<link>https://ask.clojure.org/index.php/12921/custom-printing-method-for-records</link>
<description>&lt;p&gt;In Clojure, this works:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defmethod clojure.pprint/simple-dispatch
  my.ns.record
  [r] (print r))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But I can't find the equivalent in Cljs. With no success, I've tried:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(defmethod cljs.pprint/simple-dispatch
  my.ns.record
  [r] (print r))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I can't make any sense of the cljs.pprint documentation&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12921/custom-printing-method-for-records</guid>
<pubDate>Sun, 07 May 2023 08:10:49 +0000</pubDate>
</item>
<item>
<title>Why does this work in CLJS but doesn'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] '([:b 2] [:c 3]) '([: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] '([:b 2] [:c 3]) '([:d 4]))
{:a 1, :b 2, :c 3, :d 4}
cljs.user&amp;gt; :cljs/quit
nil
user&amp;gt; (conj {} [:a 1] '([:b 2] [:c 3]) '([: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 'app'; java.util.Map$Entry is in module java.base of loader 'bootstrap')
&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>`specify!` and `set!` silently fail if object is not extensible</title>
<link>https://ask.clojure.org/index.php/12898/specify-and-set-silently-fail-if-object-is-not-extensible</link>
<description>&lt;p&gt;&lt;code&gt;specify!&lt;/code&gt; implicitly relies on the provided object to be extensible so that protocol implementations can be provided. Here is a quick demonstration from a REPL.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.user&amp;gt; (def obj #js {:current nil})
[#js {:current nil}]
cljs.user&amp;gt; (js/Object.preventExtensions obj)
{&quot;current&quot; nil}
cljs.user&amp;gt; (specify! obj
              IDeref
              (-deref [^js this] (.-current this)))
{&quot;current&quot; nil}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that &lt;code&gt;reify&lt;/code&gt; does not document this requirement either. This leads to confusing situations where non-extensible objects returned by JavaScript libraries (e.g. React) are unable to be extended and the user has little clue why.&lt;/p&gt;
&lt;p&gt;Similarly, &lt;code&gt;set!&lt;/code&gt; silently fails when objects are not extensible.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.user&amp;gt; (set! (.-foo obj) &quot;bar&quot;)
&quot;bar&quot;
cljs.user&amp;gt; obj
{&quot;current&quot; nil}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;goog.object/set&lt;/code&gt; is able to detect this and throw an error.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.user&amp;gt; (goog.object/set obj &quot;foo&quot; &quot;bar&quot;)    
Execution error (TypeError) at (&amp;lt;cljs repl&amp;gt;:1).
Cannot add property foo, object is not extensible
:repl/exception!
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12898/specify-and-set-silently-fail-if-object-is-not-extensible</guid>
<pubDate>Mon, 24 Apr 2023 01:11:19 +0000</pubDate>
</item>
<item>
<title>Questions about cljs.core/prefers* (maybe bugs?)</title>
<link>https://ask.clojure.org/index.php/12867/questions-about-cljs-core-prefers-maybe-bugs</link>
<description>&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Wondering about these &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/blob/0ccd19fc79f04a5082764901bd6413a5841ca428/src/main/cljs/cljs/core.cljs#L11289-L11298&quot;&gt;two loops&lt;/a&gt; in &lt;code&gt;cljs.core/prefers*&lt;/code&gt;. Am I misreading it, or do they always return &lt;code&gt;nil&lt;/code&gt;? Seems like the result of the inner &lt;code&gt;when&lt;/code&gt;, which makes the recursive call to &lt;code&gt;prefers*&lt;/code&gt;, is always dropped.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also, if the intent of these two loops is a polymorphic lookup against the prefers table, should the calls to &lt;code&gt;parents&lt;/code&gt; also be against the same &lt;code&gt;hierarchy&lt;/code&gt; as with the &lt;code&gt;isa?&lt;/code&gt; in &lt;code&gt;cljs.core/dominates&lt;/code&gt;? Currently they are made against the global hierarchy.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also, if there is no prefers table, or it is empty, you can probably skip the loops.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12867/questions-about-cljs-core-prefers-maybe-bugs</guid>
<pubDate>Mon, 17 Apr 2023 21:03:37 +0000</pubDate>
</item>
<item>
<title>Firefox addon written in cljs can't pass Mozilla's review</title>
<link>https://ask.clojure.org/index.php/12821/firefox-addon-written-in-cljs-cant-pass-mozillas-review</link>
<description>&lt;p&gt;Hi everyone,&lt;br&gt;
I have a Firefox addon written cljs with advanced optimization, after submit to addons, the reviews tell me that the zip file I submit is different from what they built from source.&lt;/p&gt;
&lt;p&gt;I use diff-so-fancy to compare the generated js file, and I found the main difference are variable names.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://user-images.githubusercontent.com/3848910/228865742-373cf850-4783-49a3-afc1-290245ce99d2.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;
&lt;p&gt;So is there any way to ensure generated js are reproducible?&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;PS: My project source code is here:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/jiacai2050/gooreplacer/blob/firefox/cljs-src/project.clj#L76&quot;&gt;https://github.com/jiacai2050/gooreplacer/blob/firefox/cljs-src/project.clj#L76&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12821/firefox-addon-written-in-cljs-cant-pass-mozillas-review</guid>
<pubDate>Thu, 30 Mar 2023 14:16:58 +0000</pubDate>
</item>
<item>
<title>Feature request: async/await support in CLJS</title>
<link>https://ask.clojure.org/index.php/12806/feature-request-async-await-support-in-cljs</link>
<description>&lt;p&gt;There is a lot of discussion around the web related to adding ES2018 async/await to ClojureScript, be it feature requests[1][2], proposals[3], or experimentation[4][5].&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I am posting this question so there is a central place where people can upvote and bring attention to the Clojure core team, and possibly help prioritize consideration of this feature.&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;I am aware it is not as easy as adding keywords to emitted JS code. I am aware of workarounds like using macros from promesa, core.async, or kitchen-async. I am also aware that there must be a strong use case for consideration on adding this feature. Everything I've mentioned, and more, has been discussed at one point in the links below.&lt;/p&gt;
&lt;p&gt;[1] &lt;a rel=&quot;nofollow&quot; href=&quot;https://groups.google.com/g/clojurescript/c/scUMhU-ctEM&quot;&gt;https://groups.google.com/g/clojurescript/c/scUMhU-ctEM&lt;/a&gt;&lt;br&gt;
[2] &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.reddit.com/r/Clojure/comments/f4nlau/clojurescript_and_asyncawait/&quot;&gt;https://www.reddit.com/r/Clojure/comments/f4nlau/clojurescript_and_asyncawait/&lt;/a&gt;&lt;br&gt;
[3] &lt;a rel=&quot;nofollow&quot; href=&quot;https://observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript#blockers&quot;&gt;https://observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript#blockers&lt;/a&gt;&lt;br&gt;
[4] &lt;a rel=&quot;nofollow&quot; href=&quot;https://twitter.com/roman01la/status/1155602189311717377&quot;&gt;https://twitter.com/roman01la/status/1155602189311717377&lt;/a&gt;&lt;br&gt;
[5] &lt;a rel=&quot;nofollow&quot; href=&quot;https://twitter.com/borkdude/status/1639579880336621570&quot;&gt;https://twitter.com/borkdude/status/1639579880336621570&lt;/a&gt;&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12806/feature-request-async-await-support-in-cljs</guid>
<pubDate>Mon, 27 Mar 2023 23:57:27 +0000</pubDate>
</item>
<item>
<title>Docstring of with-redefs should mention usage of ^:dynamic in production</title>
<link>https://ask.clojure.org/index.php/12766/docstring-redefs-should-mention-usage-dynamic-production</link>
<description>&lt;p&gt;Currently, the docstring of &lt;code&gt;with-redefs&lt;/code&gt; in CLJS reads:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cljs.core/with-redefs
([bindings &amp;amp; body])
Macro
  binding =&amp;gt; var-symbol temp-value-expr

  Temporarily redefines vars while executing the body.  The
  temp-value-exprs will be evaluated and each resulting value will
  replace in parallel the root value of its var.  After the body is
  executed, the root values of all the vars will be set back to their
  old values. Useful for mocking out functions during testing.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It makes it seem as if it's perfectly fine to use it in a similar way you'd use the same macro in CLJ.&lt;br&gt;
However, &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLJS-1623?focusedCommentId=46238&quot;&gt;this comment&lt;/a&gt; by David Nolen says otherwise: &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;If you want something to be redefinable with &lt;code&gt;with-redefs&lt;/code&gt; in production you need to mark those vars ^:dynamic.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12766/docstring-redefs-should-mention-usage-dynamic-production</guid>
<pubDate>Tue, 14 Mar 2023 13:11:08 +0000</pubDate>
</item>
<item>
<title>Feature request: option to demunge keys in `js-&gt;clj` function</title>
<link>https://ask.clojure.org/index.php/12642/feature-request-option-to-demunge-keys-in-js-clj-function</link>
<description>&lt;p&gt;I'm dealing with JSON data that always uses snake case. While it is possible to achieve what I want with clojure.walk, I think it would be convenient to add an option to &lt;code&gt;js-&amp;gt;clj&lt;/code&gt; to not only keywordize keys, but also demunge them, so that &lt;code&gt;&quot;some_key&quot;&lt;/code&gt; becomes &lt;code&gt;:some-key&lt;/code&gt;.&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12642/feature-request-option-to-demunge-keys-in-js-clj-function</guid>
<pubDate>Sun, 05 Feb 2023 00:11:40 +0000</pubDate>
</item>
<item>
<title>cljs.js/eval: def not working when using :simple optimization (works with :none/:whitespace)</title>
<link>https://ask.clojure.org/index.php/12512/cljs-eval-working-using-simple-optimization-works-whitespace</link>
<description>&lt;p&gt;as the title suggests, def appears to pass through without doing anything.&lt;/p&gt;
&lt;p&gt;i.e. &quot;(def x)&quot; succeeds&lt;br&gt;
but &quot;(def x 10)&quot; fails because&lt;br&gt;
&quot;Cannot read properties of undefined (reading 'x')&quot;&lt;/p&gt;
&lt;p&gt;article here: &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurescript.org/guides/self-hosting&quot;&gt;https://clojurescript.org/guides/self-hosting&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;suggests :simple optimization should work&lt;/p&gt;
&lt;p&gt;to reproduce: &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/sstraust/ClojureDefRepro&quot;&gt;https://github.com/sstraust/ClojureDefRepro&lt;/a&gt; (see comments for instructions)&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12512/cljs-eval-working-using-simple-optimization-works-whitespace</guid>
<pubDate>Wed, 28 Dec 2022 15:51:59 +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'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 '{:deps {org.clojure/clojurescript {:mvn/version &quot;1.11.60&quot;}}}' -M -m cljs.main                                                                          
ClojureScript 1.11.60
                                                                                                                                                   
cljs.user=&amp;gt; (defrecord ARecord [a])                                                                                                                                     
cljs.user/ARecord                                                                                                                                                  

cljs.user=&amp;gt; (macroexpand '(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 '(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>Map destructuring works on singleton lists</title>
<link>https://ask.clojure.org/index.php/12374/map-destructuring-works-on-singleton-lists</link>
<description>&lt;p&gt;(let [{x :x} '({:x &quot;foo&quot;})]  x)&lt;br&gt;
;; =&amp;gt; &quot;foo&quot;&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12374/map-destructuring-works-on-singleton-lists</guid>
<pubDate>Thu, 10 Nov 2022 08:15:43 +0000</pubDate>
</item>
<item>
<title>clojurescript cljs.main -t node compilation in recent releases does not create an `out` dir</title>
<link>https://ask.clojure.org/index.php/12335/clojurescript-cljs-main-compilation-recent-releases-create</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;it appears as if there is a regression since cljs 1.10.748+ that when a node compilation is requested without explicitly specifying the outdir,  a &lt;code&gt;.cljs_node_repl&lt;/code&gt; directory is created as the output dir instead of &lt;code&gt;out&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;The default out compilation directory is not mentioned in &lt;code&gt;cljs.main -h&lt;/code&gt; help, but it appears to be &lt;code&gt;out&lt;/code&gt; by default, and this is backed by statement at the end of &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurescript.org/reference/repl-and-main&quot;&gt;https://clojurescript.org/reference/repl-and-main&lt;/a&gt; :&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Compiling Source&lt;/p&gt;
&lt;p&gt;To compile ClojureScript source code, pass the main namespace to&lt;br&gt;
cljs.main via the -c option:&lt;/p&gt;
&lt;p&gt;java -cp src:cljs.jar cljs.main -c my-namespace.core&lt;/p&gt;
&lt;p&gt;The output will be written to the directory specified via the -d&lt;br&gt;
option (or out if unspecified), or to the file specified via the -o&lt;br&gt;
option.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To reproduce&lt;br&gt;
1. download both clojurescript 1.10.742 and clojuresript 1.10.748 jars, &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/clojurescript/releases&quot;&gt;https://github.com/clojure/clojurescript/releases&lt;/a&gt;&lt;br&gt;
2. create the getting started hello world program from &lt;a rel=&quot;nofollow&quot; href=&quot;https://clojurescript.org/guides/quick-start&quot;&gt;https://clojurescript.org/guides/quick-start&lt;/a&gt;&lt;br&gt;
3. execute &lt;code&gt;java -cp &quot;src;cljs-1.10.748.jar&quot; cljs.main -t node -c hello-world.core&lt;/code&gt;, observe that a &lt;code&gt;.cljs_node_repl&lt;/code&gt; directory has been created instead of the excpected &lt;code&gt;out&lt;/code&gt; dir.&lt;/p&gt;
&lt;p&gt;If one runs the same with and earlier version, e.g. &lt;code&gt;java -cp &quot;src;cljs-1.10.742.jar&quot; cljs.main -t node -c hello-world.core&lt;/code&gt; they can observe that an &lt;code&gt;out&lt;/code&gt; dir is created as expected.&lt;/p&gt;
&lt;p&gt;This looks like a regression to me.&lt;/p&gt;
&lt;p&gt;Workaround is to explicitly specify the directory, .e.g. &lt;code&gt;java -cp &quot;src;cljs-1.11.60.jar&quot; cljs.main -t node -d out -c hello-world.core&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description>
<category>ClojureScript</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/12335/clojurescript-cljs-main-compilation-recent-releases-create</guid>
<pubDate>Thu, 27 Oct 2022 18:07:40 +0000</pubDate>
</item>
</channel>
</rss>