This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-21
Channels
- # announcements (1)
- # architecture (1)
- # beginners (125)
- # boot (6)
- # boot-dev (2)
- # calva (69)
- # cider (38)
- # cljs-dev (3)
- # clojure (212)
- # clojure-austin (7)
- # clojure-australia (1)
- # clojure-denver (2)
- # clojure-europe (3)
- # clojure-gamedev (1)
- # clojure-hamburg (8)
- # clojure-italy (10)
- # clojure-nl (31)
- # clojure-russia (3)
- # clojure-uk (57)
- # clojurescript (56)
- # core-async (3)
- # cursive (15)
- # datascript (1)
- # duct (28)
- # emacs (6)
- # events (1)
- # figwheel-main (11)
- # fulcro (22)
- # luminus (59)
- # lumo (2)
- # onyx (4)
- # overtone (1)
- # re-frame (1)
- # reagent (4)
- # remote-jobs (3)
- # rum (2)
- # shadow-cljs (84)
- # spacemacs (7)
- # speculative (5)
- # vim (1)
- # yada (127)
with figwheel-main, do I need to include something in my figwheel-main.edn that indicates that it should actually perfom the hooks I have defined?
I have an ns with ^:figwheel-hooks
and a function with ^:after-load
, but when it recompiles, it doesn't run those functions :/ interestingly, if I just put a call to the function in the namespace, it will call it as it re-evals the compiled js
so I just drop a
(-main)
at the bottom of the main file
seems a little primitive
@idiomancy I just came to ask a question about the figwheel hooks too. I have my hooks in main.cljs, and when I modify ajax.cljs, I see the figwheel spinner, but my after-load function is not called.
Actually, I think my bug is unrelated. I'm not seeing [Figwheel] loaded (tutorial.moan.frontend.ajax)
, but I am seeing [Figwheel] loaded (tutorial.moan.frontend.main)
in the logs. So I guess it's not loading the ns for some reason :thinking_face:
try a lein clean
? I've had weird problems like that if I've changed the namespace or restructured the project's directories.
I've seen this on 2 machines today, I'm assuming it's a problem with the environment I've created.
Hmm, poking at internals, I ran this comment tweaked to my project:
(let [compile-env (atom (first (vals @last-compiler-env)))]
(binding [env/*compiler* compile-env]
(paths->namespaces-to-reload [(.getCanonicalPath (io/file "src/tutorial/moan/frontend/ajax.cljs"))])
))
I notice that (:sources @env/*compiler*)
only includes my main.cljs, not my ajax.cljs. And also that I get no results back.Ah, that was the clue I needed 🙂 Looks like it's the result of having :build-inputs
set to :main
.
https://figwheel.org/docs/build_inputs.html I don't feel like this trade-off is mentioned here really. Is this intentional (and needs docs) or a bug?