Fork me on GitHub
#fulcro
<
2018-08-06
>
j1mr10rd4n06:08:51

hi all, hoping you can help me find what it is i’ve missed here - i’ve been hacking around in devcards and put together a component that i want to bring into my app as a routed page - i’ve added the necessary idents and queries to be able to route to it from the application root, and i can see a mutations (triggered by a transaction from the component) changing the db inside the page node, but the component isn’t being re-rendered - it worked fine mounted as the root in a devcard - what else do i need to do to trigger renders now that it’s mounted as a page in a router?

liesbeth12:08:28

What component are you running the transaction against? Is is the component that is rendering the router?

cjmurphy12:08:02

@j1mr10rd4n Does it render if you set the :render-mode so that there should be no rendering problems: (reset! app (fc/new-fulcro-client :reconciler-options {:render-mode :keyframe}))?

liesbeth12:08:57

Hey all, I’ve a question regarding the yahoo.intl-messageformat-with-locales: in the fulcro-template that is required in client.cljs, and that also works. When I do the same in my own project, it won’t compile. The fulcro book says ” If you want to use Yahoo’s FormatJS, then you’d add the FormatJS library as a script in your HTML”, but that is not done in the template. Where does it come from in the fulcro-template project, i.e. where is defined that it should load/include that?

j1mr10rd4n14:08:27

@liesbeth i think i came across that problem and a solution when i had a go at bumping the fulcro-template dependency versions - have a look at the diff here https://github.com/fulcrologic/fulcro-template/pull/10/files

liesbeth06:08:43

thanks! yes I think that should be the same problem 🙂

j1mr10rd4n14:08:04

i added intl-messageformat-with-locales.min.js to the resources folder and a corresponding link in the SSR html template

cjmurphy14:08:55

@j1mr10rd4n Do you have a routing tree and make-route entries for all the possibilities? Are you starting off with a (r/route-to ...) to get there in the first place?

j1mr10rd4n14:08:47

i also found the answer to my earlier question… I needed to change the path in the mutation to reflect the component’s new location as the child of a union query. In the devcard the mutation was swapping a state key at the top level e.g. (swap! state assoc-in [:selected-widget] name) but as a child element that key would now be (swap! state assoc-in [:widgets :page :selected-widget] name) for a page router with [:widgets :page]

j1mr10rd4n14:08:15

thanks for the suggestions though

cjmurphy14:08:36

No worries. So far I've only needed to use r/route-to and r/route-to-impl! to actually change the routes.

tony.kay15:08:13

@liesbeth Yes, I removed the yahoo js file from Fulcro…was a poor idea to even include it. Just include it in your HTML via a CDN or copy it to your own resources

👍 4