Fork me on GitHub
#fulcro
<
2022-10-03
>
Joe R. Smith04:10:41

Built a project based on the Fulcro-RAD-demo project and can't for the life of me figure out why I'm getting this in the console: My package.json deps are exactly the same. :thinking_face: I don't see the error running the demo

m.q.warnock10:10:28

I also just built a rad-based demo project and I don't think I ran into the same problem, but I remember seeing this: https://book.fulcrologic.com/RAD.html#_required_dependencies and some other mentions of a joda-time change, so I'm guessing it's related. I bumped all the dependency's versions when assembling my deps.edn, so maybe that is how I bypassed the issue.

👍 2
Joe R. Smith13:10:04

The issue was resolved by using the yarn.lock in the fulcro-rad-demo project.

andrewzhurov12:10:28

Hello. A noobie question here. How do we sequence a bunch of local-only mutations? One solution that comes to mind is to have them in a vector and tx [(mutation-A) (mutation-B)]. Downside of this is that we'll need to repeat it across the codebase, would be nicer to define dependency (mutation-B depends no mutation-A) somewhere. Suggested place for it is in ok-action, error-action or result-action , but in order for these to run tx would need to be a remote one (as they won't be called without it, as I understand), which is not the case. So I'm left to wonder how to tx a local mutation A and have mutation B scheduled after it.. any tips?

nivekuil13:10:12

you could always just def the vector with a bunch of mutations and pass that around

nivekuil13:10:16

or just make one big mutation that calls the others

tony.kay05:10:43

If it's local only just do the operations as helpers in the mutation. You can call transact from within the action section as well.

zhuxun214:10:24

Using Fulcro's dynamic routing system, how does one implement a 404 page for undefined routes?

lgessler19:10:16

my instinct would be to shield the fulcro routing system from this situation, intercepting invalid routes before they get to the fulcro routers

lgessler19:10:54

if you're using web for example then on an attempted route change you'd check to see whether the new URI is valid for the site and route to a 404 (with a valid fulcro router segment sequence) if not

❤️ 1
zhuxun214:10:13

It looks like the router will be pending for a few seconds before it finally fails?

zhuxun214:10:54

What is the router waiting for if the next path segment is clearly not consumable by any of its sub-routers?

zhuxun216:10:27

fulcro Is there a plan to switch from ReactDOM.render to ReactDOM.createRoot?

zhuxun216:10:54

Currently if I'm using React 18, I am getting this warning message:

Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17.

dvingo18:10:11

I found this pattern works:

(defonce root (react-dom/createRoot (js/document.getElementById "app")))
(defonce SPA ( {:render-root! (fn [component] (.render root ($ react/StrictMode component)))}))
(defn refresh {:export true :dev/after-load true} []
  (println "Hot Reload")
  (! SPA))

👍 1
zhuxun222:10:22

(! SPA) does not seem to properly re-render upon code reload

dvingo23:10:27

oh right, I'm not using fulcro for any UI rendering - you may have success with callined mount! again

zhuxun202:10:08

hmmm... mount! again does not work either

tony.kay05:10:12

First of all, yes, I’ll get to it, second, you can configure what gets called... It’s an option when you create an app

* `:render-root!` - The function to call in order to render the root of your application. Defaults
     to `js/ReactDOM.render`.
   * `:hydrate-root!` - The function to call in order to hydrate the root of your application. Defaults
     to `js/ReactDOM.hydrate`.

tony.kay05:10:50

Native requires something different as well. It's also just a pr away 😉