METEOR.JS
8th August 2012 - Codeaholics.hk
@MatthewRudy
Slide 2
Slide 2 text
SOLR TAKEDA HOLMES
Slide 3
Slide 3 text
METEOR
a javascript full stack framework
compiles, combines, and distributes your JS,
CSS, and HTML
deploys on the fly to users without
interrupting their session
Slide 4
Slide 4 text
LEARN ABOUT IT
http://docs.meteor.com
https://github.com/siuying/todomvc-meteor
`meteor create --example leaderboard`
Slide 5
Slide 5 text
7 PRINCIPLES
marketing-style
Slide 6
Slide 6 text
#1 DATA ON THE WIRE
no HTML rendered on the server
JSON sent to the browser
the browser renders templates
Slide 7
Slide 7 text
#2 ONE LANGUAGE
All code is Javascript
(or maybe coffeescript)
Slide 8
Slide 8 text
#3 DATABASE EVERYWHERE
Client Data API mirrors the Server Database
API
the local data API looks just like Mongo
Slide 9
Slide 9 text
#4 LATENCY
COMPENSATION
All data operations take place in memory
first
The callback to the server is asynchronous
What happens if it fails?
Slide 10
Slide 10 text
#5 FULL STACK
REACTIVITY
Every thing has a callback
Templates re-render themselves
automatically
Slide 11
Slide 11 text
#6 EMBRACE THE
ECOSYSTEM
Plug and Play
Use Backbone or whatever
Slide 12
Slide 12 text
#7 SIMPLICITY =
PRODUCTIVITY
Clean and Simple APIs
Item = new Meteor.collection “items”
if Meteor.is_client
Session.set(“selected”, null)
if Meteor.is_server
Secret = 123
CLIENT + SERVER
IN THE SAME FILE
Slide 23
Slide 23 text
CLIENT + SERVER
IN FOLDERS
client/some.js
server/some.js
shared.js
Slide 24
Slide 24 text
PACKAGES
Backbone - Backbone on Client + Server
Bootstrap - Adds the Bootstrap CSS
Coffeescript - Compiles .coffee files
Handlebars - the default templating system
Slide 25
Slide 25 text
PACKAGES (AUTH)
accounts - central API for accounts
accounts-ui - log in and sign up
accounts-facebook - plug into facebook
accounts-weibo - plug into weibo
insecure - remove!
Slide 26
Slide 26 text
HTML CONCATENATION
The header
Slide 27
Slide 27 text
TIME FOR A PLAY
Live demo!
Slide 28
Slide 28 text
meteor create --example leaderboard
Slide 29
Slide 29 text
PROBLEMS
there are quite a few
Slide 30
Slide 30 text
COMPLEXITY
going beyond the basics
things quickly get complex
Slide 31
Slide 31 text
NO NAMESPACE FOR
TEMPLATES
item_form
item_list
item_show
content
sidebar
nav
Slide 32
Slide 32 text
AUTHENTICATION
there is an “auth” branch
but its hard to use
Slide 33
Slide 33 text
BETTER TOOLS
MRT is a good idea
but frequently breaks for me
Slide 34
Slide 34 text
BETTER DEBUG
Coffee -> JS
many JS files -> one JS file
=> Big confusion
Slide 35
Slide 35 text
ROUTING
Just use Backbone.Router?
Slide 36
Slide 36 text
TESTING?
An afterthought
Slide 37
Slide 37 text
BUT...
Slide 38
Slide 38 text
ITS COOL
Stuff magically works
Slide 39
Slide 39 text
THE FUTURE
It’s awesome as a deployment tool
Better integration with Backbone and Angular