Fork me on GitHub

@splayemu So, your server-side mutation has to return a mapping from temp to real, right?


otherwise, you may have uncovered a bug. The resolution in queues and app state has to do with not being able to predict when an additional operation might be triggered by the user, meaning the thread has been released between operations on the client side, which forces the two mutations to go on separate network requests. If you're submitting them right together without letting go, then the internals of Fulcro might be combining them into a single network transaction...which would cause this problem. If that is the case, then I would consider that a subtle bug...the internals should probably not join together two unrelated calls of transact in one network request if they contain temporary IDs.

Spencer Apple18:03:00

I did return the mapping. Fulcro inspect seemed to think the transaction returned fine. I can verify by adding come client state and seeing if that get's autoresolved while the tempids in the next mutation do not.


I don't like to use the keystroke ctrl-f with Fulcro Inspect, as it interferes with find in my browser, so instead do this: :external-config {:fulcro.inspect/config {:launch-keystroke "ctrl-v"}}. Works fine from a project.clj file. Does not seem to be recognised when put in a shadow-cljs.edn file. Guess I should report on the shadow-cljs slack group...


hello. I am triying to compile and make changes to fulcro-routing video. I cloned to project, opened with intellij and cursive. from an external cmd line , ı run command "npx shadow-cljs watch main cards test". http://localhost:8022/cards.html is working, ı can see routing.intro. How can I see changes I made in files automatically?


@U1W0UBLLB Editing and saving should hot reload the code.


@cjmurphy as a work around, you can install the inspect by calling the init function yourself, so you can send the configuration as you please


@wilkerlucio: Funnily enough the same thing (except tool ns rather than core) in the tool I wrote, because of course I copied yours 😜 Still workarounds are workarounds...


@cjmurphy heheh, yeah, we have to know if shadow uses a different way for reading external config, I remember copying this impl from some other project, maybe we should have a lib for reading external configs :man-shrugging:


@cjmurphy did you specify :compiler-options {:external-config ...} in your build config? it won't get picked up outside :compiler-options


No, just did it the way it is done in lein: :external-config being a sibling key with :preloads.


This is modifying the shadow-cljs.edn file in the websockets2-demo


By the way I notice that devtools is installed after the other tools. That means that both default-db-format and fulcro.inspect don't have nice messages saying they are installed.


I always put the devtools first, for this same reason


But devtools done automatically for you with shadow, so you shouldn't be specifying it at all, that my understanding.


; shadow-cljs already enables console print and plugs in devtools if they are on the classpath,


That quote comes from wsfix.development-preload.cljs in the websockets2-demo.


devtools.preload is always injected first when its on the classpath


oh doh. its actually not injected at all if other :preloads are specified


will fix that


scratch that .. everything is fine 😛


"`devtools.preload` is always injected first when its on the classpath" - yes that's consistent with what I see. The thing is, are there any tools that should come before devtools? If not then devtools should come first. Of course that's a question without an answer...


you can always add it manually if you need to control when it gets loaded


otherwise since its just affecting the console it should be safe to use first?


@cjmurphy :external-config did not invalidate the cache so if you had a cached build it didn't pick up your config change. fixed that in 2.2.12


Tried out the new DOM stuff, really loving it! Especially with the localized CSS


@thheller @cjmurphy I think unless the user specifies a position for devtools on the :preloads, it should come first


because it's likely that other tools will want to print things on the console during setup/installation, and if they come before devtools it just looks bad


having an issue formulating a query, and potentially looking for a little help simplifying the query. let’s say I have a query with something like:

'[[:recipe-page/active-recipe _] [:db/id
                                  {:recipe/steps {:prep-steps/by-id [:db/id :prep-step/name :prep-step/some-prop]
                                                  :plating-steps/by-id [:db/id :plating-step/name :plating-step/some-other-prop]}}]]
where my normalized app state looks something like:
{:recipe-page/active-recipe [:recipes/by-id 2]
 :recipes/by-id {2 {:db/id 2
                    :recipe/name "My second recipe"
                    :recipe/steps [[:prep-steps/by-id 5]
                                   [:prep-steps/by-id 6]
                                   [:plating-steps/by-id 7]]}}
 :prep-steps/by-id {5 {:db/id 5 :prep-step/name "Chop the thing" ...}
                    6 {:db/id 6 :prep-step/name "Slice the other thing" ...}}
 :plating-steps/by-id {7 {:db/id 7 :prep-step/name "Plate the thing" ...}}}
for whatever reason, the actual attributes of the recipe/steps join aren’t getting pulled in, and all that’s getting resolved is an ident pointing to either a plating-step or a prep-step, i.e. recipe-steps looks like:
[[:prep-steps/by-id 5]
[:prep-steps/by-id 6]
[:plating-steps/by-id 7]]
as opposed to something like:
[{:db/id 5 :prep-step/name "Chop the thing" ...}
 {:db/id 6 :prep-step/name "Slice the other thing" ...}
 {:db/id 7 :prep-step/name "Plate the thing" ...}]
am I doing something wrong here? should I not be doing an ident lookup that deep into a query?


@mss your output doesn't match your query


in your query, you have :prep-steps and plating-steps in separated keys at :recipe/steps, but on your normalized data you have a single vector


is that not how unions work? two different “paths” so to speak?


oh, sorry, I read it wrong (the query), let me re-evaluate


sorry that it’s a little complicated. was trying to make a relatively simple example that’s close to the issue I’m working through


it looks correct, so you are saying that your :recipe/steps are retuning the idents instead of the actual data?


can’t quite figure out why


can you paste the source for the relevant components please (just queries and idents)


looks roughly like this:

(defsc PrepStep [this props]
  {:query [:db/id :prep-step/name :prep-step/some-prop]
   :ident [:prep-steps/by-id :db/id]})

(defsc PlatingStep [this props]
  {:query [:db/id :plating-step/name :plating-step/some-other-prop]
   :ident [:plating-steps/by-id :db/id]})

(defsc RecipeStep [this props]
  {:query (fn []
            {:prep-steps/by-id (prim/get-query PrepStep)
             :plating-steps/by-id     (prim/get-query PlatingStep)})
   :ident (fn []
              (and (contains? props :prep-step/some-prop)
                   (not= (:prep-step/some-prop props) ::prim/not-found))
              [:prep-steps/by-id (:db/id props)]
              (and (contains? props :plating-step/some-other-prop)
                   (not= (:plating-step/some-other-prop props) ::prim/not-found))
              [:plating-steps/by-id (:db/id props)]))})


@mss this looks all correct, one thing though, the first snippet you posted here '[[:recipe-page/acti..., you copied from your code or typed? I noticed it's missing the {} for the join (the main one, from ident to query)


wow that was the issue 😭


so sorry to drag you through all that just to sanity check my queries


no worries, I can only see because I got bitten by it so much already XD


and are you doing some cooking app for yourself?


really appreciate the help


just toying around with fulcro to get a sense of how it works, want to ship something in the future but just trying to get a solid mental model of it at this point


I do love to cook though 😜


nice, I think making an app is one of the best ways to learn, have fun 🙂


thanks again