Fork me on GitHub
#fulcro
<
2020-09-07
>
tony.kay01:09:36

nothing “passes initial state”…d routers just compose in nitial state from their targets

Jakub Holý (HolyJak)12:09:45

Any experiences with making IntelliJ not complain about invalid number of arguments passed to a client and server-side mutation? The problem is that I have both fulcro/defmutaion (which takes 1 arg) and pc/defmutation (which takes 2 args). And since my UI is .cljc , Cursive tells me correctly that the arity is not correct (implied "...in the context of Clojure"). The only solutions I can think of: 1. Have UI only in .cljs files 2. Do something like (comp/transact! this [(my-domain/my-mutation #?(:clj nil) {:param1 input})]) 3. Pass it a symbol instead of the function call, i.e. (comp/transact! this [(com.myorg.myapp.my-domain/my-mutation {:param1 ~input})])` 4. Ignore the error / disable warning for arities Any better option? Thank you!

nivekuil15:09:56

I just turn those off, the arities are fixed and well known so it's not a useful lint

Jakub Holý (HolyJak)16:09:38

Is it possible to turn them off just for mutations? I like them for normal functions :)

nivekuil16:09:37

yeah, if you're using clj-kondo in the config.edn I have

:linters {:unresolved-symbol {:exclude [(com.fulcrologic.fulcro.mutations/defmutation)                                          (com.wsscode.pathom.connect/defresolver)]}

nivekuil16:09:49

:unresolved-symbol probably isn't the one you want but that's how to exclude particular symbols

Jakub Holý (HolyJak)18:09:54

:grinning_face_with_star_eyes:

nivekuil16:09:00

does it ever make sense to have two components with the same ident and different queries? especially if one query is a subset of the other

👍 3
nivekuil16:09:56

doing this lets you keep the database very normalized but complicates cache logic, i.e. it's no longer as simple as just checking for the ident in the state

lgessler17:09:36

for sure, say you have a ProductListItem that only displays :product/name but you also have a ProductDetails component that has :product/name, :product/manufacturer, :product/price, etc. the ident is :product/id in both cases

lgessler17:09:25

you could still use the loading strategy you describe if you were committed to loading the entity if and only if you're going to load all the data about it that you need, though that might become expensive

lgessler17:09:02

i think the more common strategy is to just use user actions to trigger loads (e.g., user navigated to ProductList, user clicked on ProductListItem and triggered the appearance of ProductDetails, ...)

nivekuil17:09:12

that's helping me get a clearer picture, thanks. I think my attempted cleverness with reitit and the union router has been impeding my understanding of granular loads

minhnn18:09:56

hi, every body

minhnn18:09:35

I’m doing Getting Started in Fulcro Developers Guide

minhnn18:09:24

after init and build project, I go into and get too much error

minhnn18:09:36

after try many version of shadow-cljs in deps.edn, version 2.10.14 work with me

minhnn18:09:58

2.8.107, 2.11.1 not work

thheller18:09:15

@minhnhat10bk can you share your deps.edn? most likey this is caused by a dependency conflict on something.

minhnn18:09:22

my current deps.edn

{:paths   ["src/main" "resources"]
 :deps    {org.clojure/clojure    {:mvn/version "1.10.1"}
           com.fulcrologic/fulcro {:mvn/version "3.0.10"}}

 :aliases {:dev {:extra-paths ["src/dev"]
                 :extra-deps  {org.clojure/clojurescript   {:mvn/version "1.10.742"}
                               thheller/shadow-cljs        {:mvn/version "2.10.14"}
                               binaryage/devtools          {:mvn/version "0.9.10"}}}}}
and shadow-cljs.edn
{:deps     {:aliases [:dev]}
 :dev-http {8000 "classpath:public"}
 :builds   {:main {:target     :browser
                   :output-dir "resources/public/js/main"
                   :asset-path "/js/main"
                   :modules    {:main {:init-fn app.client/init
                                       :entries [app.client]}}
                   :devtools   {:after-load app.client/refresh
                                :preloads   [com.fulcrologic.fulcro.inspect.preload]}}}}

thheller18:09:44

hmm looks fine

tony.kay21:09:45

if you’re goign to bump dependencies, make sure you bump to the latest Fulcro, and update the deps in package.json. Also make sure your cache is disable in browser when devtools is open @minhnhat10bk