Fork me on GitHub

I have a component with :route-segment ["tenant" :tenant-id] but the router won't accept it. I get "Spec failed. :tenant-id should satisfy string?". I have no clue why this happens. This is a valid route segment, and I use the same thing in other forms.


@U2APCNHCN route segments are FORCED to strings (because they must be supportable from URLs which are strings). You’re probably passing a non-string to one of the functions that does routing, and it is warning you that you’ve used non-string data in routes.


It doesn't even call the will-enter function though


The routing works fine when using Fulcro's and Fulcro RAD's routing functions, but as soon as I want to access a parametrized page by URL, as in typing it in the address bar and pressing return, it falls apart


Maybe some client middleware?


take a look at other thread @U2APCNHCN


Okay I created another new form with a route segment with a keyword and get the same error as well...


My route segments are either ["person-list"] or ["person" :person/id] in the first case my :ident is a function (fn [] [:component/id :person-list]) and in the latter it is :person/id .


I have a top level property in my app db that I want to load a collection of idents into, but I want the load to but cumulative (issuing multiple loads should append data and not clear the vector) - when I issue a df/load! that targets that top level property the data from the load overwrites the collection that is there - using target append-to does not work either. Is this a supported use case or will I have to use a mutation and handle the merge logic myself?


what do you mean “`append-to` does not work either”? Ah, append-to might to for to-one only. I would consider that an oversight…I’ve never used it for that. I’d accept a PR for a check in append-to that would do collections I guess. Your option right now is just to make it a post-mutation of your own. Ultimately, that’s all data targeting is.


yep - it's a collection of idents - I will try out the post mutation option for now and may look into updating the data targeting to support that.


@danvingo I do that with append-to.


It works but can cause duplicate entries when appending.


The fulcro docs for form state have this example input:

(dom/input {:value    (or name "")
            :onBlur   #(comp/transact! this [(fs/mark-complete! {:entity-ident [:person/id id]
                                                                 :field        :person/name})
what's the :root/person doing in the transaction?

jb recluse02:07:15

i think @danvingo correctly described its function below. as additional info, the book appears to call it a "follow-on read" if i understand correctly.


Yes, that’s it exactly. The original rendering model asked the user for hints on “dependent refreshes”. These are still allowed and rendering can still use them (ident-optimized), but the current best practice is to use a renderer that doesn’t need the help.