Upgrading minitrello from 0.x to Meteor 1.x
Minitrello is a small meteor demo app which I’ve built for fun several time ago, since is the most stared repo from all my github repos so I think it worthwhile give some attention to it and close issues, so migrating minitrello to 1.x is one of them.
See the full diff version: diff
After upgrading Meteor to 1.1.0.2 and trying to start the app won’t work.
$ meteor
Problem! This project does not have a .meteor/release file. The file should either contain the
release of Meteor that you want to use, or the word 'none' if you will only use the project with
unreleased checkouts of Meteor. Please edit the .meteor/release file in the project and change it
to a valid Meteor release or 'none'.
To fix the previos error:
$ touch .meteor/release
See: https://github.com/meteor/meteor/releases for choosing the release you want to use, then edit .meteor/release
file add the release and save:
METEOR@1.1.0.2
Next, since minitrello is using Mongo
I had to replace Meteor.Collection
for Mongo.Collection
and add one dependency more:
meteor add meteor-platform
Now it is back working:
$ meteor
[[[[[ ~/Projects/minitrello ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
App is back running but it still won’t work, some Meteor API’s syntax changed so I have to update the following:
Meteor.is_client
to Meteor.isClient
Meteor.is_server
to Meteor.isServer
When trying to insert new document to a collection won’t work, the error given to the browser console:
insert failed: Access denied
Meteor now provides an API for define writing permissions over collections:
See: http://docs.meteor.com/#/basic/Mongo-Collection-allow
To fix the access denied
error:
BoardCollection.allow({
'insert': function() {
return true;
}
});
Other API that had changed is helpers, next the error:
W20150418-11:35:09.514(-5) (blaze.js:71) Warning: Assigning helper with `Template.board.todos = ...` is deprecated. Use `Template.board.helpers(...)` instead.
Previous version:
Template.board.todos = function() {
}
Solution:
Template.board.helpers({
todos: function() {
}
});