2018: iron-router / flow-router for a new project? (using Blaze)

Happy 2018 friends! I’m starting a new side project after being “away” for a year or so (by day I sling bits in C on microcontrollers)… Lots has happened in Meteor land in the mean time!

Last I checked in, flow-router was The Blessed Way from MDG. It’s the only router currently listed in the Meteor Guide. But it seems after Kadira folded, the Meteor Routing Guide is kicking back a 503?

Then there’s fine-router?

The project I’m starting will be small-scale and use Blaze templates. Since it’s a side thing with a narrow intended audience, PITA-factor and maintainability are more important than performance or scalability.

Thanks,
Dave

1 Like

If you’re sticking with Blaze, then Flow Router would still be the way to go. Iron Router has some anti patterns that are best to avoid (for example managing subscriptions on the router level which is not a good idea) and has fallen behind further in maintenance at this point.

If you’re feeling adventurous though, I’d recommend to have a quick look at Vue. The learning curve coming from Blaze is minimal once you get past the first day or two settings things up, development experience is very pleasant and questions like routing are already solved for you out of the box.

4 Likes

If you want to go with Flow Router, you may want to take a look at the following package https://atmospherejs.com/ostrio/flow-router-extra this package is the one with up to date dependencies.

8 Likes

Thank you both - super helpful! I’ve heard lots of good things about Vue, so I may give it a try once I get past the proof-of-concept stage…

Much appreciated!
Dave

I’ll also vouch for flow-router-extra it’s got a bunch of improvements over the original and I’m using it in a 1.6 project without issue

3 Likes

Rather, Iron Rather allows some anti-patterns; you don’t have to follow them. It works just fine as a simple router with Blaze for 1.6, but it’s probably a bit bloated (e.g. with unnecessary code that allows said anti-patterns).

I’d say go with Flow Router if you’re using Blaze.

6 Likes

Already answered. Search forums before posting duplicate question.

1 Like

I did see the prior (albeit very brief) Oct-17 thread on Flow-vs-Iron, but it didn’t address the concern I articulated in the OP: that the canonical flow-router code base is abandoned and the MRG is no longer available.

I don’t think it’s unreasonable to have some concern about basing a core piece of app functionality on a codebase that’s no longer maintained. Thankfully, @vooteles and @cyardimici provided constructive, helpful answers!

1 Like

maybe search doesn’t always return the best results. Here’s a few that should help guide your decision:

Also very helpful threads - thank you!

I added in flow-router-extra to my app over the weekend - so far so good! Your added context here has definitely improved my confidence in that direction…

Thanks again,
Dave

2 Likes

I’ve never understood the hostility towards iron router. None of the reasons that people have posted for switching to flow router ever made genuine sense to me.

We’ve been happily using iron router in our webapp since early 2015 and continue to do so.

4 Likes

We are still trucking along with iron router but for a new project I’d used something newer

1 Like

I have created a rather large app with Iron:Router, but so far have not been able to figure out how to implement dynamic loading, so I need to switch

Retrospectively, 2 years later, was a switch easy and ‘worth it’?

Still using iron:router in that app because I figured out that dynamic loading works just as well. Here is a route that pulls in the required files asynchronously

Router.route("/account/:userid", {
  async onBeforeAction() {
    import '/imports/client/account/profile.js';
    import '/imports/client/account/favorites.js';
    this.layout('agencyCover');
    if(this.next) this.next();
  },
  template: "accountProfileOther",
  name: "accountProfileOther",
  title() {
    var u = Meteor.users.findOne(this.params.userid);
    return u ? u.name : null;
  }
});
2 Likes

Cool. Any difficulties with using this kind of routing? Would you recommend it for starting with Meteor?

No difficulties. Which router to choose depends on your needs. In new Blaze projects I usually use FlowRouter Extra or a router for the front-end chosen (vue-router, svelte-router, …)

1 Like