-
Notifications
You must be signed in to change notification settings - Fork 36
Conversation
Replaced Iron Router dependency with `meteorhacks:picker`, which means you can now use this package with Flow Router as well.
I was thinking, before you accept this PR, people might be using Iron Router. So if they do any IR related stuff in the routes, that won't work anymore and break their code. So maybe we should do a check for IR, and if there's IR we use that to setup server-side routes. Then the update will be backwards compatible. |
True. The change will cause unexpected things in people's Mailer.config({
useIronRouter: true // defaults to false
}); If set to We'll advertise this in the README. Imo it's okay to introduce some breaking changes in 0.x versions. Thanks again! 🎉 |
|
||
# if Flow Router | ||
if FlowRouter? | ||
baseUrl = Utils.joinUrl Mailer.settings.baseUrl, FlowRouter.path.call(FlowRouter, routeName, params.hash) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to store this in baseUrl
here?
I also think we should have a fallback mechanism if the user has neither FlowRouter nor Iron Router installed. Like, doing a logger warning in the console.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ai, that line should be.
# if Flow Router
if FlowRouter?
Utils.joinUrl Mailer.settings.baseUrl, FlowRouter.path.call(FlowRouter, routeName, params.hash)
I'll change that. Sure, we can add a fallback mechanism
Or we can just check for
that way we don't need to introduce any other dependencies and no config. |
Sounds good! |
Removed Iron Router dependency
Replaced Iron Router dependency with
meteorhacks:picker
, which means you can now use this package with Flow Router as well:Uses
meteorhacks:picker
for server side routingemailForUrl
helper supports both Iron Router and Flow RouterUpdated readme
Bumped to v0.7.0 - I thought it was quite major ;-)