This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-08
Channels
- # architecture (8)
- # aws (25)
- # babashka (9)
- # beginners (57)
- # calva (16)
- # cider (16)
- # clj-kondo (3)
- # cljdoc (13)
- # cljsrn (6)
- # clojure (272)
- # clojure-europe (36)
- # clojure-losangeles (1)
- # clojure-nl (8)
- # clojure-poland (3)
- # clojure-spec (4)
- # clojure-uk (8)
- # clojuredesign-podcast (9)
- # clojurescript (92)
- # code-reviews (1)
- # conjure (8)
- # core-async (1)
- # cursive (13)
- # datalog (1)
- # datascript (35)
- # datomic (76)
- # duct (10)
- # emacs (5)
- # events (7)
- # figwheel-main (1)
- # fulcro (35)
- # graalvm (20)
- # graphql (6)
- # jobs (3)
- # klipse (1)
- # london-clojurians (1)
- # malli (3)
- # off-topic (223)
- # pathom (2)
- # pedestal (13)
- # portal (1)
- # reitit (6)
- # remote-jobs (1)
- # shadow-cljs (21)
- # specter (2)
- # sql (63)
- # tools-deps (85)
- # tree-sitter (4)
- # xtdb (6)
Hello all, does anyone here use Figwheel with IntelliJ (Cursive)?
This question is likely more IntelliJ-related than Cursive-related, but I thought this would be a good audience to ask.
When I save a file in IntelliJ, my running Figwheel instance does not do a hot-reload right away. I have to switch my focus to the browser or the Figwheel repl for the hot reload to happen. When saving a file in a different editor, VS Code for example, the hot-reload happens right after saving.
I think this has something to do with the virtual filesystem setup by IntelliJ. Something about saving a file in IntelliJ doesn’t alert other programs like normal. An other clue is when I execute the Reload All From Disk
command inside IntelliJ, the hot-reload happens.
If anyone has a clue it would be a huge step towards front-end nirvana.
Oh you are brilliant. That one question solved it for me.
⌘-S was not bound to anything in IntelliJ. I just assumed it was. It must have auto-saved when I switched the focus off of IntelliJ.
After binding ⌘-S to Save All
, everything works like it should.
Thank you so much. And thank you for Cursive. I really love it.
Great! I’m glad it’s working. And thanks for the kind words, I’m glad you’re liking Cursive!
I have this in my core.cljs
file:
(defn ^:after-load refresh-on-figwheel-reload
[]
(rf/dispatch [:globals/refresh-on-figwheel-reload]))
Do you have something like that?Hey, yup mine is like this
(defn ^:after-load re-render []
(rdom/render [views/app] (dom/$ "app")))
Just re-rendering a reagent component to the dom.
Hmm, seems like it should work then
Yeah, I think this part is good. But thank you all the same. Your CLJS files refresh without taking focus off of IntelliJ?
You might try the ^{:key ...}
trick, sometimes React does some internal caching that causes it to hold on to old renderings.
Ok, I’ll give that a try.
Generally I can’t see my browser while IntelliJ has the focus, because the browser and the IDE are both full-screen on the same monitor, but I’ve seen CLJS debug messages scroll by in the CLJS REPL, so I’m assuming so.
My CLJS files do refresh, but it can take a bit of time to re-compile, plus even after the refresh happens, my UI doesn’t necessarily re-render until it notices a data change. I have the refresh-on-figwheel-reload
event handler set up to increment a value in the app-db, and then in my main page render I have
(fn []
^{:key (str "figwheel-refresh-key-" @[:globals/figwheel-refresh-key])}
[:div.container
;; main page container
])