This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-30
Channels
- # announcements (14)
- # aws (2)
- # beginners (167)
- # calva (25)
- # cider (124)
- # cljs-dev (2)
- # cljsrn (7)
- # clojars (2)
- # clojure (113)
- # clojure-europe (2)
- # clojure-italy (6)
- # clojure-spec (30)
- # clojure-uk (90)
- # clojurescript (20)
- # code-reviews (16)
- # cursive (28)
- # data-science (2)
- # datomic (89)
- # duct (97)
- # emacs (4)
- # figwheel-main (12)
- # fulcro (37)
- # graphql (3)
- # java (3)
- # jobs (2)
- # juxt (3)
- # kaocha (37)
- # leiningen (2)
- # luminus (2)
- # off-topic (30)
- # onyx (2)
- # pathom (3)
- # qlkit (1)
- # re-frame (7)
- # reagent (2)
- # reitit (62)
- # remote-jobs (9)
- # shadow-cljs (26)
- # tools-deps (19)
- # vim (1)
- # yada (8)
Hi, Fulcro newbie here. I'm evaluating Fulcro for my startup, and wondering what is the situation for having multiple clients? Is it possible to call the Fulcro API from Android/IOS, React Native/Flutter/etc? AFAIK, the server API is not GraphQL (e.g. Lacinia). Do I need to code a separate GraphQL endpoint for these clients?
@1zaak ideally Fulcro should work with a server API called EQL, not GraphQL. But it's possible to translate EQL to GraphQL (or even REST) via Pathom. That translation can be done right in client app (so no extra server required)
@1zaak fulcro does work with with react native, and can consume any non EQL APIs, vai pathom, you can use pathom to consume graphQL/REST APIs in the client or use pathom on the server to build your EQL API
However, please note that GraphQL doesn't have tempid and namespaced keywords
yes both REST and graphQL are missing some features because of their inherent limitations
you should be able to use fulcro wherever you can use javascript and react
when i started my current project i originally thought i’d have a graphQL API on the server just to keep my options open
but then i just decided i’d probably make all my clients fulcro and i much prefer EQL
There is a plan to make #pathom expose graphql. I'm (as me, not as pathom contributor) planning to work on that in some days.
just to clarify this statement, pathom is already able to consume graphql apis, but not to expose then as GraphQL
Thanks a lot for the useful comments @currentoor @myguidingstar ! I'm still understanding Pathom, EQL and how everything fits together, but this is a good starting point. BTW, any comments on the development speed/intensity compared to classical ring/pedestal-hiccup/selme web app? (Just a bonus if I have an answer for this, I am aware of the benefits/downside of a SPA approach)
have not tried it. Tools deps doesn’t work well on windows, unless you use the ubuntu support.
I wonder if anyone has tried https://clojure.org/guides/getting_started#_other_ways_to_run_clojure on windows
@1zaak so it depends on the individual but there’s a learning curve till most people finally “get it”, since there are a lot of new concepts
For the first few weeks/months it might even feel slower (but simpler) but after that you’ll be able to sustain a really good pace of development
Hello 🙂 Is it fine with Fulcro to do a top-level load like this: (df/load app :>/app root/App)
in order to load data for a components that wants to query on root?
@U0CKQ19AQ is there a better way to do what I am trying to do then? My App
component holds a query that needs to be run at the top-level in Pathom
why not define a resolver that has a simple key and no inputs? Those are root queries
@U0CKQ19AQ So you mean define a :app
resolver? Because here is the query I have in App:
{:query [{:all-users [:user/id :user/name]}
{:current-user ...}]}
Both :all-users
and :current-user
are resolvers without inputsI’m not sure where the disconnect is…all the placeholder does is “stay in same context” which you weren’t even in…so AFAICT you’re not doing anything but confusing the reader
@U0CKQ19AQ sorry, I would like to not use a placeholder, but I simply don’t understand how to achieve the same result without one. As far as I understand when I issue a (df/load app :some-query SomeComponent)
, it runs :some-query
in the root context with the selection defined by :query
in SomeComponent
But in my scenario the selection defined in SomeComponent
is what I want to get on the root context
if what you’re doing works, perhaps I don’t understand it…I don’t have more of an answer for you. Load always load to root. Period. What you call the keyword is what it appears as. Period. If you’re targeting, then that is something else.
I'm reading the fulcro user guide and have a few questions. http://book.fulcrologic.com/#_using_javascript_react_components mentions that >1. If you are importing third party components, you should be importing the class, not a factory. >2. You need to explicitly create the react elements with factories. The relevant js functions are React.createElement, and React.createFactory. Does this mean it is possible to import js factories if one wraps it with React.createFactory? Why should i prefer using React.createElement? Specifically if there is a factory function that I want to use...
I honestly don’t remember 😜 it could have been the force-children thing. It depends on how you want to use the components. Fulcro generates React-compatible things, but children end up as a lazy sequence sometimes, and react doesn’t know what to do with those. If you remember to force the children, then you’re probably ok using their factories.
So i have been playing around with using force-children. I tried your react-motion demo project and got to see what happens when the lazy error or with-context error are present. The behavior I am seeing is a bit different, It appears to render fine but without styling, and the functionality doesn't work properly... I might make a git repository showcasing the problem and post it here if that is ok.