This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-16
Channels
- # atlanta-clojurians (8)
- # beginners (103)
- # boot (22)
- # boot-dev (1)
- # cider (36)
- # cljs-dev (55)
- # cljsrn (3)
- # clojars (25)
- # clojure (104)
- # clojure-brasil (1)
- # clojure-dusseldorf (2)
- # clojure-italy (8)
- # clojure-norway (9)
- # clojure-russia (15)
- # clojure-spec (6)
- # clojure-uk (26)
- # clojurescript (246)
- # cursive (26)
- # data-science (1)
- # datomic (22)
- # dirac (11)
- # editors (1)
- # emacs (8)
- # fulcro (50)
- # graphql (11)
- # hoplon (1)
- # jobs-discuss (27)
- # leiningen (44)
- # luminus (33)
- # lumo (2)
- # mount (1)
- # off-topic (8)
- # onyx (5)
- # parinfer (4)
- # reagent (94)
- # ring-swagger (14)
- # shadow-cljs (37)
- # spacemacs (10)
- # specter (3)
- # tools-deps (4)
- # unrepl (14)
- # yada (5)
@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.
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
like this https://github.com/fulcrologic/fulcro-inspect/blob/develop/src/fulcro/inspect/preload.cljs#L5
@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
.
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,
"`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...
@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/name
{: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
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 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 []
(cond
(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)
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?
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
nice, I think making an app is one of the best ways to learn, have fun 🙂