Fork me on GitHub
#fulcro
<
2022-09-14
>
Quentin Le Guennec06:09:19

Hello, is there a way in fulcro-rad to bind the route to the component being displayed, such as, eg, when the user navigates to http://localhost/blog , they see the blog and not the landing page?

Jakub Holý (HolyJak)20:09:34

@tony.kay I have discovered that it is mark-missing-impl that causes list values to be ignored and regarded instead as missing, namely the conditions at the beginning and and of this highlight https://github.com/fulcrologic/fulcro/blob/develop/src/main/com/fulcrologic/fulcro/algorithms/merge.cljc#L130-L140 only taking into account the case of vector? and not of list? Could it be changed? Or is it too scary, with possible unintended consequences in a critical algorithm?

tony.kay20:09:54

ok, so we know it is a join (the query tells us that). The only possible values in the denormalized tree there is therefore a map (to one) or a vector of maps. Lists are technically “ok” data for a scalar (as are sets and anything else that you can encode on the wire). We are detecting that it is a join, and so I do agree with you that changing vector? to sequential? should probably be ok.

tony.kay20:09:36

it’ll end up converting it to a vector in that case, and lists there are currently not working in any useful way, so I guess I’d accept it.

👍 1
Jakub Holý (HolyJak)10:09:31

https://github.com/fulcrologic/fulcro/pull/519 @U013CFKNP2R @U6VPZS1EK would you be interested in trying to run 👈 in your applications to have a real-world smoke test checking that this change does not break something crucial?

Mark Wardle11:09:16

Thanks Jakub. Very happy to try although my application very small.I'll see if it is possible to fetch your PR as a repo so I can use locally.

🙏 1
Mark Wardle12:09:06

It was trivial to clone the repo containing the PR so I will try it now.

Mark Wardle12:09:34

It all seems to be working, but of course, I have since switched my server implementation to return vectors... so will have to spend a bit of time undo'ing those changes and checking it works 🙂

Mark Wardle12:09:43

Ok just did a search and replace across project and turned all resolvers containing vec and mapv into resolvers returning lists and your change has worked. I then switched back to Fulcro 3.5.24 and double checked that returning the joins as lists does not work.

Jakub Holý (HolyJak)12:09:28

Thank you! BTW with deps it should be simple to add the PR as a git dependency over original fulcro without cloning, by I don't know the right incantation 😅

Jakub Holý (HolyJak)12:09:01

I guess st. like

com.fulcrologic/fulcro {:git/url "" 
                        :sha "4b454ce796884c11c2572248bbdfd654ce653e47"}

Mark Wardle12:09:49

I just cloned locally and used :local/root in my deps.edn

Mark Wardle13:09:40

But you're right - I should have thought about just specifying the SHA.

genekim19:09:52

Exciting, @U0522TWDA — I’ll give it a try tonight! Thank you, as I think this is a fantastic change that will make working with resolvers more forgiving of an apparently somewhat common error!

🙏 1
👍 1
tony.kay20:09:39

that isn’t exhaustive either:

(list? (cons 1 (list)))
=> false
(list? (map identity [1 2 3]))
=> false

Jakub Holý (HolyJak)10:09:45

True but you won't be getting those from Transit

tony.kay14:09:18

What about a remote that isn’t using transit? Such as one doing local loopback things synchronously, where the result of the resolver might direcly be placed in the result? It isn’t all networking, remember, it’s all generalized.

Jakub Holý (HolyJak)14:09:07

Once again you see far more than I do 😅

tony.kay20:09:28

sequential? might work…but I don’t love it

zhuxun222:09:17

I tried (om.fulcrologic.fulcro.inspect.inspect-client/install {}) but nothing happens

zhuxun222:09:07

Running (inspect/app-started! SPA) in the cljs repl does not help either

zhuxun223:09:30

In com.fulcrologic.fulcro.inspect.inspect-client, what is the difference between install and app-started!

zhuxun223:09:10

Why is it that in the https://github.com/fulcrologic/fulcro-template, the app-started! was never called, but the app works fine with inspector?