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
2020-07-03T00:25:51.250300Z

I have created a new FAQ entry covering this: https://day8.github.io/re-frame/FAQs/FocusOnElement/

5πŸ‘
2020-07-03T13:17:58.254800Z

started reading it, I like the way it slowly explains Clojurescript on examples

2020-07-03T13:18:20.255Z

Reading definitely takes much longer than 20 minutes, it took me about 20 minutes to get to Special forms

2020-07-03T13:18:48.255200Z

I would remove or postponed the section about quoting, not really needed there for anything.

2020-07-03T13:25:41.255400Z

Description of fn is quite hard to digest. I would maybe swap fn with def which is much easier to explain and then I would start fn with a few simple examples and I would follow with explaining the general fn on them.

2020-07-03T13:26:23.255600Z

The examples below with two starting parethesis might look strange to a beginner.

2020-07-03T13:39:18.255800Z

We need to make some changes:

(let [a  "the pen"
      b  "a sword"]   
  (if (> a b) a b)) 
evaluates toΒ `"a pen"`. Should be "the pen" at the end πŸ™‚

2020-07-03T13:40:49.256Z

also "str" below was never introduced

2020-07-03T13:43:00.256200Z

I would also mention why using keyword as a function is better in general code, because if the map is nil, using it as a function will throw null pointer exception.

2020-07-03T13:44:02.256400Z

Maybe with a comment that you can also always use get when uncertain what is the map given in a symbol.

2020-07-03T13:51:10.256600Z

I would consider adding some real world examples for JS people before going into Data Functions, for instance how about showing hiccup as an example?

2020-07-03T13:52:46.256800Z

I like that the focus of this is to introduce slowly Clojure while explaining step by step how evalutation works (compared to just throwing examples at the reader), but it might be too slow and the reader might start wondering "how the hell is all this useful for my daily job"

2020-07-03T13:54:34.257Z

I didn't finished reading till the end, but I would say this text would take at least 60 minutes to go thought when you haven't seen Clojure before

phronmophobic 2020-07-03T20:25:23.257600Z

@mikethompson, here are my thoughts on the re-frame docs. there's a link to a pull request in the issue, https://github.com/day8/re-frame/issues/626

2020-07-04T12:19:53.258100Z

@pavel.klavik Many thanks for that feedback. I have integrated many of those ideas. But I have retained fn before defn for various reasons, I think that ordering might be difficult, but it ultimately pays dividends.

2020-07-04T12:20:38.258300Z

@smith.adriane thanks also, will address your suggestions via the PR

phronmophobic 2020-07-03T00:51:55.250600Z

looks great! two suggestions which are really just one. I've found some the re-frame documentation hard to skim or find specific answers when the subheadings are similar with just numerical differences. Here's what I was thinking: β€’ change the title "Answer #1" to "Answer #1 - HTML autofocus" β€’ change the title "Answer #2" to "Answer #2 - Reagent after-render"

2020-07-03T00:52:34.250800Z

@smith.adriane Good idea, thanks.

phronmophobic 2020-07-03T00:54:03.251Z

It's really nice using a library with great docs πŸ™‚! I've been getting a lot of use from the docs recently. I wrote some notes that I can try and summarize to hopefully be useful.

2020-07-03T00:54:22.251200Z

Please do

2020-07-03T00:58:12.251400Z

A couple of decades ago, I wrote commercial courseware (for about 5 years, during a slacking-off phase of mine). But at that time I had the advantage of immediately road-testing my courses on new people, and noticing what worked and did not. It was constantly shocking the misunderstandings which were possible. But at least they were quickly corrected through near-instant feedback. It is so much harder when you write docs in Github. Almost Zero feedback. I'm quite sure there are problems with the presentation of ideas, but without the feedback I'm blind to them.

1πŸ’―
2020-07-03T03:00:32.252200Z

Re-frame docs are probably one of the best docs I have ever read. Especially the introduction is great, I was very quickly convinced to start using it.

2020-07-03T03:02:16.252400Z

What I am missing is coverage of some more advanced topics, with connections to Reagent. I will likely try to write something down in OrgPad (http://orgpad.com).

2020-07-03T03:21:48.252800Z

Because people so often come across from javascript ... I have been slowly building up a way for them to ramp up ...

2020-07-03T03:21:58.253Z

Top secret ... don't tell anyone :-)

2020-07-03T03:21:59.253200Z

http://day8.github.io/re-frame/clojurescript/

1πŸ‘
2020-07-03T03:22:07.253500Z

Still WIP, quality falls away at the very end

2020-07-03T03:23:01.253800Z

Next I have to do something likewise for Reagent as you suggest

ruben.hamers 2020-07-03T03:50:42.254200Z

alright, damn; finally fixed it. my formdata and request setup was correct, except for my headers.. I set

{:content-type "multipart/form-data"}
explicitly. So, for other readers, now my re-frame ajax handler looks like:
(rf/reg-event-fx
  :request-files-upload
  (fn-traced [{:keys [db event]} [_ a]]
             (let [params (second event)
                   url (str (:backend-url environment) "/files/upload")]
               (println params)
               {:http-xhrio {:method           :post
                             :uri              url
                             :timeout          8000
                             :response-format  (ajax/json-response-format {:keywords? true})
                             :body params
                             :on-success       [::good-files-upload-result]
                             :on-failure       [::bad-files-upload-result]}})))
Thx for the help @p-himik

1πŸ‘
2020-07-03T13:17:58.254800Z

started reading it, I like the way it slowly explains Clojurescript on examples

2020-07-03T13:18:20.255Z

Reading definitely takes much longer than 20 minutes, it took me about 20 minutes to get to Special forms

2020-07-03T13:18:48.255200Z

I would remove or postponed the section about quoting, not really needed there for anything.

2020-07-03T13:25:41.255400Z

Description of fn is quite hard to digest. I would maybe swap fn with def which is much easier to explain and then I would start fn with a few simple examples and I would follow with explaining the general fn on them.

2020-07-03T13:26:23.255600Z

The examples below with two starting parethesis might look strange to a beginner.

2020-07-03T13:39:18.255800Z

We need to make some changes:

(let [a  "the pen"
      b  "a sword"]   
  (if (> a b) a b)) 
evaluates toΒ `"a pen"`. Should be "the pen" at the end πŸ™‚

2020-07-03T13:40:49.256Z

also "str" below was never introduced

2020-07-03T13:43:00.256200Z

I would also mention why using keyword as a function is better in general code, because if the map is nil, using it as a function will throw null pointer exception.

2020-07-03T13:44:02.256400Z

Maybe with a comment that you can also always use get when uncertain what is the map given in a symbol.

2020-07-03T13:51:10.256600Z

I would consider adding some real world examples for JS people before going into Data Functions, for instance how about showing hiccup as an example?

2020-07-03T13:52:46.256800Z

I like that the focus of this is to introduce slowly Clojure while explaining step by step how evalutation works (compared to just throwing examples at the reader), but it might be too slow and the reader might start wondering "how the hell is all this useful for my daily job"

2020-07-03T13:54:34.257Z

I didn't finished reading till the end, but I would say this text would take at least 60 minutes to go thought when you haven't seen Clojure before

phronmophobic 2020-07-03T20:25:23.257600Z

@mikethompson, here are my thoughts on the re-frame docs. there's a link to a pull request in the issue, https://github.com/day8/re-frame/issues/626