FlowRouter or IronRouter?

@arunoda, Not being familiar with flow router myself aside from reading over the docs, I’m still trying to understand where flow router is offering advantages over iron router, and where it is just doing things differently. It sounds like rendering decoupling is a big plus if you are developing with something other than Blaze.

Using iron router, if I want a giant loading screen until certain subscriptions are loaded, then I could put those subscriptions in waitOn. If I had subscriptions that I don’t want to block the route, I’d instead put them in subscriptions, and then I could either just let the data load in, or I could hide portions of my templates by only displaying them when the reactive Router.current().ready() became true.

In this way I can easily build custom loading sections with iron router. How does that compare with how flow router works?

That’s because we only had one router earlier. Developers and authors will find patterns to work with these.

For an example, useraccounts will support both IR and FR. Or may be some other router we will seen in next month or after.

see: https://github.com/meteor-useraccounts/core/issues/308#issuecomment-83409225

It’s very important for Blaze as well. Then, you can think beyond yeilding templates. (which I never understood correctly) and define your layouts as you like.

Router.current().ready() is kind a bad. It’ll re-run for any change in your router. For an example, let’s say subscriptions loaded correctlly and you are appending some query param. Then all the helpers for Router.current().ready() is calling again. Which leads to some more CPU cycles. If you are using mini-mongo APIs inside the helpers using Router.current().ready() then that’s pretty heavy.

We are not only decoupled, but also provided a rich API to get the data from the router reactively in performance in mind. Above is just one example.

I don’t say it’s possible to do what we claim in Flow Router. We make it first class and give all the support we could from the router.

+1 for Flow Router

Ran into one bug (will get an issue up when I get a chance) but find it so much easier to reason about and love that the whole page does not re-render, flows (get it) well with a component based set up. eg. the NAV component may have some subscriptions (maybe most recently viewed posts by currently logged in users) and if the current post changes, that NAV component should not have to re-render, redo anything because only the main ‘postView’ component has changed.

I think that having the router separate from the renderer (while a little confusing at first) did make a lot of sense, plus I found that for prototyping, I would have to set up so much boilerplate to install Iron Router, where as I can start with flow router and add the layout stuff a bit later.

Minor downside; not as many integrations with existing packages, but that can be managed.

Thanks @arunoda for your incredible hard work on this, and Chris on his work with Iron Router.

BTW: I’m not the only one working with Flow Router. Initial our meteorhacks started working. Now, a lot of people started contributing.

I specially need to thank @delgermurun for implementing key features.

3 Likes

Ive read a couple responses that note there might be issues with iron router when using Jade. Is this true, and if so, why? Ive yet to use either of these routers but I like my Jade.

@arunoda Thanks for shout-out :smile: . I’m learning so many things from you. Thank you too.

2 Likes

I’ve been using iron:router along with mquandalle:jade for several months and I’ve yet to run into any issues. I’ve also played with FlowRouter for a bit now and no issues between it and Jade either

1 Like

@arunoda Is there a way to do an action before leaving a route in Flow Router, like onStop hook does in Iron Router?
I would like to change to Flow Router but I need a way to detect if data has changed before leaving a route.

Thanks

Could you use a template’s onDestroyed hook to accomplish that?

It’s in the developing the right now. We have an active PR.

Hi,

I am a newbie and don’t know why but when i started creating new meteor project… it was all in total of 400MB including .meteor directory… but now after a week, installing a few packages (.meteor) directory filesize has been increased upto 4GB… WebStorm starts hanging up always… will you guys help me out with this thing ???

I think it’s not right place to ask su question. You should start new thread for your problem.

Hello, i’ve got a problem. When i submit my Autoform in the Url i have the field of the form and their values ? How can i resolve this ? Thank you very much

localhost : 3000 /?signupName=po&signupPassword=po&signupEmail=po%40heb.be&signupCountry=China&action=