This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-16
Channels
- # announcements (7)
- # aws (9)
- # babashka (31)
- # beginners (28)
- # calva (14)
- # clj-kondo (29)
- # cljs-dev (23)
- # cljsrn (16)
- # clojure (21)
- # clojure-france (1)
- # clojure-nl (2)
- # clojure-spec (20)
- # clojure-sweden (4)
- # clojure-uk (6)
- # clojurescript (62)
- # community-development (5)
- # conjure (81)
- # cursive (14)
- # datomic (5)
- # defnpodcast (2)
- # docker (1)
- # figwheel-main (11)
- # fulcro (17)
- # graalvm (5)
- # jobs-discuss (5)
- # kaocha (1)
- # off-topic (54)
- # pathom (1)
- # pedestal (1)
- # quil (1)
- # re-frame (34)
- # shadow-cljs (34)
- # tools-deps (39)
- # uncomplicate (2)
@tony.kay I am using pathom/new-parser to create a parser, does it add the env plugin by default or do I need to add it explicitly ?
(pathom/new-parser config
[(attr/pathom-plugin all-attributes)
(form/pathom-plugin save/middleware delete/middleware)
(datomic/pathom-plugin (fn [env] {:production (:main datomic-connections)}))
(blob/pathom-plugin bs/temporary-blob-store {:files bs/file-blob-store
:avatar-images bs/image-blob-store})]
[automatic-resolvers
form/resolvers
index-explorer
(blob/resolvers all-attributes)
...])
I assume you are referring to com.wsscode.pathom.core/env-plugin or com.wsscode.pathom.core/env-wrap-plugin, however to use both of these I will have to provide static values. I need something where I can access the :pathom/context in each invocation of the parser.
If you’re looking to see something throughout the call of all resolvers, then adding to env is the approach. If it is something that came from the client but was targeted at a single resolver (i.e. parameters on a query prop) then copying it over to the env map at the plugin layer will ensure you see it everywhere.
can you point me to an example on how to copy it at the plugin layer. Bcoz as I understand I dont have access to the params at the plugin layer.
The pathom context is in the existing env, likely under the :ast key. Just print it out and explore
See https://github.com/fulcrologic/fulcro-rad/blob/develop/src/main/com/fulcrologic/rad/pathom.clj#L108
@U0522TWDA tahnks
I saw this on twitter, and it is a worthwhile read: https://macwright.org/2020/05/10/spa-fatigue.html I think this is a great reminder that not every problem is a nail to be hit with your hammer. 🙂
I’ve been seeing things like this being mentioned as “another” way, https://unpoly.com/
I’ve read this a couple of days ago, and while he does have a point, I think he’s missing a crucial benefit of react-like models: ease of reasoning.
To be honest I'm not certain that there isn't a way to maintain ease of reasoning while still using the above the approach? But there's a definite benefit in that we already know how to do that with the react-like models.
Oh, I’m not implying that I think SPA’s are fundamentally flawed somehow. I think that’s where things should go. That said, React isn’t the only way to do it, and the vanilla js-land way of doing it has gotten really twisted in certain ways. Personally I agree with the whole server-side rendering complaint. I’ve never personally found it at all sane to do that. If Om Next didn’t have the code for it already, it wouldn’t be in Fulcro. But I am glad to have isomorphic operation. That turns out to be an interesting case where the ability to run things in the JVM does come in handy. Also, I agree that building your common business website as an SPA instead of just using a website builder is usually a mild form of insanity. But, if what you’re building is a thing that should behave more like a desktop application for the web, then an SPA makes a lot of sense. What I liked about the article was that it is challenging us to think about what we use our tools for…I’ve seen it over and over again that people will choose a tool “because the know it” or “because it looks cool” and not really think through the long-term implications.
Does RAD generate mutations for crud for the different entities, I am looking for simple crud mutations, given an :id, the entity is deleted, or a new entity is created etc
How do I trigger a generated mutation from the parser. I have included the save-middleware
which in turn uses the (datomic/wrap-datomic-save)
. This uses the ::form/params
to save any deltas in datomic.
How do I call it from the repl -
(parser {::form/params
{::form/delta {:farm/id #uuid "5eb40c62-164d-481a-bb53-463e1e3d8ad2"
:farm/name "New Farm"}}}
[])
The above does not yield any result.There must be an example in the RAD demo?