Fork me on GitHub
Michael W02:11:56

I haven't updated deps.edn in a while, I just put everything to the newest versions and am seeing this error now:

The required JS dependency "@js-joda/timezone/dist/js-joda-timezone-10-year-range.min.js" is not available, it was required by "com/fulcrologic/rad/type_support/ten_year_timezone.cljs"
Any idea how to resolve it?


Add that to your package.json




I made timezone not required if you don’t use it…but if you do, you need to add it to deps. I am trying to reduce what is always required


(build size)


Thew new fulcro-rad form debugger makes life so much easier! I used to (tap>) the form env into reveal or portal and inspect it there, but having it all on one page is a way better workflow


🤯 Sounds amazing — any chance you can post a screenshot? That’s something I’d love to use! (I used to do the same: tap> and try to wade thru very large maps in Portal. 🙂


Sure thing! I made a gif first, but I needed to redact some data, so here are some screenshots instead:


It shows the form-state of all forms recursively. You get an overview of your RAD attributes, and on the bottom you see the actual computed diff. Also note the Notes column. It shows you those messages if something is wrong:


Just explore the com.fulcrologic.rad.debuggingns a bit, to see what's going on. I'm rendering lot's of customized stuff, so I made my own little wrapper that works well in-place with my forms:

(defn form-debugger [form-instance props]
    (let [validator (comp/component-options form-instance fo/validator)]
      (r.debug/ui-form-info props {:form-instance form-instance
                                   :validator     validator}))))
I just attach it to the bottom of the form I want to debug, but theoretically you could also put it in another tab or something


How can I set an initial selected-row in a RAD report? Do I have to alter the ro/machine based on the :initial state in

Jakub Holý (HolyJak)15:11:18

That's often the right answer :-) Not sure whether there is a simpler way


It seems like something that might also be possible through route params too but I'm not yet able to get it to work.


Yes, you should be able to use r Params. Look at the current machine. It won't trigger an event though.


Here’s a hint on figuring it out without reading code: The _rp_ query parameter is a map of the route-params for a given route, transit encoded + base64. There is a function in com.fulcrologic.rad.routing.html5-history/query-params (which is CLJC, by the way, so can be used from CLJ REPL and CLJS REPL) that can decode a copy/paste of the params from the URL. So, go to the report, do anything that will end up in this map (such as select a row, go to page 3, etc. and then decode the params.


Ah, but I'm interested in initially loading the page with a row selected. There are no query params in the URL at that point.


you pass that decoded map to route-to!


that will encode them into the URL


every action you do in RAD with html5-history installed puts the “state” of the UI into those params


(if that state is tracked)


and selected row is tracked, as is current page


I'm presuming I can enter the decoded param map as the last param to change-route! here?


But I think that line needs to be swapped with the very next line which installs html5-history.


you should use RAD’s routing wrapper fn


Thanks, yes, that worked. That decode function will probably come in handy again. I was reading through the code and tapping bits here and there but hadn't yet arrived at a solution.

Eric Dvorsak18:10:12

to load a route from the url I use

(history/install-route-history! app (html5-history/html5-history true))
  (html5-history/restore-route! app ui/CourseList {})
where you could have additional params in the empty map


Hello all! I'm working on a RAD report. The main entity is a "group". It has attributes :group/leader and :group/members that are each refs to :person/id. The leader is a to-one and the members is to-many, as one might expect. I'd like to put the name of the leader into the report. So I need to get an attribute from a related entity. (But with the wrinkle that the attribute name itself doesn't uniquely describe the path to access it.) If I just add person/name to the ro/columns it is blank. I've tried a couple of forms of ro/row-query-inclusion but without much success. I have two questions related to this; first, how do I do this particular join for the report? Second, how do I debug the connections from report -> attributes -> Pathom -> Datomic in the future?

Jakub Holý (HolyJak)22:11:19

Great to see you here! I'm off computer now but could something here help?

Jakub Holý (HolyJak)22:11:41

(I loved Release It, great book and learned a great deal from it, thanks a lot!)

💯 1

Hi Jakub, thanks those notes look perfect. Also I'm glad you enjoyed Release It! I'm always happy to hear that people find it useful.

❤️ 1

Reviving a dead thread after US Thanksgiving holiday... I'm still stuck on This is my top-level entity's attribute:

;; In slide.cljc
(defattr root :slide/root :ref
  {ao/identities #{:slide/id}
   ao/required?  false
   ao/schema     :production
   ao/target     :person/id})
Then I have this for the Person entity:
;; In person.cljc
(defattr id :person/id :uuid
  {ao/identity? true
   ao/schema    :production})

(defattr name :person/name :string
  {ao/identities #{:person/id}
   ao/required?  true
   ao/schema     :production})
In my report, I have this:
;; In slide_forms.cljc
(report/defsc-report SlideList [this props]
  {ro/title               "All Slides"
   suo/rendering-options  {suo/report-table-class "ui very compact celled selectable table"}
   ro/form-links          {slide/title SlideForm slide/root PersonForm}
   ro/columns             [slide/title person/name]
   ro/row-pk              slide/id
   ro/row-visible?        (constantly true)
   ro/source-attribute    :slide/all-slides
   ro/run-on-mount?       true
   ,,,  ;; controls, control layout elided
   ro/route               "slides"})


The column for person/name appears blank. On the server side, I see this in the log:

Running [{:slide/root [:person/id]} :slide/title] on entities with  :slide/id : [[:slide/id #uuid "c68dce64-1889-4728-9586-fd9bfc29318e"]]
So the client side isn't even asking for person/name . If I look at the Network tab in Fulcro Inspect, I see this query being sent:
[({:slide/all-slides [:slide/id :person/id :slide/title :person/name]})
Which is a bit weird since the join from Slide to Person is via slide/root which is not part of the query. The response, predictably, does not include person/id or person/name since those aren't available on the Slide entity:
 [{:slide/id #uuid "c68dce64-1889-4728-9586-fd9bfc29318e",
   :slide/title "Blank A"}]}


Sorry for the wall of text. I'm trying to provide all the details for asynch communication. 🙂 At the moment I can't tell if the problem is in my attribute definitions, my report, or my resolvers.


Looks like it was the resolvers. Following the example from fulcro-rad-demo with invoice.cljc, I added a resolver:

;; In slide.cljc
   (pc/defresolver root-id [env {:slide/keys [id]}]
     {::pc/input #{:slide/id}
      ::pc/output [:person/id]}
     {:person/id (queries/get-slide-root-id env id)}))
Once I added that to my parser, the report column works great.

Jakub Holý (HolyJak)15:11:12

Sorry for late reply, I have been swamped with work and stuff. Great to hear you got it working!

Jakub Holý (HolyJak)09:11:25

I have a slightly different approach in though I haven't yet sorted out error handling and indexes

👍 2

Thanks for making me aware of this – I will take a look!