My personal experience with Meteor
Created by Thomas Allmer / @daKmoR
I'm coming from the classical Client/Server World
php, mysql, with js only on the client
This is just my personal experience with Meteor
I don't have any online projects - it's just me playing around :p
Just some Items with a name rendered in a list
step1
Meteor.publish('items-public', function () {
return Items.find({public: true});
});
Publishes only Items which are marked public
Will be pushed to all subscribed Clients
The Client has to subscribe to some published DATA and can then query this subset.
Meteor.subscribe('items-public');
Template.root.items = function() {
return Items.find({});
};
Will only return all DATA available to the Client
Will most likely return something different then if the same query would be executed on the Server
If you subscribe to another published DATA set your current local cache might get updated and new things will be displayed.
Reactivity for the win! :)
step2
installed by default remove on the console with
$ meteor remove autopublish
Basically published ALL DATA on the Server and subscribes to EVERYTHING on the client
executes something like this for EVERY Meteor Collection
// server js
Meteor.publish('items-all', function () {
return Items.find({});
});
// client js
Meteor.subscribe('items-all');
GREAT for prototyping, but no good for a real application
installed by default remove on the console with
$ meteor remove insecure
Basically allows ALL Database actions to be executed on the client as well.
executes something like this for EVERY Meteor Collection
Items.allow({
insert: function() {
return true;
},
update: function() {
return true;
},
remove: function() {
return true;
}
});
GREAT for prototyping, but no good for a real application
step3
Session "Variables" are reactive, so every change will trigger a rerendering of every affected DATA
Reactivity for the win! :)
Can easily be used for subscribing to DATA, detail lightboxes, themes...
step4
"They say Meteor UI [AKA Blaze, the new Meteor rendering engine] is in preview, but it just works fine for us. It just works."
— Manuel Timita
Some sort of more complex Play Around Thingi
Generic jquery code can be used due to the new Engine