This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-09
Channels
- # announcements (1)
- # aws (4)
- # beginners (55)
- # calva (13)
- # cider (58)
- # clj-kondo (59)
- # cljs-dev (4)
- # clojure (21)
- # clojure-austin (1)
- # clojure-dev (2)
- # clojure-europe (4)
- # clojure-italy (9)
- # clojure-nl (13)
- # clojure-norway (4)
- # clojure-spec (12)
- # clojure-uk (15)
- # clojurescript (22)
- # cursive (11)
- # datomic (3)
- # duct (1)
- # events (1)
- # fulcro (6)
- # graalvm (28)
- # hoplon (9)
- # jobs (2)
- # jobs-discuss (21)
- # mount (14)
- # nrepl (4)
- # off-topic (38)
- # pathom (1)
- # perun (4)
- # re-frame (17)
- # reitit (32)
- # shadow-cljs (44)
- # testing (7)
- # tools-deps (62)
- # vim (10)
We’re thinking about submitting this patch to CLJS which would allow to remove a check for defonce
emission under advanced optimizations:
diff --git a/src/main/clojure/cljs/core.cljc b/src/main/clojure/cljs/core.cljc
index 2beaca2b..5d817106 100644
--- a/src/main/clojure/cljs/core.cljc
+++ b/src/main/clojure/cljs/core.cljc
@@ -618,7 +618,7 @@
"defs name to have the root value of init iff the named var has no root value,
else init is unevaluated"
[x init]
- `(when-not (exists? ~x)
+ `(when (or (not ^boolean goog.DEBUG) (not (exists? ~x)))
(def ~x ~init)))
(core/defn destructure [bindings]
4
wanted to bring it up here first to see if there’s anything that we’re missing
we’ve verified that Closure can remove the if
that checks whether x
is defined with the above patch, but not without
thoughts?