Fork me on GitHub
#fulcro
<
2018-05-10
>
tony.kay01:05:37

That error means that the route ended up with an ident not listed in your defrouter

tony.kay01:05:21

@oliver.mooney your ident functions and route instructions need to be consistent…you’ve used :profile for the table name in the routing table, :PAGE/profile in the router, and the the Profile page itself uses the destructured page (which is :PAGE/profile). So, the error is in your routing tree instruction.

tony.kay01:05:54

I should probably change defrouter to generate a “default” route that shows this error better 🙂

tony.kay02:05:40

Try 2.5.4-SNAPSHOT and see if the error is better…same me some testing time 🙂

myguidingstar05:05:09

how to add form config to a root ident? I tried all of the following, none worked:

(fs/add-form-config* MyFormComp [:my-root-key])
(fs/add-form-config* MyFormComp [:my-root-key '_])
(fs/add-form-config* MyFormComp :my-root-key)

OliverM08:05:40

@tony.kay that error-mode is much better thanks! I see "Cannot route: Unknown Screen" in my UI and no console error message, it's a much better hint

thheller08:05:52

@myguidingstar I think {:my-root-key '_}

thheller08:05:59

since its a join (maybe in a vector)

myguidingstar08:05:53

@thheller I literally meant '_ as it's the syntax for querying "links". You may have thought I use '_ as a placeholder for some properties, but it's not the case

thheller08:05:46

hmm you are right. I confused the syntax for join again. 🙂

myguidingstar08:05:25

after looking at the app state I guess the first one works. But I need to clean up the mess to confirm 😄

myguidingstar09:05:23

the book says a form component must have :ident, so my effort to use a root ident won't work

myguidingstar12:05:20

I'm trying to use root idents. Why does this print an empty map?

(defsc Root [this props]
  {:initial-state (fn [params] {:user/whoami {:user/name "Guest"}})
   :query [{[:user/whoami '_] [:user/name]}]}
  (dom/div {}
    (dom/div (str "user: " (pr-str props)))))

myguidingstar12:05:17

I expected it to print out "Guest"

tony.kay13:05:21

@myguidingstar In general Root is a special node. It cannot have an ident, and link queries (which mean “jump back to root”) aren’t meant to be used there. The latter is technically a bug, but the workaround is so trivial that I have not bothered to fix it (when already in root change [:x '_] to :x).

tony.kay13:05:22

It’s an artifact of the overall design that the Root shares the same space as all of the tables, and in general I recommend that you just create a root that “gets you to the app root” as quickly as possible 🙂

tony.kay13:05:58

@oliver.mooney Thanks for checking

Daniel Hines00:05:11

Hi Thắng. I wanted to let you know I haven’t forgotten about the real-world app. How is it going? The pressure’s increased on my project at work so I haven’t had much free time, but I should see a light at the end of the tunnel soon.

Fereidoon21:05:48

I am using (dom/span #js {:style {:color "blue"}} (str "11111" name)) to color the text, but it is staying black. What is it that I am doing wrong?

cjmurphy22:05:09

Needs another #js after :style I would say.

cjmurphy22:05:13

But there are ways to completely avoid using #js in the book.

wilkerlucio22:05:02

@rudiwillalwaysloveyou if you just bump to 2.5+ you don't need the #js at all

Fereidoon22:05:39

@wilkerlucio @cjmurphy I am doing the tutorial which is on an alpha version of 2.5 … Strangely enough adding the second #js solved the issue, and then removing them both worked fine as well (which I had tried first before adding the single #js). I have no idea why.

wilkerlucio22:05:56

yeah, probably because of the conversion rules

wilkerlucio22:05:04

if you used js on the first, it will not convert anything after that

wilkerlucio22:05:16

but by sending a clojure map the macro will convert it at compile time to js recursively

👍 4
tony.kay22:05:52

@rudiwillalwaysloveyou The macro only does automatic conversion if you pass it a normal data struture. If it is already a js value, it assumes you know what you’re doing and works in bw compat mode

tony.kay22:05:14

so, if you use #js you have to convert it all by hand. If you don’t, you don’t.

tony.kay22:05:36

so, yeah, what Wilker said 🙂