I have a curious problem with my Figwheel configuration. In my core namespace, I have two relevant functions:
(defn mount-root []
(reagent/render [views/main-panel]
(.getElementById js/document "app")))
(defn ^:export init []
(re-frame/dispatch-sync [:initialize-db])
(dev-setup)
(mount-root))
And my figwheel config is correctly set up to run only mount-root
on change:
cljs.user=> (print-config dev)
{:id "dev",
:source-paths ["src/cljc" "src/cljs"],
:figwheel {:on-jsload "mazes.web.core/mount-root", :build-id "dev"},
(build options omitted, because that's all proven to be working)And yet, whenever I change a file, it's definitely running the init
function. That function is invoked in a script tag at the top of the HTML page, but I can't see why it should be invoked again.
...actually it's running init
and then mount-root
. Something's afoot.
🦆
Not sure what I did to fix this, but restarting and reloading various things was eventually enough to kick it back onto track. Glad it's working, but I don't like not knowing why.
Anyone else seeing a lot of warnings about document.write() in recent Chrome stable versions? Seems to be this: https://developers.google.com/web/updates/2016/08/removing-document-write?hl=en