MeteorJS

Aus Peter Fuerholz' Wiki
Zur Navigation springen Zur Suche springen

First steps

Important modules

Look up available modules under AtmosphereJS.

react
React.JS for MeteorJS
cosmos:browserify
Allows to use Browserify in MeteorJS (?)
meteorhacks:npm
Allows to install NPM modules in MeteorJS
externalify
This module is used to avoid having ReactJS included twice: Once from MeteorJs and once via npm. See here (other ReactJS in MeteorJS tutorial) and here (Contains information about the specific files app.browserify.js / app.browserify.options.json.)
anback:bootstrap-validator
HTML5 introduced form input validation. Nevertheless this specification stops where it comes to the user interface or is browser specific. At the other side bootstrap introduces visually-appalling CSS classes for showing errors or warnings. Bootrap-validator brings both sides together. The package linked here is this package brought to Meteor. Here you find help how to use Bootstrap-Validator.

Implementing tests

See here:

  • Install:
 meteor add sanjo:jasmine
 meteor add velocity:html-reporter
  • Implement your tests under the test directory tests/jasmine/:
client / integration tests
client/integration
client / unit tests
client/unit
server / integration tests
server/integration
server / unit tests
server/unit

Introduction into Jasmine. You can disable the test types above by setting following environment variables to 0: See startMeteor script within MeteorReactReduxTemplate-project. Install PhantomJS to have 'Karma'-window (2nd browser window) disappear.

Using CSS

If you use npm packages therein contained CSS files (and other artifacts) do not get imported as well. As a solution you can put them (respective create sym link) into the /client/stylesheets directory, see here and here.


Tipps and Tricks

Update to Meteor 1.4

Meteor updated with meteor update Unfortunately I got problems with my old Mongo-DB installation. Since I still use a 32 bit Ubuntu (14.04) I got some problems to bring it to run again. Here is what I've done:

  • download latest Mongo-DB from here. Unzipped it and replaced the binaries in /usr/bin. As I've found out this update is necessary only at the border due to the fact that Meteor provides its own MongoDB binaries. They are placed under /home/pfu/.meteor/packages/meteor-tool/.1.4.0.11hm2yf++os.linux.x86_32+web.browser+web.cordova/mt-os.linux.x86_32/dev_bundle/mongodb/bin.
  • Deleted the database with meteor reset. (You will loose all data!) Afterwards I was not able to start meteor again. To create a new database I had to call mongod --storageEngine=mmapv1 --dbpath ./.meteor/local/db. (The storageEngine 'wiredTiger' seems not to be supported on the 32 bit.)
  • Now I was able to start meteor again.

Upstart problems

  • If you cannot upstart MeteorJS due to a MongoDB locking problem delete following file: <project dir>/.meteor/local/db/meteordb.lock