This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-24
Channels
- # announcements (4)
- # asami (5)
- # babashka (20)
- # beginners (94)
- # bristol-clojurians (1)
- # calva (23)
- # cider (2)
- # clj-commons (3)
- # clj-kondo (43)
- # cljfx (2)
- # cljs-dev (13)
- # clojure (112)
- # clojure-dev (44)
- # clojure-europe (17)
- # clojure-nl (5)
- # clojure-poland (12)
- # clojure-spec (2)
- # clojure-uk (3)
- # clojurebridge (1)
- # clojurescript (92)
- # cursive (17)
- # data-science (8)
- # datahike (1)
- # datalevin (1)
- # datomic (3)
- # deps-new (7)
- # events (2)
- # fulcro (40)
- # graalvm (110)
- # holy-lambda (16)
- # introduce-yourself (1)
- # lsp (13)
- # malli (8)
- # missionary (12)
- # off-topic (10)
- # pathom (13)
- # polylith (10)
- # portal (28)
- # re-frame (37)
- # reitit (1)
- # releases (1)
- # shadow-cljs (30)
- # spacemacs (1)
- # tools-deps (9)
- # xtdb (10)
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?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
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.debugging
ns 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]
(error-boundary
(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 somethingHow 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 https://github.com/fulcrologic/fulcro-rad/blob/952278690222ed38d09eb15b28f13f09726d04ce/src/main/com/fulcrologic/rad/report.cljc#L342?
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.
every action you do in RAD with html5-history installed puts the “state” of the UI into those params
I'm presuming I can enter the decoded param map as the last param to change-route!
here?
https://github.com/fulcrologic/fulcro-rad-demo/blob/develop/src/shared/com/example/client.cljs#L58
But I think that line needs to be swapped with the very next line which installs html5-history.
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.
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 mapHello 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?
Great to see you here! I'm off computer now but could something here https://gist.github.com/holyjak/207ed33c9ee7e003b9a779fa47c32d91 help?
(I loved Release It, great book and learned a great deal from it, thanks a lot!)
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.
Reviving a dead thread after US Thanksgiving holiday... I'm still stuck on https://gist.github.com/holyjak/207ed33c9ee7e003b9a779fa47c32d91#displaying-to-one-ref-attributes. 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]})
:com.wsscode.pathom.core/errors]
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/all-slides
[{: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
#?(:clj
(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.Sorry for late reply, I have been swamped with work and stuff. Great to hear you got it working!
Here's a simple https://gist.github.com/zeitstein/683eabe72435b9cbbecc8f3d3a1cc01d. pathom-remote
provided by @wilkerlucio.
I have a slightly different approach in https://github.com/holyjak/minimalist-fulcro-template-backendless/tree/pathom3 though I haven't yet sorted out error handling and indexes
I have a slightly different approach in https://github.com/holyjak/minimalist-fulcro-template-backendless/tree/pathom3 though I haven't yet sorted out error handling and indexes