Fork me on GitHub
#fulcro
<
2018-08-24
>
wilkerlucio01:08:35

Fulcro Inspect 1.0.3(extension)/`2.2.2`(package) is out! This version uses state deltas to sync the app state, this adds a considerable performance gain for apps with big local dbs. Also adds a new button at the network layer, right after the Request there is a Send to query button that will select the Query tab and fill the query using the selected request.

👍 16
veddha05:08:21

Can some tell me why my css not generate? I change the background color, but still not changed. Thank u

cjmurphy07:08:53

@veddha.riady: One way is to (injection/style-element {:component this}) in the root render. But I think that is for components that have queries, which yours don't. See http://book.fulcrologic.com/#ColocatedCSS for the other options, including that will work with the 'old way' that you are using.

veddha07:08:48

@cjmurphy when i insert (css/upsert-css "my-css" root) in the end of my code, I got error "java.lang.RuntimeException : No such var: css/upsert-css" did i do something wrong?

cjmurphy07:08:12

Maybe you are using the wrong css namespace, that doesn't have upsert-css. 😉

cjmurphy07:08:47

Fuclro 2.6+: Use the fulcro-css.css-injection/upsert-css or fulcro-css.css-injection/style-element to embed the CSS.

cjmurphy07:08:44

So there are multiple namespaces. Are you using fulcro-css.css-injection?

veddha07:08:45

@cjmurphy i use [fulcro-css.css :as css] and [fulcro-css.css-injection :as injection]

cjmurphy07:08:33

So injection/upsert-css - does that work?

veddha07:08:56

@cjmurphy no, still doesn't work

cjmurphy07:08:24

You mean the same java.lang.RuntimeException?

veddha07:08:21

yeah right, No such var: injection/upsert-css

cjmurphy07:08:35

How are you calling it?

cjmurphy07:08:49

From the book: (css/upsert-css "my-css" Root) ; NOTE: Use css-injection in Fulcro 2.6+

cjmurphy07:08:49

So (injection/upsert-css "my-css" Root)

veddha07:08:09

there's my code

cjmurphy07:08:25

which version of Fulcro?

veddha07:08:35

yeah i've use (injection/upsert-css "my-css" Root) but still got No such var injection

veddha07:08:21

i use fulcro version 2.6.0-RC9"

cjmurphy07:08:16

I think you are no longer supposed to include a special lib for css. Does your project only have one library for Fulcro?

veddha07:08:09

yeah only one library, so how i generated my css?

veddha07:08:22

i follow all the tutorial but still stuck at this

veddha07:08:46

i will direct message yi

j1mr10rd4n13:08:46

i think i’ve found another typo in the developers guide - could someone double-check please? in the last snippet in 8.5.1 http://book.fulcrologic.com/#_node_specific_mutation, i believe field-name should instead be :person/friends i.e. the add-friend** example should read:

(defn add-friend**
   "Add a friend to an existing person in the client database."
   [app-state person-id friend-id]
   (update-in app-state [:person/by-id person-id :person/friends] (fnil conj []) (person-ident friend-id)))

(defmutation add-friend [{:keys [source-person-id target-id]}]
  (action [{:keys [state]}]
    (swap! state add-friend** source-person-id target-id)))

wilkerlucio13:08:39

if you find an issue feel free to send a PR with fixes to it

j1mr10rd4n13:08:02

hi wilker, i’ve had some commits merged already into the guide - just wanted to double check that this error is what i think it is

🙂 4
cjmurphy14:08:01

I agree that the update-in in the function add-friend** is wrong. There's no field-name there so it won't even compile. The operation is to add a friend to an existing list of friends that a person has, so :person/friends makes sense as the 'field name' to use.

👍 4
tony.kay15:08:10

@veddha.riady Are you using cljs or cljc for your file?

tony.kay15:08:49

The upsert-css function is only available in cljs, since there is no DOM in clj.

cjmurphy15:08:38

@veddha.riady @tony.kay ns declaration of the cljc file used

tony.kay15:08:42

if you use upsert-css in that file, you’ll need to make it cljs-only #?(:cljs (injection/upsert-css ...))

tony.kay15:08:20

@j1mr10rd4n Some content got moved around some time back, and I think I introduced some issues into the book. Thanks for proofreading and reporting. I know, in particular, some of the forms stuff got messed up.

j1mr10rd4n15:08:48

no probs, i’m enjoying using fulcro in a greenfield react-native project at the moment - making heavy use of the dev guide for reference and keeping a branch with things i find as i go

tony.kay18:08:29

@j1mr10rd4n I fixed that doc problem and did a few edits to the form state chapter as well.