Meteor Tips

Based upon student experience, here are some suggestions for better managing your Meteor experience.

Install handlebars and meteor plugins

Meteor development is so much easier when IntelliJ understands Meteor code. I recommend you install two plugins: Handlebars/Mustache and Meteor.

Go to Preferences > Plugins, and click “Browse repositories”. Then search for “Handlebars” and you should find a plugin named “Handlebars/Mustache”. Install that plugin, which will require a restart. Then do the same to install the Meteor plugin.

Tip: install the Meteor and Handlebars plugins.

Meteor should be slow to start, but quick to refresh

When you invoke meteor to run your application, you can expect to sometimes wait up to a minute or more regardless of your platform or machine specifications. The long time for initial build of a Meteor application is frustrating, but as of Meteor 1.4, it is “normal”.

On the other hand, once Meteor has built the application (i.e. the console prints out the message that you can retrieve the application at localhost:3000), then the “refresh” process upon changes to your code should happen quickly, say within 10 seconds. If refresh is slow, then there is an issue with your environment to investigate.

The Meteor Development Group has indicated that improving initial build time is a priority for an upcoming release.

Tip: Don’t worry about slow startup times. Do worry if refresh times are slow.

Do not switch branches while Meteor is running

If you switch branches while Meteor is running, you are essentially changing the database and application files out from under the running Meteor process, which will generally lead to strange application behavior.

The safest approach to switch branches during Meteor development is to:

  1. Stop the running Meteor application with control-c.
  2. Switch branches.
  3. Invoke ‘meteor reset’ in the new branch.
  4. Re-start meteor.

Tip: Restart meteor when switching branches.

Disable Meteor background downloading

One reason Meteor can be unpredictably slow is because, by default, it checks for updates and downloads them automatically as part of the build process.

Fortunately, you can disable this behavior for a given run of Meteor via a command-line argument:

$ meteor --no-release-check

If you want to disable the behavior globally, then you can set an environment variable:

METEOR_NO_RELEASE_CHECK=1

Note that although Meteor downloads updates in the background, it doesn’t install them into your applications. For each application, you must manually install any updates using the command:

$ meteor update

Tip: disable background downloads and do not update Meteor during this class unless I request that you do.

Ignore “pure-Javascript implementation of bcrypt” warning

You may see a warning similar to this when starting up Meteor:

W20160830-11:50:40.866(-4)? (STDERR) Note: you are using a pure-JavaScript implementation of bcrypt.
W20160830-11:50:40.868(-4)? (STDERR) While this implementation will work correctly, it is known to be
W20160830-11:50:40.868(-4)? (STDERR) approximately three times slower than the native implementation.
W20160830-11:50:40.868(-4)? (STDERR) In order to use the native implementation instead, run
W20160830-11:50:40.869(-4)? (STDERR)          
W20160830-11:50:40.869(-4)? (STDERR)   meteor npm install --save bcrypt
W20160830-11:50:40.869(-4)? (STDERR)          
W20160830-11:50:40.870(-4)? (STDERR) in the root directory of your application.

bcrypt is a password-hashing algorithm used during authentication. Since logins are a low frequency event for your applications in this class, there is no real performance impact of a pure-Javascript implementation. In addition, on Windows, attempting to install the native implementation of bcrypt can be time-consuming and error-prone.

Tip: A pure-Javascript bcrypt won’t hurt you.

Consider Ubuntu on Windows (for Windows users)

Windows 10 provides a native Linux environment called Ubuntu on Windows. If you are having problems getting Meteor to run on your Windows machine, consider running it in this environment. Note that you may want to install git and IntelliJ as well as Meteor so that you can do all development in this environment.

Tip: if you are struggling to do Meteor development on Windows, consider Ubuntu on Windows.