This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-26
Channels
- # aleph (4)
- # announcements (3)
- # babashka (31)
- # beginners (74)
- # bitcoin (7)
- # calva (11)
- # cider (17)
- # clj-kondo (5)
- # clojars (11)
- # clojure (81)
- # clojure-australia (3)
- # clojure-dev (73)
- # clojure-europe (136)
- # clojure-nl (5)
- # clojure-spec (10)
- # clojure-uk (41)
- # clojurescript (30)
- # core-async (1)
- # cursive (19)
- # data-oriented-programming (4)
- # datascript (5)
- # datomic (6)
- # docker (6)
- # emacs (1)
- # figwheel-main (1)
- # fulcro (6)
- # jobs (1)
- # jobs-discuss (17)
- # lsp (23)
- # malli (6)
- # off-topic (35)
- # pathom (2)
- # re-frame (56)
- # reitit (2)
- # rewrite-clj (3)
- # shadow-cljs (10)
- # spacemacs (6)
- # sql (11)
- # vim (16)
- # xtdb (3)
New version of https://github.com/holyjak/fulcro-troubleshooting that gets rid of most of the annoying"ident is nil" warnings where they did not had any value.
I'm working through some fulcro concepts with the template and the book. I'm got a component that uses :will-enter
that loads data inside dr/route-deferred
. It's all working fine. This component is part of the TopRouter
that comes with fulcro template.
But now I want to add html5 path and history support. I started by just trying to get a different route to load at app boot, not even messing with history or anything yet.
After the uism/begin!
but before the app/mount!
I've added (dr/change-route! SPA ["quiz-index"])
. I'd expect the app to boot and the my-route to be rendered. But it is not.
I can see that the :will-enter
function is firing, the data is loaded from pathom, but the route doesn't render and I get this error
ERROR [com.fulcrologic.fulcro.routing.dynamic-routing:188] - dr/target-ready! was called but there was no router waiting for the target listed: [:component/id :quiz-index] This could mean you sent one ident, and indicated ready on another.
I'm fairly sure the case warned about in the error message doesn't apply because I'm using comp/get-ident
in the call to post-mutation-params
(defsc QuizIndexPage [this {:keys [all-user-forms] :as props}]
{:query [{[:all-user-forms '_] (comp/get-query QuizListItem)}]
:ident (fn [] [:component/id :quiz-index])
:route-segment ["quiz-index"]
:initial-state {:all-user-forms []}
:will-enter (fn will-enter [app _]
(dr/route-deferred (comp/get-ident QuizIndexPage nil)
#(df/load! app :all-user-forms QuizListItem
{:post-mutation `dr/target-ready
:post-mutation-params {:target (comp/get-ident QuizIndexPage nil)}})))})
Not sure if this is related, but I've gotten this warning out of the box with fulcro-template
#error {:message "", :data {}}
Attempt to get an ASM path
[:com.fulcrologic.fulcro.ui-state-machines/local-storage :path-segment]
for a state machine that is not in Fulcro state. ASM ID:
:app.ui.root/TopRouter
Just ignored it for now. But https://webcache.googleusercontent.com/search?q=cache:xdQSQwODXGsJ:https://clojurians-log.clojureverse.org/fulcro/2020-02-14+&cd=5&hl=en&ct=clnk&gl=us&client=firefox-b-d seems to indicate it is harmless.Figured it out 🙈 the state machine provided in the template for loading the session changes the route to main. https://github.com/fulcrologic/fulcro-template/blob/master/src/main/app/model/session.cljs
I noticed a State Machine (BEGIN)*:app.ui.root/TopRouter*
transaction was happening twice in the Fulcro dev tools. Once for my route and one later for "main"