This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-02
Channels
- # announcements (1)
- # beginners (15)
- # calva (6)
- # cider (72)
- # clojure (105)
- # clojure-europe (2)
- # clojure-france (1)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-uk (32)
- # clojurescript (14)
- # code-reviews (10)
- # cursive (8)
- # data-science (2)
- # datomic (38)
- # events (1)
- # fulcro (31)
- # graphql (1)
- # hyperfiddle (47)
- # java (4)
- # jobs (4)
- # off-topic (18)
- # overtone (2)
- # parinfer (12)
- # pathom (19)
- # pedestal (4)
- # philosophy (2)
- # portkey (22)
- # re-frame (42)
- # reagent (1)
- # rum (1)
- # shadow-cljs (36)
- # specter (3)
- # tools-deps (2)
@tony.kay I get this error:
Use of undeclared Var fulcro-css.css-implementation/garden
141 | [x]
142 | (try
143 | #?(:clj (= garden.selectors.CSSSelector (type x))
144 | :cljs (= garden.selectors.CSSSelector (type x)))
145 | (catch #?(:cljs :default :clj Throwable) e
146 | false)))
147 |
148 | (defn get-selector-keywords
I don't even use flucro-css
garden 1.3.6 is installed.In particular, I'm wondering how to use pathom-remote instead of fulcro-http-remote while still being able to set the api endpoint and :request-middleware.
ok, I see that I misunderstood. I don't need to stop using fulcro-http-remote since I'm using pathom on server side.
@mroerni you sure that is an error? Should be a warning if you don’t have garden on the path
@tony.kay @mroerni I just got the same warning, not an error, just annoying
yes, the warning cannot be eliminated without needlessly bloating programs that don’t use garden
Hi all. I'm doing my first project with Fulcro at the moment, so first off, thanks Tony for all the work you've put into this. The more I do, the more I appreciate how many potential problems are solved already. I'm a little confused with regard to the automatic normalization. Say I have a component Person, and I want to see how it looks with a couple of different people entities from the server. I make a Root component to pass into ws/defcard. Its query is [:root/person (prim/get-query Person)]
, and it has an ident [:person/by-id :person/id]
. In ws/defcard I use df/load in the :started-callback: (df/load [:person/id 42] Person {:target [:root/person]})
. This issues a query [{[:person/id 42] [:person/id :person/full-name]}]
, which comes back as {[:person/id 42] {:person/id 42 :person/full-name "John Smith"}}
, which is loaded into the root of the client database as is, with :root/person pointing to [:person/id 42]. So if I understand properly, because the data is loading in as a join to the ident rather than just the person attribute map, it won't normalize properly. So I'm wondering if I'm supposed to hand-normalize this with a post mutation, or am I going about this wrong?
The only way normalization breaks is if you fail to use a component to make the query
Hmm. Isn't the :root/person
link getting updated by the :target
in load? The example I gave is a pared down version of what I have. Sticking with the example version, I'm ending up with a tree of :person
attributes under the key :person/id 42
in the root of the client db. :root/person
contains just the ident, which I presume :target
has done, but the only :person/by-id
I have has just appeared when I added in a form config. Sorry if I'm being dense.
I’m not sure what you’re saying is going wrong. You’re saying that the new data isn’t ending up in the table?
Yeah, I was expecting it would end up as {:person/by-id {42 {...
, but it's ending up as {:person/id {42 {...
. I may have the wrong idea. I watched your videos, and the only real difference between your todo-list example and this is that you were loading by an invented keyword which you parsed on the server (IIRC), and I'm trying to load a specific ident and shove it under an invented keyword with :target
.
@tony.kay Hey, I currently have some problems with routing to pages which require data from my remote to be loaded. I am trying to trigger a load and then nav-to! the page. This does not work. Not even, if I load the page way in advance. (I merge to the respecting id of the page.) So, how do I load a page with a dynamic id, which isn't loaded beforehand?
@mroerni not sure what you’re running into. Data does have to be in local db for UI to display (otherwise the query finds nothing)…typically you put some placeholder in place of what you will load so that the query returns something (to render), and then the refresh on load updates. The standard router is nothing more than a unino query component that follows the query based on the ident you’ve given it. See the book demos..there are a number that do similar things.
The example uses the old defrouter instead of defsc-router. And the id (:a) is set in the initial state.
You should have initial state on your components that you route to…not sure what you’re getting at…the new notation should cover that example fine
But how do I set the correct id in the initial state? I don't know which ids I have beforehand. And I don't see how I can pass them from the router. 😕
I have to look at his tomorrow. It is already midnight over here.