Galvanized Iron Router 2.0.0 Released - Rust-Resistant Routing for Meteor 2.0 & 3.0!

I am excited to release Galvanized Iron Router 2.0.0 - the rustproofed successor to that routing package we all know and love!

Just as galvanizing iron makes it rust-resistant and longer-lasting, this fork gives Iron Router a new lease of life with full Meteor 3.0+ compatibility while maintaining support for Meteor 2.0+.

This was a byproduct of my own efforts to upgrade my existing codebases. I hope this helps everyone else in their quest to modernise their mature Meteor apps. Feel free to fork this package. You can find it on GitHub here:

What’s New:

  1. A single unified package: All the iron:* packages you used to install separately are now consolidated into one package:
  • No more juggling iron:core, iron:layout, iron:controller, etc.
  • Simplified installation and maintenance
  1. Modern Meteor Compatibility:
  • Supports both Meteor 2.0 and 3.0, making it easier to transition to the latest Meteor at your own pace.
  • When run under Meteor 3.0+, it will support the promise-based async/await execution model.
  • When run under Meteor 3.1+, it will use Express instead of the Connect middleware

Installation:

Upgrading is simple - your existing code works unchanged:

meteor remove iron:router
meteor add vlasky:galvanized-iron-router

That’s it! 100% API compatibility with the original Iron Router. Enjoy!

9 Likes

The man. The legend! @vlasky saves the day again! :tada:
I’m in the process of upgrading an old Meteor app to Meteor 3, so this will be super useful.

So if I get this right, the main difference with this:

Is that all of the packages are combined into one?

3 Likes

Apart from combining the separate Iron Router packages into one, these are the differences between Galvanized Iron Router and the Polygonwood fork:

  1. The implementation of RouteController.prototype.dispatch():

    Galvanized Iron Router maximises backward compatibility by checking for the presence of Meteor Fiber support. If it’s enabled, it will dispatch the route function within a Fiber, as Iron Router does. Otherwise it will dispatch the route function asynchronously within a try/catch block.

Here are the two different implementations side-by-side:

  1. Galvanized Iron Router uses the functionality of Express 5 as the body parser when running under Meteor 3.1+. The Polygonwood fork retains the original Iron Router functionality that utilises the body-parser NPM package.
1 Like

Amazing work, @vlasky. I’m glad someone out there is still carrying on the torch of the classic Meteor/Blaze stack. :clap: :clap: :clap:

5 Likes