re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
zendevil 2021-03-22T22:48:05.015300Z

I’m sending a post request with qualified keywords like so:

:http-xhrio {:method :post
   :uri "/the-uri"
   :params {:user/foo 1 :user/bar 1}
   :on-success [:foo]
   :on-failure [:bar]
   :response-format (edn/edn-response-format)
   :format (edn/edn-request-format)
   }
And also using cljs-ajax library purely:
(ajax-request {:uri "/the-uri" :method :post :params {:user/foo 2 :user/bar 2} :handler (fn [res] (prn res)) :format (edn/edn-request-format) :response-format (edn/edn-response-format)})
In the former case, the incoming :params in the server aren’t namespace qualified, i.e., {:foo 1 :bar 2}, whereas in the latter case they are, i.e., {:user/foo 1 :user/bar 2}. Is this a bug in the re-frame-http-fx library?

p-himik 2021-03-22T22:50:51.015600Z

Probably not because it doesn't touch :params at all.

zendevil 2021-03-22T23:06:25.015800Z

is there a way to debug the cause?

p-himik 2021-03-22T23:09:20.016Z

Sure, same way you debug JavaScript. If you have sourcemaps set up correctly (which should be by default with at least shadow-cljs) and, perhaps, if you're using cljs-devtools, then you just open the relevant file in Chrome's devtools and set a breakpoint and go from there.

zendevil 2021-03-22T23:16:01.016200Z

@p-himik what are sourcemaps?

p-himik 2021-03-22T23:17:53.016400Z

Any web search engine would give you a description that's better than anything I could come up with. It's a fundamental part of frontend development.

zendevil 2021-03-22T23:36:23.016600Z

@p-himik what port would I be able to debug at?

p-himik 2021-03-22T23:37:02.016900Z

I debug directly in the browser where there's no need to use any ports.

p-himik 2021-03-22T23:37:11.017100Z

Have you ever debugged JavaScript?

zendevil 2021-03-22T23:37:22.017300Z

it’s a react native app

zendevil 2021-03-22T23:37:46.017500Z

the packer is running on :8081. Would it be that one?

p-himik 2021-03-22T23:38:07.017700Z

Ah, then I have zero clue. I'd search for how to debug React Native apps written in JavaScript. Then I'd transition that knowledge to ClojureScript.

zendevil 2021-03-22T23:52:04.017900Z

where exactly should I put the breakpoint?

zendevil 2021-03-22T23:54:24.018100Z

In the re-frame event handler? What would that tell me that I can’t find with print statements in my source?

p-himik 2021-03-22T23:58:21.018400Z

It seems like you have a lot of questions that really belong in #beginners. I cannot teach you how to debug programs.

👍 1