The document discusses routing best practices in Meteor and other platforms. It describes how routing was not initially part of Meteor's core but packages like Iron Router and Flow Router were created to enable routing. Iron Router was designed for pre-Meteor 1.0 while Flow Router is designed for post-Meteor 1.0. It also compares routing approaches in other platforms like Rails, Django, and PHP. The document provides guidance on migrating from Iron Router to Flow Router and their differences in areas like subscriptions, route definitions, hooks, templates, and helpers.
3. One step back:
Meteor History
● designed for single page apps
● routing is not part of core
● no guidelines or best practices
4. Iron Router
● the community steps in
● designed for Meteor < 1.X
● one-stop-shop for multi page apps:
routing, subscriptions, rendering,
layout manager
https://github.com/iron-meteor/iron-router
5. Flow Router
● designed for Meteor > 1.X
● only routing!
● separate packages for rendering
etc.
https://github.com/kadirahq/flow-router
10. Old to the new: PHP
http://programmers.stackexchange.com/questions/122190/..
11. … is designed to emulate the familiar MVC
pattern of frameworks like Ruby on Rails …
MVC for Node? Meet sails.js
12.
13. ● Meteor is not the best
MVC platform (yet)
● client-side routing
● Model-View-Presenter
pattern
Think different
http://blog.nodejitsu.com/scaling-isomorphic-javascript-code/
15. Iron Router - waitOn
● easy to understand and implement
● it works (magic)
● subscriptions on the route level
● blocks rendering
http://iron-meteor.github.io/iron-router/#the-waiton-option
16.
17. Template Level Subscriptions
● the place to manage
subscriptions in Meteor > 1.X
● template lifetime ==
subscription lifetime
● templates are more reusable
19. Do I have to ...
● migrate my existing project to
FlowRouter?
● refactor a lot of code if I decide to
migrate?
● learn new concepts to use it?
● use FlowRouter for my next project?
no
yes
no
yes!
20. meteor add iron:router meteor add kadira:flow-router
meteor add kadira:blaze-layout
(meteor add kadira:react-layout)
How to get started