This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-16
Channels
- # aws (17)
- # babashka (2)
- # beginners (131)
- # bristol-clojurians (1)
- # calva (16)
- # chlorine-clover (6)
- # cider (10)
- # clara (5)
- # cljsrn (82)
- # clojure (176)
- # clojure-dev (14)
- # clojure-europe (13)
- # clojure-italy (13)
- # clojure-nl (4)
- # clojure-spec (10)
- # clojure-sweden (32)
- # clojure-uk (32)
- # clojuredesign-podcast (2)
- # clojurescript (34)
- # community-development (2)
- # conjure (17)
- # cursive (4)
- # datomic (51)
- # emacs (6)
- # figwheel-main (26)
- # fulcro (16)
- # graalvm (11)
- # jobs (2)
- # jobs-discuss (30)
- # kaocha (4)
- # meander (23)
- # off-topic (34)
- # pathom (5)
- # re-frame (10)
- # reagent (3)
- # reitit (6)
- # releases (3)
- # sci (36)
- # shadow-cljs (27)
- # sql (9)
- # testing (6)
- # tools-deps (28)
- # vim (8)
(def routes
["/"
;; any routes like this one(no params coercion) work fine with figwheel reloading
["upload-files" {:name :routes/upload-files
:view upload-files/page
:controllers [{:start (fn [_] (rf/dispatch [:page/init-upload-files]))}]}]
;; any updates to routes like this one(hiccup in upload_files_show/page) are never detected
;; the only way is to rerun lein shadow watch app which is super slow
["upload-files/:id" {:name :routes/upload-files-show
:view upload_files_show/page
:coercion reitit.coercion.malli/coercion
:params {:path [:map [:id number?]]}
:controllers [{:parameters {:path [:id]}
:start (fn [{:keys [path]}]
(rf/dispatch [:page/init-upload-file (:id path)]))}]}]
])
(def router
(reitit.frontend/router
routes
{:data {:coercion reitit.coercion.malli/coercion}}))
project.clj:
[thheller/shadow-cljs "2.9.2" :scope "provided"]
[metosin/reitit "0.4.2"]
[metosin/reitit-malli "0.5.3"]
Perhaps anyone has seen something like this before? Any ideas on what I can try to get this fixed?@nfedyashev Are you reinitializing the router on main ns reload? https://github.com/metosin/reitit/blob/master/examples/frontend-re-frame/src/cljs/frontend_re_frame/core.cljs#L144-L153
or using reload hook or something
(defn ^:dev/after-load mount-root []
(rf/clear-subscription-cache!)
(routes/init-routes!)
(rdom/render [views/root] (.getElementById js/document "app")))
(defn init! []
(ajax/load-interceptors!)
(mount-root))
in core.cljsLooks ok. Maybe something in views/root or wherever you are rendering the current view ?
Sorry, that's my bad. It had nothing to do with reitit. Resource does not have expected namespace {:tag :shadow.build.resolve/unexpected-ns, :resource "app/ui/views/voter_files_details.cljs", :expected-ns app.ui.views.voter-files-details, :actual-ns app.ui.views.voter_files_details} @juhoteperi thanks for your help!