This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-04
Channels
- # announcements (1)
- # babashka (41)
- # beginners (124)
- # cider (8)
- # clj-kondo (25)
- # cljs-dev (40)
- # clojars (4)
- # clojure (92)
- # clojure-europe (35)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-uk (91)
- # clojuredesign-podcast (8)
- # clojurescript (41)
- # code-reviews (1)
- # cursive (11)
- # data-science (1)
- # datascript (76)
- # datomic (45)
- # emacs (4)
- # etaoin (3)
- # events (1)
- # figwheel-main (2)
- # fulcro (9)
- # graalvm (1)
- # jackdaw (6)
- # jobs (1)
- # jobs-discuss (3)
- # kaocha (4)
- # malli (25)
- # off-topic (42)
- # pathom (4)
- # reitit (11)
- # releases (2)
- # reveal (1)
- # shadow-cljs (53)
- # sql (4)
- # tools-deps (190)
- # vrac (19)
- # xtdb (6)
The design is that you roll up data in resolver on server, and invent a virtual attribute for that, but you can hand render if you want
Hm the one thing here is that if invent an attribute :project/tags
,which is aggregated tags, to put in the report, if someone edits a tag the virtual attribute won’t be refreshed automatically.
just a syntax nitpick/proposal: uism definitions seem unnecessarily noisy to me; would it make sense to be more concise/regular by inferring the top-level ::uism/events key, so it's just a map of events with a default override event to replace the current ::uism/handler functionality? e.g.
;; current syntax {::uism/events {:event/foo {::uism/handler foo}}} {::uism/handler foo} ;; more consise/regular syntax? {:event/foo {::uism/handler foo}} {::uism/all-events {::uism/handler foo}}
I noticed that having a {:query [(uism/asm-ident ::session/sm)]}
will still not re-render when the uism changes state. I'm setting :shouldComponentUpdate (fn [] true)
on the component anyways and that works, but from what I see, the book says that just adding the uism query should work
full component:
(defsc Navigation [this props] {:query [(uism/asm-ident ::session/sm)]} (let [state (uism/get-active-state this ::session/sm) authed? (= state :state/logged-in)] (if authed? (comp/fragment {} (dom/a {:href "/user"} "User") (dom/a {:href "/settings"} "settings")) (ui-login))))
I have found a possible issue. When calling install-ui-controls!
in RAD code it will store the UI plugins in app runtime-atom
under the key :com.fulcrologic.rad/controls
, it’s a map of stuff like com.fulcrologic.rad.report/style->layout
.
But in com.fulcrologic.rad.report
the code will try to find installed formatters as such `
(some-> runtime-atom deref ::type->style->formatter)
Note that it doesn’t try to find them under the :com.fulcrologic.rad/controls
key… so adding these formatters into the map that gets installed by install-ui-controls!
doesn’t have any effect. You need to manually swap the atom to insert them at base of runtime-atom map.I havenæt time to explore but aren't you mixing up controls and the formatting of report columns?
So my client.cljs
code has to look like this:
(rad-app/install-ui-controls! app sui/all-controls)
(let [{::app/keys [runtime-atom]} app]
(swap! runtime-atom assoc ::report/type->style->formatter
report-formatters))
then it works… I assume this is not intended