This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-03
Channels
- # announcements (15)
- # babashka (143)
- # babashka-sci-dev (2)
- # beginners (35)
- # biff (11)
- # calva (5)
- # cider (8)
- # clerk (4)
- # clj-kondo (58)
- # cljdoc (6)
- # clojure (88)
- # clojure-denmark (1)
- # clojure-europe (77)
- # clojure-nl (1)
- # clojure-norway (16)
- # clojure-uk (1)
- # clojurescript (19)
- # clr (32)
- # code-reviews (158)
- # datahike (5)
- # datomic (10)
- # deps-new (3)
- # fulcro (12)
- # graalvm (20)
- # honeysql (23)
- # hyperfiddle (32)
- # kaocha (17)
- # membrane (6)
- # observability (1)
- # other-languages (2)
- # pathom (5)
- # practicalli (12)
- # reagent (4)
- # reitit (7)
- # releases (1)
- # sci (25)
- # shadow-cljs (52)
In the i18n lib, the translations are loaded with the ident ::translation and the locale as params https://github.com/fulcrologic/fulcro-i18n/blob/main/src/main/com/fulcrologic/fulcro_i18n/i18n.cljc#L78 It doesn't match with the documentation which suggests a resolver that takes locale as input https://github.com/fulcrologic/fulcro-i18n/blob/main/I18N.adoc#ServingLocales should the function be fixed or the doc?
Are you sure? Given that this is Pathom 2, it looks to me like a global resolver and the second arg is then the params (provided you have https://github.com/fulcrologic/fulcro-rad/blob/main/src/main/com/fulcrologic/rad/pathom.clj#L110, though npt 100% it applies here now)
Actually, yes, the docs are out of date there, but @U0522TWDA comment is pretty close: That plugin will put the query params into env
, so you could destructure them there.
(pc/defresolver translations-resolver [env _]
{::pc/output [{::i18n/translations [::i18n/locale ::i18n/translations]}]}
(let [{:keys [locale]} (get-in env [:ast :params])]
(log/debug "translations --- i18n!!!" locale)
{::i18n/translations (i18n/load-locale "po-files" locale)}))
Hey, @tony.kay — here’s a 9m video that describes the motivation and demo of the membrane rendering plugin for Fulcro RAD. Many of us were blown away by @smith.adriane demo of the TODO Fulcro app running in lanterna terminal and skia — This demo shows a RAD report running on membrane, being rendered with skia — thanks to your help figuring out how to do this, and to @smith.adriane for his help getting this over the line yesterday. It’s definitely still a little janky, but I’m so delighted that I was able to get it running! It’s wild to see so much functionality of a RAD report running — it loads all the data from backend, it can switch between pages, and astonishingly, hot code reloads work just by reloading the namespace. (Which makes it super fun to work on — as opposed to getting the networking code working, which was comparatively much less fun. 🙂 Would love any thoughts and advice! Next steps: • make RAD report able to render in membrane without custom body • keep porting more of the semantic UI report stuff over (e.g., pagination controls, title, etc.) I feel that would make this super usable, at least for me — it’s a fast way to build and use UIs, maybe even native image compiles to get totally self-contained apps. (In reality, Fulcro RAD and shadow-cljs already make it so easy to build the browser front end [thanks to you, too, @thheller!]. But I think this would lower even further the effort required to get basic reports running. More like what was possible with Microsoft Visual Basic and Access). PS: membrane is wildly fun to use, despite it being quite spartan — and here’s another way to enable it to do more stuff! Video: https://www.youtube.com/watch?v=PId7M9804OM&list=PL4aJznIeHN6yUzULne9RWc6KJhUnOVm-h&index=3 Demo code on GitHub (on it’s own branch): https://github.com/realgenekim/rss-reader-fulcro-demo/blob/aaf9adec8e3183bc51af4e63709e2938c46617d0/src/shared/com/example/membrane_ui/ui.clj#L382
You’d have to walk me through it Gene. I see the basics, but looks like you maybe had to hack tx processing? Not sure what you changed there.
For sure, Tony — anytime you want, I can walk you thru it. I recommend watching video at 1.75x speed. Only file I had to change was http_remote.cljc. I put in a bunch of logging into tx_processing.cljc, just to learn how that machinery worked. I can almost assuredly delete that file, and everything would still work just fine.
You’ll hear me laughing as I make changes to the report and components, watching it live reload in membrane window. I STILL think it’s so cool and fun. 🙂
Here’s the raw 470MB file on Dropbox, if that makes it any easier to watch while you’re out and about. 🙂 https://www.dropbox.com/s/6b5946bn2rhpmiw/Membrane%20Fulco%20RAD%20demo%202023%2003%2003%20--%209m.mp4?dl=0