Fork me on GitHub
#fulcro
<
2022-09-06
>
sheluchin12:09:42

I think I'm not really using the REPL with Fulcro to its full potential. Any guides or pointers to specific videos from the series that demonstrate this aspect?

Jakub Holý (HolyJak)15:09:19

But essentially you can do anything in the REPL, no need to be clicking around

sheluchin12:09:39

Thanks @U0522TWDA, I'll take some time to go through those. > But essentially you can do anything in the REPL, no need to be clicking around Is this how you work? I'm guessing there's still a fair bit of clicking around when using Fulcro Inspect and Pathom Viz because they are more ergonomic options for what they do? The rest of my development is totally REPL-based, but for some reason I just can't wrap my mind around using Fulcro mostly from the REPL. I'd say almost all of my UI testing is clicking around at the moment... which is something I'd really like to change.

Jakub Holý (HolyJak)19:09:34

Right, I meant clicking in your app's UI. You only need to do it when testing your onClick etc handlers. Everything else can be done from repl. Also instead of printing component props you can get them via db->tree etc.

JAtkins14:09:07

Hi, I've found some suboptimal behavior of the Synchronous TX processor, particularly regarding its usage in tests. The vast majority of the time, when (comp/transact! app [(a) (b) (c)]) is called, (a) (b) (c) is evaluated before returning. However, since tests aren't single threaded, there is some small chance that on another thread the TX queue is being run, so my test call to comp/transact! returns immediately. This seems to happen most often with UISM that call set-timeout, since that function ends up calling TX on a separate thread. I've currently band-aided a solution by adding an (await-top-level! app) fn to the Sync TX processor and adding it strategically to my tests, but I'm curious to see if there is a more elegant solution.

donavan14:09:50

Just to be clear; the tests @U5P29DSUS is talking about are running entirely in Clojure not CLJS

tony.kay18:09:31

You can mock set-timeout, record what it is supposed to run in your mock, and manually call it where you want that logic interleaved.

JAtkins04:09:12

That's possible. I did find an alternative though. If run-transaction-queue! is being executed on another thread, synch tx! will await its' completion. It's a relatively small change, see https://github.com/fulcrologic/fulcro/compare/master...daitaas:fulcro:develop Does this change make sense to push into fulcro itself? IMO it'll save tons of headache in the future when someone else stumbles across this.