This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-09
Channels
- # aleph (1)
- # announcements (4)
- # asami (6)
- # babashka (45)
- # beginners (19)
- # biff (3)
- # calva (35)
- # cider (4)
- # clojars (5)
- # clojure (117)
- # clojure-art (3)
- # clojure-denmark (2)
- # clojure-europe (89)
- # clojure-gamedev (5)
- # clojure-nl (4)
- # clojure-norway (17)
- # clojure-spec (3)
- # clojure-uk (5)
- # clojurescript (84)
- # conjure (13)
- # datomic (11)
- # emacs (2)
- # figwheel (2)
- # fulcro (16)
- # graphql (5)
- # honeysql (7)
- # introduce-yourself (1)
- # lsp (86)
- # malli (16)
- # music (1)
- # off-topic (2)
- # pathom (14)
- # polylith (28)
- # re-frame (11)
- # reagent (23)
- # releases (1)
- # reveal (19)
- # shadow-cljs (72)
- # spacemacs (13)
- # sql (1)
- # test-check (3)
- # timbre (4)
- # tools-deps (45)
- # vim (18)
Is there a way to hint the inspector to not monitor a transaction? Sometimes when the transaction is too big or many transactions happen in short amount of time, the browser gets really slow because all the data need to be serialized to the inspector (if I understood it correctly)
Look at the inspector client ns in Fulcro, make a copy & adjust, use it instead
Hi there, I'm working on some simple Fulcro app at the moment and have stumbled across a simple yet alluding problem. I want to have a simple token-based authentication system for my app, and the flow is really basic:
1. User enters creds and press Login
2. Server authenticates against the creds and return back a JWT token
3. The frontend saves the token to be used in subsequent requests
At the moment I'm looking at client request middleware to augment outgoing requests with a Authorization
header, but the problem is that this means the very first request (the login request) will also be augmented, which is not what I want. What is the recommended/common way of handling this situation? I'm thinking about simply checking if my token is not nil and augment the requests accordingly but I'm not sure if this is the right way to do it. Thanks in advance.
@U0CKQ19AQ Thanks a lot 🙂 I'm actually thinking about doing something similar to the latter where I'd have 2 remotes, one for any unauthenticated requests and one for authenticated ones. The former sounds like I'd need to modify the remote logic for all mutations.
You just have to add one or more remote, and include the correct one in a mutation…See https://book.fulcrologic.com/#_the_remote_sections
I.e. in the application definition, add a remote with a made-up name like :public
, then in the mutation use a (public [env] true)
section to indicate that that mutation uses that remote. Done.
Is it OK for multiple stateful components to have the same :ident? For example, I have a list of people with each line item as Person, than I have a dedicated page for a Person that I call PersonPage with extra information*. Both *Person and PersonPage seem to require the same :ident.
(defsc Person[_ {:person/keys [id name]}]
{:ident :person/id ; <<<==== SAME AS PersonPage
:query [:person/id :person/name]} ;
(dom/p (str "Person ID: " id " -> ") (dom/strong name)))
(def ui-person (comp/factory Person {:keyfn :person/id}))
(defsc AllPeople [_ {:keys [all-people]}]
{:ident (fn [] [:component/id ::AllPeople])
:query [{:all-people (comp/get-query Person)}]
:initial-state {}
:route-segment ["all"]}
(dom/div
(dom/h3 "All People")
(dom/ul (map ui-person all-people))))
(defsc PersonPage [_ {:person/keys [id name biography]}]
{:ident :person/id ; <<<==== SAME AS Person
:query [:person/id :person/name :person/biography]
:initial-state {}
:route-segment ["person" :person-id]
:will-enter (fn [_app route-params]
(dr/route-immediate
[:person/id
(js/parseInt (:person-id route-params))]))}
(dom/div {} (dom/h1 "Single Person Page")
(dom/p (str "Person #" id ": ") (dom/strong name) " - " biography)))
Perfectly normal and idiomatic, both query from the same normalized person "table" in the Fulcro db.
Thank you for confirming, this is big help ...