
You can then extend the App object in the client and server directories with client- or server-specific methods and properties as required. Whilst throwing things into the global namespace has its drawbacks, until Meteor has some kind of module system, this is by far the best way to avoid repeating yourself or building apps with enormous individual. app.js), to which you can attach isomorphic methods or properties that can be accessed on either client or server. It’s also sensible to create a global app object (probably called App) within the lib directory root (eg. On the client side, the structure probably depends to some extent on the rendering engine you’re using. Plus, this allows you to have mup configs, multiple settings files and other assets sensibly organised without polluting your Meteor directory. meteorignore file or similar means that if you’re ever likely to end up with things that you don’t want to include, it’s nice to have sibling directories in your repo in which to put them. js within the Meteor project directory in app bundles makes life very easy, but the lack of a. Put the Meteor app itself in a subdirectory of the project root Meteor’s propensity to include everything.
#Tableflip informatuon technology code#
The result is a small increase in required boilerplate code in the short term, but the ability to “opt-in” to reactivity where and when it is required at the template level, rather than having entire sections of pages re-render redundantly. Simply put, if your URL changes in Flow Router, then a new route will be run, if it doesn’t then your router will do nothing. It is inherently reactive in that the vast majority of its hooks/callbacks will rerun when any of the data they reference changes whilst this is great in a small project as it saves you building your own autorun blocks, the lack of control over this reactivity can leave larger apps re-rendering parts of the page far more frequently than necessary, leading to poor app performance, and potentially more serious issues like infinite-invalidation loops and inadvertently stopped computations.Īs a result, we recommend MeteorHacks Flow Router, due to its emphasis on keeping reactivity at a template level and out of route functions.

Which Router?Įvented Mind’s Iron Router has been around for a long time and done a great deal to inform Meteor project structure in a positive way. None of this is gospel - it works for us, it may work for you. A list of best practices learnt from 2 years building large-scale JavaScript apps in Meteor.
