This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-03
Channels
- # beginners (98)
- # boot (18)
- # chestnut (2)
- # cider (90)
- # cljdoc (3)
- # cljs-dev (1)
- # clojure (64)
- # clojure-dev (14)
- # clojure-dusseldorf (4)
- # clojure-italy (11)
- # clojure-nl (5)
- # clojure-spec (9)
- # clojure-uk (69)
- # clojurescript (63)
- # code-reviews (2)
- # core-logic (20)
- # cursive (13)
- # datomic (52)
- # dirac (2)
- # emacs (4)
- # figwheel (6)
- # hyperfiddle (13)
- # luminus (4)
- # nrepl (1)
- # off-topic (7)
- # onyx (9)
- # overtone (3)
- # parinfer (3)
- # pedestal (1)
- # re-frame (31)
- # reagent (74)
- # reitit (34)
- # rum (3)
- # shadow-cljs (51)
- # spacemacs (22)
- # specter (7)
- # tools-deps (23)
- # uncomplicate (3)
- # vim (9)
Hi everybody, I have a problem configuring figwheel-main
in my project. Is this the right channel to ask questions? 🙂
Recently I ran into a situation with figwheel-sidecar
where I had a macro in a ns like:
clj
(ns foo.mac)
(def a "hello")
(defmacro foo [] @(resolve 'a))
and a cljs file like
clj
(ns foo.bar (:require-macros [foo.mac :as f]))
(defn on-js-reload []
(f/foo))
and it throws an NPE when compile the CLJS. The reason is that (resolve 'a)
returns nil
, and that is because the bound *ns*
during macroexpansion in the foo.mac
ns is bound to cljs.user
, not the ns foo.mac
.
Anyone have any thoughts on that?In general, I’m not sure it is “safe” to use resolve
at macroexpansion time during CLJS compilation, but I also don’t have any reason to believe it isn’t safe.