fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
Michael Rispoli 2021-04-06T01:16:10.370300Z

Ah awesome thank you for this I was wondering if Datomic was the right pairing I’ll give this a look!

tvaughan 2021-04-06T11:21:30.370900Z

FYI https://clojurians-log.clojureverse.org/fulcro/2021-02-11

2021-04-06T11:33:42.371100Z

I can highly recommend Crux (https://opencrux.com) for use with fulcro - it would fit for similar use cases as Datomic, but is open source and the team is amazingly nice and responsive if you have any feedback or questions

cjsauer 2021-04-06T12:18:47.373500Z

Oh nice! I tried searching for prior art and didn’t find this. However the link to the gist is broken for me. It also appears that a PR was never created. @adam678 were you still working on this?

tvaughan 2021-04-06T12:24:57.373700Z

Here's the version I have:

$ cat .clj-kondo/hooks/fulcro.clj
(ns hooks.fulcro
  ""
  {:author "Adam Helins"}
  (:require
    [clj-kondo.hooks-api :as hook]))

(defn defmutation
  [{:keys [node]}]
  (let [[_call
         sym
         & arg+]    (:children node)
        docstring   (first arg+)
        [[param+
          & fn-like+]
         docstring-2] (if (hook/string-node? docstring)
                        [(rest arg+)
                         docstring]
                        [arg+
                         nil])]
    {:node (hook/list-node (concat [(hook/token-node 'defn)
                                    sym]
                                   (when docstring-2
                                     [docstring-2])
                                   [param+
                                    (hook/vector-node (map #(let [[_sym
                                                                   arg+
                                                                   & body] (:children %)]
                                                              (hook/list-node (list* (hook/token-node 'fn)
                                                                                     arg+
                                                                                     body)))
                                                           fn-like+))]))}))

cjsauer 2021-04-06T12:40:17.376800Z

Thanks. This is a simpler approach I think. I was under the incorrect assumption that mutation handlers could refer to each other, but that’s not the case (the :dispatch key in env holds those lambdas). On the flip side, I could see kondo implementing “unused lambda” lints one day, which would throw false positives with the above.

Helins 2021-04-06T12:47:59.377Z

@cjsauer Hi, here is my original gist: https://gist.github.com/helins/52d03847157b0dc95c6987844a74dd68 The PR slept out of my mind (had to work fast at that time) and I see you have already proposed something. Let me know it goes through, if not we can use that gist 🙂

cjsauer 2021-04-06T13:06:01.377700Z

Thanks, will do :)

Thomas Moerman 2021-04-06T16:29:05.379100Z

Fulcro mentioned in the State of Clojure 2021! https://clojure.org/news/2021/04/06/state-of-clojure-2021 🎉

4👍7❤️16🎉
thosmos 2021-04-06T17:04:02.382Z

I’ve only used Fulcro with Datomic, so I’m biased. Fulcro’s query syntax was inspired by Datomic’s pull syntax and was originally designed to work directly with it. Pathom made it much easier to integrate with other DBs, but the pairing is still optimal.

Tyler Nisonoff 2021-04-06T19:14:33.383500Z

@holyjak have you used pathom placeholders with subforms? It seems that add-form-config isn’t finding subforms if my subform is split into placeholders…and struggling to figure out how to get around it

Jakub Holý 2021-04-06T19:26:54.383700Z

No I haven't :( Please let me know if you figure it out!

Jakub Holý 2021-04-06T19:27:53.383900Z

Perhaps subforms require that the thing being edited is an entity of its own and not a part of a bigger entity?

Tyler Nisonoff 2021-04-06T19:50:44.384200Z

i think i’ll have to make a duplicate edge from A to B that doesn’t use pathom placeholders, seems the form state code assumes that any join is going to be flat, it doesn’t know how to walk the placeholder map

Michael Rispoli 2021-04-06T23:57:21.390700Z

Thank you both, Crux looks pretty awesome in general I’ve never heard of it. I’m also wondering does anyone have a good full stack example of fulcro with a backend or template they use. I read the docs but definitely still feel really daunted getting started and would love to poke around with a good starting off point. I’m also new to clojure generally so if fulcro is maybe a tough starting point let me know as well. It just seems like the best option for building a production app though as well.