This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-09-30
Channels
- # announcements (31)
- # aws (17)
- # babashka (26)
- # babashka-sci-dev (8)
- # beginners (16)
- # biff (1)
- # calva (9)
- # cider (5)
- # clj-kondo (3)
- # clj-on-windows (38)
- # cljdoc (2)
- # cljs-dev (9)
- # cljsrn (6)
- # clojure (58)
- # clojure-europe (47)
- # clojure-nl (3)
- # clojure-norway (21)
- # clojure-uk (2)
- # clojurescript (25)
- # conjure (2)
- # data-science (7)
- # datomic (3)
- # emacs (12)
- # events (5)
- # fulcro (5)
- # honeysql (10)
- # introduce-yourself (7)
- # lsp (4)
- # meander (3)
- # nbb (18)
- # off-topic (28)
- # rdf (1)
- # releases (2)
- # sci (5)
- # shadow-cljs (23)
- # sql (5)
- # test-check (3)
see https://code.thheller.com/blog/shadow-cljs/2019/08/25/hot-reload-in-clojurescript.html
I did, but this is not explaining the interactions between reitit and reloading.
most likely you are keeping some reitit state in your app db. ie. a render function, this function is not updated on hot-reload and as such you don't see any changes?
here is my example:
https://github.com/andrzejsliwa/shadow-cljs-tailwind/blob/main/src/main/app/routes.cljs
no matter if I define match state as defonce or def
where I’m changing some style in “interactive” view, changes are not reloaded, until I refresh browser manually
for example in this line https://github.com/andrzejsliwa/shadow-cljs-tailwind/blob/d516487b5c3b152fbef4e929a231b7d960e65c10/src/main/app/tailwind.cljs#L331
you can change class of color
when I’m rendering interactive component as root, everything working like expected, but when router is involved it’s not refreshing
you can also change the text in href or header
ok, I found it, the problem was that (router-start!) was in
(defn ^:export init
[]
(router-start!)
(start))
when I move it to
(defn ^:dev/after-load start
[]
(router-start!)
(d/render
[current-page]
(.getElementById js/document "app")))
then it’s working
thx @U05224H0W for pushing me in a good direction.
so you see old code, unless you re-create this map (which I assume the router-start!
does
I wonder if anyone here had a similar issue and knows how to force the update of react component rendered behind routing. (on changing file via shadow watch)