This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-18
Channels
- # beginners (84)
- # boot (21)
- # cider (12)
- # cljs-dev (13)
- # cljsrn (3)
- # clojure (169)
- # clojure-dusseldorf (2)
- # clojure-gamedev (6)
- # clojure-germany (1)
- # clojure-russia (15)
- # clojure-serbia (4)
- # clojure-spec (16)
- # clojure-uk (4)
- # clojurescript (51)
- # core-async (1)
- # datomic (23)
- # emacs (16)
- # figwheel (1)
- # fulcro (60)
- # hoplon (8)
- # lein-figwheel (3)
- # leiningen (1)
- # luminus (4)
- # lumo (43)
- # off-topic (4)
- # re-frame (17)
- # rum (37)
- # shadow-cljs (21)
- # test-check (13)
- # vim (14)
@favila yes. the compiler could set :features #{:cljs-macro :cljs}
when compiling macro namespaces. you could still use :cljs
as usual but :cljs-macro
if you really need something to be macro only. :clj
stays as is.
An interesting point was raised by @juhoteperi in #clojurescript : The checked variant of aset
has the notion that the index must be within the existing array, while on the other hand, if you take the stance that a-
fns are fundamentally hosty, then you would not place an upper bound on the numerical index value, and let the host JavaScript array grow.
Does Closure rename properties in objects which are created with #js
or clj->js
?
@juhoteperi My guess would be yes, for #js
, because it can see the JavaScript, but it can’t for clj->js
Reagent builds one object using reduce + aset (or goog.object/set if I fix that), and currently calls methods from the object in a way that Closure doesn't rename methods
If I fix all the calls to use just normal property access or method call, I can't call methods from that object
closure doesn’t rename anything that comes out of clj->js
. but it will rename everything you call on the result
closure doesn’t like dynamically constructing properties so you’ll need externs for the property names you construct
I can't know the names, as the object is React component, and could have additional lifecycle properties for libraries etc.
Hmm, well, those libraries will have externs in most cases, but then it wouldn't work when React and libraries are also optimized (without externs)