Fork me on GitHub

RAD progress: I’ve got the SQL adapter mostly working. I have not tested all data types (and those implemented are limited), and save only partially works (saving to-many refs are not yet implemented).


The demo will run with it, and most features work (except saving added to-many rows)


I plan to finish the ref-many save, and possibly expand it a bit as I add features to the demo. The nature of RAD itself as a rapid-dev/prototyping system doesn’t need much more since it is easy to add save middleware and additional resolvers to customize it to any advanced schema or database-isms.

👍 20
🎉 4

I did some adjustments to the rad datomic adapter code and so far it's working with datahike. I'm following fulcro-rad-demo but have an issue with a simple model form, the model just has a id uuid and a name string. When saving the form, the transaction succeeds, tempids -> uuid in :tempids. the id and name field are in the datahike db, but after the :event/saved the name disappears, it's not in the view nor db. Don't see anything in the console output that could explain it.

🎉 4

seems the form does work when I comment out wrap-datomic-save just returns the tempids map, not the entity, I'm guessing that's what the handler argument is for?


@bbss Fun! OK, so the returning has to do with re-loading the form’s content after the save…it adds a complete query to re-populate the form from the db, and that relies on your resolvers all working right for reads.


BUT, you have to be careful about tempids, so the returned ID must be remapped so that the resolvers will see the right thing


Fixing fulcro-rad-datomic to support the client API would be nice, too 😉 There aren’t too many things that would have to be done. Ident resolution is using the entity API, and pull-many I don’t think exists on client…but most everything else would work I think…and that would give us cloud support.


Alright, what I did for datahike: • replace datomic.api require with datahike.api • remove datomic.function require • remove datomock and replace fork-conn and mock-conn with (d/connect real-connection), I didn't run this code so I'm sure it's prob not what we want. • replaced transaction functions with: {:db/ident :com.fulcrologic.rad.fn/set-to-many-enumeration :db/fn set-to-many-enumeration-fn} {:db/ident :com.fulcrologic.rad.fn/add-ident :db/fn add-ident} • those were plain functions with :code as body , :params as arg-vec and datomic.api/pull is replaced by d/pull what I did for datomic cloud was a while back so a bit hazy and slightly different adapter codebase: • replace datomic.api require with [datomic.client.api :as d] • in replace-ref-types replace (comp :db/ident (partial d/entity db) :db/id) with (comp :db/ident (partial d/pull db '[*] ) :db/id) - replace pull-* (`d/pull-many db pattern eid-or-eids)` with (into [] (map (fn [eid] (d/pull db pattern eid)) eid-or-eids)) • there was no need to install the transaction functions, define in ns and call quoted in transaction form, db is passed as first arg e.g.: (ref->ident after) (if (nil? after) [[:db/retract (str id) k (ref->ident before)]] [['(my-namespace/add-ident (str id) k (ref->ident after))]])


Not sure how to split it up properly. Probably different keys on the attributes. But not sure if looking up attribute type every time when we need to find out which is a good idea.


@tony.kay I wonder if the pathom-datomic plugin would be useful It sort of abstracts over these differences already.


Or even something like igraph which was introduced recently I’ve been pondering its relationship with pathom. All these “graph-like things” might benefit from a common interface.


The resolvers are a trivial amount of code in the adapter. The save conversion is most of the code is at. That said, a simple library that is meant to deal with the issue of making pull pull the db/ident when you have a scalar that is represented as such is pretty simple, and not worth an extra library. Pull-many is equally simple to build without the need. But I’ll glance at them 🙂


Wilker’s lib might be nice. I don’t have time to try it and see where it might fall down, but it might be quite simple to add in and try if someone wants to. Just go to the demo and add it into the parser plugins, and remove the auto-generated datomic resolvers that RAD has.


Cool, I might give it a try. First tho I’d like to read into the RAD source a bit. It’s on my todo list 🙂

Thomas Moerman14:03:22

Hi, I'm having a bit of a weird problem: when passing mutation params with (m/with-params some-map), to a graphQL endpoint (using Pathom, Fulcro 2.8), nested child fields are not formatted as json but as {"string": "string", ...} , there's probably something obvious I'm missing here? Any suggestions?


how is that not JSON?

Thomas Moerman15:03:09

oops, i mean graphQL notation


might ask in #pathom , I’m not involved with the GQL stuff

Thomas Moerman15:03:16

okay sure, thanks for looking into it

Thomas Moerman17:03:41

Found it! Just dropping it here for future reference: it was not yet supported by the Pathom version I was using: fixed here:

Thomas Moerman17:03:17

upgrading to 2.3.0-alpha5 solves it

Jakub Holý (HolyJak)16:03:06

@tony.kay Hi! I am goint to make a PoC of an app with a number of linked "reports" (mostly master-detail) and want to take fulcro-rad for a ride. I'd be happy to contribute with feedback, design ideas (since reports are not so much designed yet, I believe), hopefully code. I have put some initial thoughts here:


@holyjak Thanks! So, I’m working on reports a bit as we speak. Making them much more compact, and adding both an outer layout and inner layout renderer (by default). My intention is for reports to support easy tabular data out of the box, but to support much more complex layouts/operation in the long run. For example, I consider a kanban board to be a report with filtering and item actions.

❤️ 12

• Report: Display of data where mutations are the actions that can drive change (table and row actions), layouts drive rendering, and queries with filters derive the data. • Form: State management of all data displayed. Each level of a form must have a single ID. Saves go through server-side middleware and are sent as minimal diff. So an app like Clubhouse would be a complex report (the story board), and clicking on a card would be a row action that would route to an edit Form for a story. So, let me get through today’s refactoring of reports, and I’d love to see what you think from there.

Jakub Holý (HolyJak)17:03:43

Awesome! I will look at it. I plan to start coding on Friday.


Is there a resource for Fulcro jobs (companies that use Fulcro, etc..)?


not that I’m aware of


I would be interested to see if there are any companies hiring who use Fulcro. I recently was laid off due to the pandemic and my day to day involved a large scale Fulcro application.

😿 36

sorry to hear that, the same exact thing happened to me.


sorry to hear that


RAD update: So, the RAD demo (on master branch) is a working release that works for SQL or Datomic (according to instructions in README). Both use free in-memory dbs (h2 and datomic-free) so they’ll spin up without any external installations.


I pushed the first alpha release of the SQL adapter


AND I spent the last 9 hrs rewriting reports, so they require less boilerplate (docs not yet updated)


I added an invoice list report so as you add invoices you can go back and edit them.


And of course it’s the exact same front-end for both back-ends. Futhermore once we get some alternate render plugins, it’ll be the same front-end for web/native.

🤯 8

There is also a bump on Fulcro to 3.1.22 which adds a bit to multiple-root support (props passed from parent are passed through to new root as computed)

Peter Wilkins20:03:18

does anyone have any nifty intellij live templates for fulcro they care to share? I've seen a good one for defsc in the videos.


yeah, I can share that


settings file for IntelliJ with just live templates.

👍 8

how do you install these?


File -> Import Settings

👍 4

if you have sync turned on that may not show up…not sure what you do then


read the XML in the zip file? 🙂