(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!