Tag Archives: Meteor

Javascript Namespaces in Meteor

I’ve just been watching this excellent EventedMind presentation to get my head around routing for Meteor. I’ve realized that a better way to manage my code (particularly for subscriptions) is to harness the power of javascript namespaces. For example

Subscriptions = {
posts: Meteor.subscribe('posts')

Just keeps everything much cleaner, and prevents quite likely name conflicts. I think I’ll be using this from now on in the ongoing Fixer’s Dream development!

Meteor App Liveblog (Entry 5)

So we’re into the last few hours and sadly haven’t quite got as far as I hoped. But… we have got a very simple prototype up, allowing you to add people to the database. The next couple of hours will probably involve

  • providing full info in popovers
  • including a delete functionality
  • implementing a login (and proper security)
  • adding the “concerts” page

What have I learnt in the last few hours? Here are the highlights

  • Stylus is awesome. Use it.
  • Don’t try to use form tags. It’s not worth the trouble.
  • You can (and should) split up your client, server and public files into so-named directories. See the parties example. Goodness knows why this isn’t the default directory structure!
  • The hr tag is useful for splitting up sections

Hope some of that’s useful! If you want to check out the prototype as it develops, bookmark http://fixersdream.meteor.com/.

Meteor App Liveblog (Entry 4)

Oh dear! We really aren’t going very fast. I blame the need to get familiar with MongoDB. I’ve taken a bit of time to find a decent GUI to visualize what’s going on. Okay – I know this isn’t strictly necessary. But for a first time Meteor user like me it’s quite nice. Here’s my recommendations

  • Grab a copy of GenghisApp. It seems to start natively at IP address
  • Add the mongo database. You can find the correct URI by typing meteor mongo in your app directory
  • Tada! You’ll now be able to navigate around (and add/change) your collections.

Time to get some logic going, and basic Bootstrap styling. Once that’s in place I’ll put the current progress onto the .meteor.com servers so you can follow along.

Meteor App Liveblog (Entry 2)

So I’ve got meteor installed and the app created. But it wasn’t quite as plain sailing as the docs make it seem. Here’s some tips

  • you might need to add/usr/local/bin to your $PATH if it isn’t there already
  • the simplest way of shoehorning in Coffeescript seems to be adding the package with meteor add then changing the js file to a .coffee one and altering the syntax.
  • It annoys me that meteor doesn’t timestamp things in bash. So use this instead
    meteor | gawk '{ print strftime("%H:%M:%S"), $0; fflush(); }'

Also Bootstrap is installed nicely. Though it seems I might need a custom package for more control over which JS files get included. I’ll probably get to play around with the unofficial Meteorite package manager later.

So. On with the coding!

Meteor App Liveblog (Entry 1)

Today I’ve got something a little different. I’ll be creating a Meteor app in 12 hours. The aim is to produce an “Orchestral Fixer’s Dream”. What’s that exactly? Well it comprises

  • a database of musicians
  • functionality for adding/changing musicians
  • a database of concerts
  • functionality for adding/changing concerts
  • mailing feature to automatically email appropriate musicians

I’m planning to use Twitter Bootstrap to ensure mobile device compatibility, and possibly some Angular if that’s necessary. For flexibility, I could have chosen the MEAN stack with Breeze instead of Meteor. But I reckon the config would have made my timescale impossible!

Wish me luck if you are following along!