Fork me on GitHub
#fulcro
<
2019-08-22
>
tony.kay01:08:40

Fulcro 3 remotes are just maps…you could easily write one to use the f2 pathom remote @souenzzo

tony.kay01:08:41

I should probably make a function that does so…it’s a generic transform from one interface to another

tony.kay01:08:57

Ah, but it will bring f2 onto your classpath I guess, so it would need to be a separate lib or something

tony.kay01:08:50

which i’m not going to do 😜 Basically f3 remote is a map with :transmit! key that is a function that gets a send node (a map). See the implementations in F3. Just adapt that to proxy over to the f2 remote’s send method, and pass callbacks that adapt the response.

tony.kay01:08:33

Once you’ve done that, publish it for everyone else 😄

souenzzo13:08:46

I implemented it https://github.com/souenzzo/fulcro-pathom-realworld-example-app/blob/feature/fulcro/src/main/realworld_fulcro/proxy.cljc#L107 But I'm a bit unsure about this impl. the :com.wsscode.pathom/trace isn't working on inspect Need some docs about which keys we should pass to result-handler It's really hard to find in the "main" impl with keys are passed to result-handler https://github.com/fulcrologic/fulcro/blob/develop/src/main/com/fulcrologic/fulcro/networking/http_remote.cljs#L288

wilkerlucio13:08:25

inspect will need upgrade, since it has to detect network type and augment it (so it can transform the query to add the trace property to the request)

wilkerlucio13:08:53

oh, maybe not, this may need to go in fulcro code since the wrappers live in fulcro now

wilkerlucio13:08:03

@U0CKQ19AQ I'm remembering now that this changed right, there is no more wrappers? sorry @souenzzo, I'm not close enough to this code to give you proper guide, would have to look again and understand the new integration better

tony.kay14:08:15

See default remote. I know it’s a bit of tracing, but it is really just this:

tony.kay14:08:34

That’s the format of the value passed to the result handler

souenzzo14:08:57

(let [tx {:type :root, :children [{:type :prop, :dispatch-key :foo, :key :foo}]}]
  {:transaction      tx
   :outgoing-request request??
   :headers          {}
   :body             (parser (eql/ast->query tx))
   :status-code      200
   :status-text      "ok"
   :error            nil
   :error-text       nil})
Can I use nil on request?

tony.kay14:08:54

yeah, just drop that key

👍 4
tony.kay14:08:11

I think the only things that the built-in stuff uses is body and status-code and transaction…the other stuff is for extra info