This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-30
Channels
- # aleph (1)
- # announcements (7)
- # aws (4)
- # beginners (52)
- # calva (11)
- # cider (20)
- # clj-kondo (36)
- # clojure (53)
- # clojure-austin (1)
- # clojure-brasil (1)
- # clojure-conj (1)
- # clojure-europe (27)
- # clojure-italy (17)
- # clojure-nl (11)
- # clojure-norway (2)
- # clojure-spec (41)
- # clojure-uk (39)
- # clojuredesign-podcast (2)
- # clojurescript (22)
- # clojutre (14)
- # community-development (24)
- # cursive (6)
- # data-science (1)
- # datomic (38)
- # duct (3)
- # figwheel-main (8)
- # fulcro (34)
- # funcool (8)
- # jackdaw (3)
- # jobs (2)
- # off-topic (84)
- # pathom (3)
- # re-frame (4)
- # shadow-cljs (8)
- # tools-deps (5)
- # vim (7)
@tony.kay hello, using Fulcro 3, I'm trying to wrap my network so I get pathom traces during development, but I can't figure how to make that work... I tried using a request middleware
(fulcro-http/fulcro-http-remote
{:url ""
:request-middleware (let [wrapper (fulcro-http/wrap-fulcro-request)]
(fn [req]
(let [req' (update req :body conj :com.wsscode.pathom/trace)]
(wrapper req'))))})
also trying wrapping the remote completely:
(let [remote (fulcro-http/fulcro-http-remote
{:url ""})]
{:transmit! (fn [x req]
(let [req' (update-in req [::txn/ast :children] conj {:type :prop
:key :com.wsscode.pathom/trace
:key :com.wsscode.pathom/trace})]
((:transmit! remote) remote req')))})
but the source seems to never get modified in Inspect
is there a way to make this affect the inspect so the request goes with trace?
@wilkerlucio So, Inspect is sent messages from the tx processing separate from the low-level networking
try the global-eql-transform option to the app itself. I think that is applied before it reaches that layer
@tony.kay thanks, I just tried, seems like the trace is correctly add to the query, but for some reason the response is not picking up
if I get the same query and use Send to query
and then send from there, it works
I guess maybe the response merge is not considering the modified query
:query-transform-default
is used as the default for load
…`global-eql-transform` is at the network layer
I think that might have been intentional now that I’m revisiting it. The former is for changing queries for loads, and the other is for doing “behind the scenes” augments nearer the network layer (which can include messing with mutations)
This particular concern: getting trace data to inspect…I think we need an addl “event” that sends that to inspect
Much better to put something at the network layer that asks for it (which is what you just did) and something else that looks for it in the response and sends an event to inspect
yeah, there are pros and cons on having it on state, I think it helps with clarify when its part of the DB, being nothing special, this allows debugging the data from the trace if needed so
I just tried using :query-transform-default
, but no effect there
ok, that is a bug…I think I see it…just a min. These corner case things get used so rarely 😜
But in any case: I see the pathom trace as a pure tooling issue, not something for the client application layer (unless the app layer itself is implementing trace viewing). Therefore, there is no reason you should have to configure it at all (other than to have Inspect open and attached to the application, and perhaps a “show trace” option enabled).
So, I’d say we should add an addl hook that lets Inspect turn on/off tracing (which sends that message to the app), and then logic at the network layer that adds in the query bit and pulls off the trace result to send to inspect.
(we can delay the toggle until later if we want, and make it purely an app config option)
Hey, is @currentoor's Fulcro presentation from Clojure South available anywhere on the internet yet? It was announced here on slack earlier and I wouldn't want to miss it. 😊