Fork me on GitHub

Does anyone know of any fulcro rad templates that are in the public domain? I'd love to start a new closed-source work project from a template if possible.


The fulcro-rad-demo is basically that


I thought the MIT License meant that anyone would be able to share the code - i.e. other developer employees could legally share the codebase with competitors if they wanted. I could be way off here, all of these licenses confuse me.


Yup, MIT is “do what you want with it, just reference me and don’t blame me for anything”. It is not a share-alike like the EPL

genekim21:10:30 Here's an RSS reader I built on top of the Fulcro RAD demo. There's a link to it running in Google Cloud Run, too.

Timofey Sitnikov11:10:22

I am using Fulcro Template to learn Fulcro. I am attempting to change email on the client side in the ok-action of defmutation. The data I am attempting to change is buried, see attached image, it is at #3. Are there helpers to easily access and update the :session/account/email value?


um...`update-in` and assoc-in? It's never more than 3-deep. 😄


perhaps I'm mis-understanding your question/confusion. It's a normalized db...perhaps you're thinking you have to follow the path in the db for some reason?


oh, I've not properly normalized your database.


Several things: 1. You should be using fulcro-inspect to view the current state. 2. Your code is clearly wrong from this screen shot. Not sure what you're doing, but you're clearly not following the basic directions for query/ident/initial state.

Timofey Sitnikov17:10:52

Thank you @U0CKQ19AQ, my previous example is modification of Fulcro Template, so below is the vanilla Fulcro Template client db: I am trying to update the [:component/id :session :account/name] variable. So, I should be able to do something like: (get-in @state [:component/id :session :account/name]) , or am I confusing everything?


That looks better. Yes, you can change it in the mutation with (swap! state assoc-in [:component/id :session :account/name] "new name")


If you were doing (2) correctly then you would not need a helper. It's (half of) the entire point of Fulcro 🙂


Fulcro RAD 1.0.30 released. This version reverts the changes in 1.0.29. The js-joda upgrade breaks things in downstream usage. I know how to fix it and shrink the overall deployment size, but it's not work I have time for right now. I'll add it to a "good for beginning contributors" issue on github. NOTE: 1.0.30 also includes a hot code reload improvement for faster dev in large projects. Re-evaluating a defattr will now cause it to refresh, even if you closed over the value of it somewhere. This is roughly equivalent to using mutable data for attributes, but in the case of a defattr (which never reloads at runtime) it is only a dev-time convenience, and is not meant to be a production-time feature. To that end I will probably add some kind of flag for disabling it altogether in production builds.


I'm trying like hell to get rid of tick in my app. It does not work well for me, and is part of the reason I'm in this locale-hell....I actually just hand-coded the solution to that issue, and it is MUCH better.


tick uses, which is just a thin wrapper over js-joda...and js-joda is excellent except for the locale and formatting stuff...code bloat and package.json hell.


I prefer using directly. Matches the Java API, which means very easy to find answers on Stack Overflow, well-defined API, etc. etc. Tick is trying to be too clever IMO. You never know what the heck you have, and that leads to a lot of bugs.


Thanks for the background. I just wanted to put it on your radar in case it offered a bit of a shortcut. I haven't used it myself, but I'll trust your advice and stick to java-time instead of reaching for wrappers.


I want to like it, and I'm sure it works for some people just fine. But I've seen it used and yanked from two major projects at this point.


So fulcro backend returns js/Date values via transit (or rather transit decodes it to js Date)…. and we have… is there some way to convert values automatically to values? I have tried to find function that converts js/Date to Instant and haven’t found any


So, I highly recommend that you keep your data types identical between front/back end. Transit, as you saw, uses standard js dates and jvm dates. I always leave those in that form. It's also why I added Big.js and the math ns so I could get equivalent support for bigdecimal on the front-end.


The functions in date-time are meant to help you do common tasks with js Dates related to front-end work. I would not put js Instant in your state, because then you're going to have to add a transit handler for it. You can, of course, do that, but then ALL of your database queries etc are going to have to translate things around. If you want to hack transit and change the encoding of date on the back end to Instant on the front you can do it (I think...don't know about overrides), but I think you're just going to end up confusing yourself.


Keep the data model simple and isomorphic front-to-back...If you ahve to do some temporary thing (display a date in a locale/time zone aware fashion) then use UI adapters for that...don't munge the data on the wire.


I notice that RAD demo repo doesn't have issues enabled. Is that intentional? I wanted to create an issue noting that Crux needs to be upgraded to xtdb there since they rebranded and it might be confusing for new users. There's a bit of refactoring required beyond just find/replace, but not too much.

Piotr Roterski19:10:07

hey, I made that crux integration and I'll push the upgrade shortly 🙂 sorry and thanks for the reminder


@UHA0AQZ2M No sir, thank you! Your integration was very helpful. I followed your initial PR in setting up Crux in my own Fulcro project.

😊 1

I'm not maintaining the alternate db support for the demo. If you see a problem and want to fix it, test it heavily, and send a PR that's fine. Too much to do.

👍 1

Thanks. I'm guessing it'll take me a few weeks of tinkering to get more comfortable with RAD. I liked what I read in the intro.

Tyler Nisonoff19:10:02

is it generally considered bad practice to call m/set-value! inside a mutation definition? (Should one strive to directly modify the state-map if possible, or does the transaction system somehow know when its called inside a mutation and do the right thing?)


The docstring suggests you should only use it for UI-related data. That doesn't directly answer your question, but perhaps it helps. In the few places I'm using that function, I usually just combine it with transact! calls by wrapping both in an and or something.


so, here's the deal: the set-value! isn't going to even work from inside a mutation unless you set :ref, and it triggers an additional transaction it is kinda silly.


it's ok to trigger a new tx from a mutation...that's fine, though messy and harder to trace (since that makes it an async execution path. You're MUCH better off writing a mutation helper instead, and using that. See


NOTE: ref in env is the ident of the component that invoked the transaction in which the mutation is running, which is how set-value! figures things can, of course, do the same.


and the other fun helpers in that ns.

Tyler Nisonoff22:10:59

great thank you!


What’s the best way to add “computed” columns to RAD report? Something that would get its own column, but it is derived completely from other queried data. (and I’d prefer not to have in DB)


Make a resolver for it, and add it to ro/row-query-inclusion or specify ro/BodyItem and write the row query yourself along with rendering of it.


depends on if you want server computing it or UI (based on what's already there).