Fork me on GitHub
#fulcro
<
2018-01-31
>
tony.kay07:01:13

New video in the basics series. The tour one was out of date, so I deleted it and renumbered. The new video was added at the end: https://youtu.be/HJBI24yAdBQ It covers UI routing. Some of that material was covered in the Union Query video (briefly at the end), but this new video goes into quite a bit of detail on what your options are, shows you the path of development that led to defrouter, and goes through details of joining defrouter together with HTML5 history events, URL matching (with bidi), and even a demonstration of how to deal with routes that need to load their content.

tony.kay07:01:54

The companion files are also up on github. See the video description for the link.

levitanong09:01:10

I’m looking into using react-transition-group with fulcro’s UI routers and it seems promising. The problem is that the routes lose the fulcro dynamic bindings because react-transition-group’s API takes in a function child. This is a known issue with om.next, and some have solved it by rebinding within the function child. [1] I’m almost certain that the fix for fulcro is similar. I was just wondering if some additional thought has been put into this, and if a better way exists or is planned for the future. [1] https://github.com/hugoduncan/navigator-repro/blob/master/src/navigator_repro/macros.clj#L3

tony.kay18:01:20

@levitanong Any fix for Om Next that works at the UI layer should work with Fulcro.

levitanong18:01:51

@tony.kay thanks for the clarification. On the topic of the library design, yeah it makes me uneasy too. I mean, if one must use a function, then why not pass it as a parameter/attribute? It seems to have a strong foothold in the react community though.

tony.kay18:01:21

strangely, though, there are examples of using it without a function in the facebook docs: https://reactjs.org/docs/animation.html

tony.kay18:01:29

that should “just work” with Fulcro

levitanong18:01:50

yeah, that example is specifically for the CSSTransition.

tony.kay18:01:05

I should play with it and make a video 🙂

tony.kay18:01:18

It’s something people commonly want

levitanong18:01:25

that would be useful to a lot of people!

levitanong18:01:51

an example in the book might be more accessible though

levitanong18:01:04

such that it is not constrained by time

tony.kay18:01:25

True…that takes me a lot longer to make 😉

wilkerlucio18:01:46

I had used CSSTransitionGroup with Fulcro at dave conservatoire

tony.kay18:01:58

ah, so examples exist?

wilkerlucio18:01:06

I was trying to find the code, but I'm not using it anymore, have to hunt on history

tony.kay18:01:14

why did you stop using it?

wilkerlucio18:01:35

just didn't needed, I was using for animating the progress bar, but later switched to NProgress

levitanong18:01:50

does CSSTransition require an example? It seems like a fairly simple API. It’s the outlandish ones like for Transition and ReactMotion that violate the geneva convention

wilkerlucio18:01:43

it's simple, I just did a wrapper, the hardest part IMO was just changing the React to use the version with the extensions

tony.kay19:01:33

So @levitanong I’m confused. You asked about react-transition-group, then said that was easy, then said ReactMotion is really what you want…what is it, exactly, that is your problem?

tony.kay19:01:43

Are you basically asking how you can use functions as a child?

tony.kay19:01:13

You can access the raw children prop with (.. component -props -children) if you need to implement something that way. Passing a function into children should work identically…it’s a standard react component. If it doesn’t then I’d consider it a bug. NOTE: the prim/children function always ensures that children is a sequence. Therefore if you pass a function to a Fulcro component and expect a function, you can either access the raw props, or (first (children this))

tony.kay19:01:13

OH…sorry, I didn’t look at your code link.

tony.kay19:01:30

Your problem is that the factories lose the binding as children

tony.kay19:01:17

I can add something like that to Fulcro. I forgot about the bindings…you will need those

tony.kay19:01:46

and it should also be in the book

tony.kay19:01:09

@levitanong I pushed 2.1.5-SNAPSHOT with prim/with-parent-context

tony.kay19:01:20

it should let you do the function as a child pattern