This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-05
Channels
- # aws (1)
- # beginners (57)
- # boot (3)
- # cider (6)
- # clara (49)
- # cljs-dev (47)
- # cljsjs (23)
- # clojure (144)
- # clojure-dev (2)
- # clojure-finland (1)
- # clojure-germany (1)
- # clojure-sg (1)
- # clojure-spec (25)
- # clojure-uk (245)
- # clojurescript (39)
- # core-async (3)
- # cursive (6)
- # datomic (117)
- # emacs (3)
- # fulcro (6)
- # hoplon (10)
- # jobs (7)
- # juxt (5)
- # leiningen (11)
- # om (27)
- # pedestal (4)
- # perun (2)
- # re-frame (22)
- # reagent (35)
- # ring-swagger (11)
- # shadow-cljs (333)
- # spacemacs (10)
- # specter (10)
- # sql (20)
- # vim (8)
The UMD wrapper PR was finally merged into Closure
That should fix least Leaflet & few others, not sure about d3
Yeah, checked d3-array.js and looks like latest Closure-compiler can process that
Hopefully other d3 files use the same wrapper 馃檪
Might already work with Cljs when using Closure snapshot, unless there are some breaking changes on Closure API
I鈥檓 trying to cljs.js/eval-str
with a for
macro (or any macro) but get a bunch of warnings, eg. WARNING: Use of undeclared Var cljs.core$macros/seq at line 2
first time messing with self-host and it just might be because the analyzer data is generated by shadow-cljs
@thheller happy to look at a small repro in the stock CLJS REPL
no stack CLJS REPL available since I鈥檓 trying to enable using cljs.js
in shadow-cljs builds
@thheller I have a hunch
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L690
add-core-macros-if-cljs-js
?
but yes, that was the initial problem. macros weren鈥檛 generated at all since I resolve deps a bit differently and don鈥檛 use cljs.closure
at all
I can compile code without macros just fine, just the macros don鈥檛 expand quite right
(defn compile-it []
(cljs/eval-str
boot/compile-state-ref
"(ns my.user (:require [reagent.core :as r]))
(map inc [1 2 3])
(doall (for [n (range 10)] n))"
"[test]"
{:eval cljs/js-eval
:analyze-deps false
:verbose true
:load boot/load}
print-result))
^ you have no other macros in your snippet
no other
besides for
which is why I think you haven鈥檛 loaded the core macros
I would check if (get-in @boot/compile-state-ref [:cljs.analyzer/namespaces 'cljs.core$macros])
is there
what about js/cljs.core$macros
in the runtime environment?
cool so there鈥檚 nothing wrong with your compiler state AFAICT
I don鈥檛 quite get what cljs.js/patch-alias-map
does. I never call that so thats my suspect currently.
that will be called for you
the point of that function is making clojure
->`cljs` namespace aliasing work
ok must be the macro generation. the cljs.core$macros is full of new cljs.core.Symbol("cljs.core$macros","seq","cljs.core$macros/seq",-1873195024,null)
which should probably be cljs.core/seq
@anmonteiro I found it. I was reading with the wrong *ns*
binding, so cljs.core$macros
instead of cljs.core
. At least dropping the macros suffix fixed the issue.