Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Meteor.js
Search
Matthew Rudy Jacobs
August 08, 2012
Technology
3
1.8k
Meteor.js
My talk given at Codeaholics.hk on Wednesday 8th August 2012.
Matthew Rudy Jacobs
August 08, 2012
Tweet
Share
More Decks by Matthew Rudy Jacobs
See All by Matthew Rudy Jacobs
From Developer to Architect (and back again)
matthewrudy
3
230
Humans are Hard
matthewrudy
0
140
[Alpha] Humans Are Hard
matthewrudy
0
100
From Developer To Architect
matthewrudy
0
90
Git Commit Signing: Code we can trust?
matthewrudy
0
180
We Need To Talk About Postgres
matthewrudy
0
95
Coding as a Team At GoGoVan
matthewrudy
3
440
10 Years of Code
matthewrudy
0
110
Elixir - Part 1
matthewrudy
1
200
Other Decks in Technology
See All in Technology
Kiro を用いたペアプロのススメ
taikis
4
1.8k
"人"が頑張るAI駆動開発
yokomachi
1
510
LayerX QA Night#1
koyaman2
0
260
AWSインフルエンサーへの道 / load of AWS Influencer
whisaiyo
0
220
子育てで想像してなかった「見えないダメージ」 / Unforeseen "hidden burdens" of raising children.
pauli
2
330
Amazon Bedrock Knowledge Bases × メタデータ活用で実現する検証可能な RAG 設計
tomoaki25
6
2.4k
100以上の新規コネクタ提供を可能にしたアーキテクチャ
ooyukioo
0
260
Amazon Quick Suite で始める手軽な AI エージェント
shimy
1
1.9k
通勤手当申請チェックエージェント開発のリアル
whisaiyo
3
470
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.7k
業務の煩悩を祓うAI活用術108選 / AI 108 Usages
smartbank
9
11k
AI駆動開発ライフサイクル(AI-DLC)の始め方
ryansbcho79
0
190
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Mobile First: as difficult as doing things right
swwweet
225
10k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
410
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.4k
How GitHub (no longer) Works
holman
316
140k
Facilitating Awesome Meetings
lara
57
6.7k
Navigating Weather and Climate Data
rabernat
0
53
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
200
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Discover your Explorer Soul
emna__ayadi
2
1k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Transcript
METEOR.JS 8th August 2012 - Codeaholics.hk @MatthewRudy
SOLR TAKEDA HOLMES
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
LEARN ABOUT IT http://docs.meteor.com https://github.com/siuying/todomvc-meteor `meteor create --example leaderboard`
7 PRINCIPLES marketing-style
#1 DATA ON THE WIRE no HTML rendered on the
server JSON sent to the browser the browser renders templates
#2 ONE LANGUAGE All code is Javascript (or maybe coffeescript)
#3 DATABASE EVERYWHERE Client Data API mirrors the Server Database
API the local data API looks just like Mongo
#4 LATENCY COMPENSATION All data operations take place in memory
first The callback to the server is asynchronous What happens if it fails?
#5 FULL STACK REACTIVITY Every thing has a callback Templates
re-render themselves automatically
#6 EMBRACE THE ECOSYSTEM Plug and Play Use Backbone or
whatever
#7 SIMPLICITY = PRODUCTIVITY Clean and Simple APIs
WHAT’S THE REAL DEAL?
COLLECTIONS # define Items = new Meteor.Collection “items” # insert
Items.insert {name: “giraffe”} # find Items.find {}, {sort: {name: 1}}
SESSIONS # get Session.get(“selected”) #set Session.set(“selected”, item._id) # check Session.equals(“selected”,
this._id)
HANDLEBARS <template name=”list”> <h1>Items</h1> <ul> {{#each items}} <li>{{> item }}</li>
{{/each}} </ul> </template>
TEMPLATES They automatically re-render when data changes!
TEMPLATES # {{> item }} <template name=”item”> <article class=”item”> {{name}}
</article> </template>
HELPERS {{#if selected}}selected{{/if}} Template.item.selected = -> Session.equals(“selected”, this._id)
{{pluralize itemCount “item” “items”}} Template.list.itemCount = -> Items.find({}).count() Template.list.pluralize =
(n, s, p) -> “#{n} #{if n == 1 then s else p}” HELPERS WITH ARGUMENTS
EVENTS Template.item.events = “click article”: -> Session.set(“selected”, this._id)
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
CLIENT + SERVER IN FOLDERS client/some.js server/some.js shared.js
PACKAGES Backbone - Backbone on Client + Server Bootstrap -
Adds the Bootstrap CSS Coffeescript - Compiles .coffee files Handlebars - the default templating system
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!
HTML CONCATENATION <body> <h1>The header</h1> </body> <body> <nav class=”navbar navbar-fixed-top”
/> </body>
TIME FOR A PLAY Live demo!
meteor create --example leaderboard
PROBLEMS there are quite a few
COMPLEXITY going beyond the basics things quickly get complex
NO NAMESPACE FOR TEMPLATES item_form item_list item_show content sidebar nav
AUTHENTICATION there is an “auth” branch but its hard to
use
BETTER TOOLS MRT is a good idea but frequently breaks
for me
BETTER DEBUG Coffee -> JS many JS files -> one
JS file => Big confusion
ROUTING Just use Backbone.Router?
TESTING? An afterthought
BUT...
ITS COOL Stuff magically works
THE FUTURE It’s awesome as a deployment tool Better integration
with Backbone and Angular
THANKS Any Questions?