Fork me on GitHub
#fulcro
<
2023-03-03
>
Eric Dvorsak11:03:32

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?

Jakub Holý (HolyJak)15:03:27

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)

tony.kay16:03:35

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.

janezj17:03:07

(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)}))

genekim17:03:47

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&amp;list=PL4aJznIeHN6yUzULne9RWc6KJhUnOVm-h&amp;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

❤️ 2
😻 2
🆒 2
tony.kay18:03:15

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.

tony.kay18:03:28

I’ll check out the video

tony.kay18:03:18

my network is crap right now, so I can’t see the video till I get home

genekim18:03:05

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.

genekim18:03:40

Next step: change rendering.semantic-ui.report to make it emit membrane.

genekim18:03:34

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. 🙂

genekim18:03:45

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