Fork me on GitHub
#fulcro
<
2021-10-03
>
Jakub Holý (HolyJak)15:10:21

Hello! I am looking for a volunteer 🙏 who wants to learn about Fulcro's routing and has not looked at it before. I have finished https://github.com/fulcro-community/guides/blob/tutorial/advanced-min-fulcro/modules/tutorial-advanced-minimalist-fulcro/pages/index.adoc section about this topic and would very much appreciate if a person representing the target audience could proof read it. As a reward, you can ask me anything about it and I clarify whatever remains unclear.

Hukka06:10:08

Hm, well, I have read the beginning of the relevant section in fulro book while putting kids to sleep. I might remember some of it, or might not… in case you don't find anyone who hasn't even glanced at it

Jakub Holý (HolyJak)07:10:29

I guess that is good enough. Please have a look at it, if you will! 🙏

Hukka08:10:54

> Load the data just before the component is about to be displayed Ha! This was on top of my mind, is it possible and how. Intrigued that the explanation is coming (I hope!) later here

Hukka08:10:03

After reading the part about binding to the URL, I'm wondering how I should model the typical structure where there is no specific "all" route, but an empty route means all. Perhaps there should be an explicit route name in the state, even if it's not in the URL?

💯 1
Hukka08:10:05

Might be out of scope, and I just need to dig into the links to Fulcro book and the video

Hukka08:10:11

Or RAD source code

Hukka08:10:30

But coming from React side, I'm used to routing systems using the URL as the canonical state store, as they are otherwise state system agnostic. So perhaps an example showing that would be good right in this tutorial?

Hukka08:10:01

In any case, this is just my midpoint thought, I'll check the links after reading through

Hukka09:10:50

I was expecting that there would be some info on how to preload data, for example on a hover. Or what happens with nested routers and partial load failures (especially with multiple remotes). That is, how to do the stuff that React Suspense does

Hukka09:10:37

> will-enter can be called multiple times as part of the route resolution algorithm and MUST NOT side-effect but the examples do IO, and the book says > Finally, since the will-enter on any give router can do I/O it is never a good idea for the library to automatically trigger routes because that could result in unexpected I/O and side-effects for off-screen components.

Hukka09:10:44

Another question I came up is does fulcro routing support multiple parallel, not nested, route trees. For a contrived example, showing a settings tree at the same time as the usual UI tree, when the screen is big enough

Hukka09:10:40

I read now the links to fulcro rad, and the relevant part of the book, but didn't watch the video. And I still didn't figure out ho w to do those things I mentioned above, so this seems like a good spot for a comprehensive tutorial!

tvaughan11:10:07

> I'm used to routing systems using the URL as the canonical state store Same. This is something I've bumped into too

Jakub Holý (HolyJak)16:10:25

Thanks a lot! I think it is better to answer in the context so I moved most of your comments to https://github.com/fulcro-community/guides/pull/9#pullrequestreview-770507201 The rest: > But coming from React side, I'm used to routing systems using the URL as the canonical state store, as they are otherwise state system agnostic. So perhaps an example showing that would be good right in this tutorial? Sorry, I do not understand. Example of what? If you want to use the url, that is discussed in the section Binding... . But I guess you mean something else? > I was expecting that there would be some info on how to preload data, for example on a hover. Why? What does that have to do with routing? An answer anyway: that is as simple as {:onHover (fn [] (df/load! this :some-data SomeComponent))} No? Point 4. under https://fulcro-community.github.io/guides/tutorial-minimalist-fulcro/index.html#_how_to might also be relevant. As can https://fulcro-community.github.io/guides/tutorial-minimalist-fulcro/index.html#_when_to_load

Hukka08:10:21

> I think it is better to answer in the context so I moved most of your comments to https://github.com/fulcro-community/guides/pull/9#pullrequestreview-770507201 Commented there for those parts > Sorry, I do not understand. Example of what? If you want to use the url, that is discussed in the section Binding... . But I guess you mean something else? I do mean the URL, but the link to Fulcro RAD, while workable, is not that approachable. I think having the tutorial cover this part directly would serve a need. > Why? What does that have to do with routing? Because coming from React, this is one of the big talking points of Suspense, which I think is closely related to routing and Fulcro's approach of getting the data for the UI faster. Without routing there's no need for such tricks, because the whole UI tree loads anyway, but with routing it would be interesting to directly talk about ways to eliminate the perceived loading latency by preloading data before the actual route change is happening. I'm not saying that this information does not exist anywhere, just that I really did expect this tutorial to mention that subject too, and I feel it would make it more comprehensive.

Jakub Holý (HolyJak)11:10:55

@U8ZQ1J1RR Could you mark our conversations in GH that you feel are satisfactory answered with :thumbsup: so I know that's resolved? Regarding 2. - https://github.com/fulcro-community/guides/blob/tutorial/advanced-min-fulcro/modules/tutorial-advanced-minimalist-fulcro/pages/index.adoc#binding-the-route-to-the-url now links to https://chrisodonnell.dev/posts/giftlist/routing/#html5-routing I see little value in redoing the work Chris has done there in the tutorial, when it is just a click away. Ok? Regarding 3. Fulcro is not React and thinks work differently. You are free to do what you want, namely it is up to you what data you load when. See 3. and 4. in https://fulcro-community.github.io/guides/tutorial-minimalist-fulcro/index.html#_how_to for info about how to load parts of the data tree. If you want to do that on hover or whatever, you can. If you want to do that in will-enter, you can do that as well. So data loading and routing are quite orthogonal. > Without routing there's no need for such tricks, because the whole UI tree loads anyway Not really. It is up to you to load relevant parts of the data tree at appropriate points (and there is never a single :all-root-data resolver in pathom). As linked above. you can use :without to exclude parts from loading and load them later / in parallel. Does that answer the question? If not - can you explain little more what you want to hear from me? Thank you!

Hukka11:10:10

I think it's just a matter of interests, what I would personally find interesting to read about in Fulcro context. Completely valid to also keep things out of scope