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:
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
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:
Apart from combining the separate Iron Router packages into one, these are the differences between Galvanized Iron Router and the Polygonwood fork:
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:
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.