16. Example: Underscore.js
var posts = [{
id: 1,
title: 'JavaScript is cool'
}, {
id: 2,
title: 'The Web is the platform'
}];
_.pluck(posts, 'title');
// ['JavaScript is cool', 'The Web is the platform']
25. Example: Handlebars.js
var template =
'<ul>'
'{{#each posts}}'
' <li>{{title}}</li>'
'{{/each}}'
'</ul>'
;
var templateFn = Handlebars.compile(template)
, html = templateFn({posts: posts});
// <ul>
//
<li>JavaScript is cool</li>
//
<li>The Web is the platform</li>
// </ul>
26. Shimmed per environment
Provides shims for accessing
environment-specific properties so
module can expose a single API.
window.location.pathname
vs.
req.path
40. Mojito
One of the first isomorphic
frameworks.
•
•
•
•
Released by Yahoo! a few years ago.
Full-stack framework; YUI components.
Super-advanced deferred rendering.
Never caught on.
41. Meteor
Awesome framework for building
real-time apps.
• Full web application framework; has own
•
•
•
•
build system and package manager.
Realtime from the ground up.
Requires MongoDB (or adapter).
No server-side rendering (yet).
All-star dev team.
42. Rendr
Library for isomorphic Backbone.js
+ Handlebars.js.
•
•
•
•
Render your Backbone apps on the server.
Open-sourced by Airbnb.
Less opinionated than the big frameworks.
Came out of m.airbnb.com.
44. Browserif
Package up CommonJS modules for
the browser.
Use ‘require()’ in the browser, the
same way you would on the server.
Bundles a module and all its
dependencies.
64. Create a new post
New page at /posts/new
Form for post data
On submit, POST to the API.
Use JavaScript to intercept the
submit event and POST via XHR.
66. Markdown formatting
Using Showdown.js.
Swap out templating
Jade, EJS, Underscore, React.js.
Add UI librar
Backbone.js, Angular.js.
Make it pretty
Bootstrap that shit. Responsive?