25
SPAs Redux: Snappy, Performant Apps (with Ember.js) Anthony Bull Sr. Web Engineer, CrowdFlower SFHTML5 Meetup, January 31, 2013 1

Ember.js for SFHTML5

Embed Size (px)

DESCRIPTION

Slide deck for January 31, 2013 presentation; overview of v1.0.0.-pre.4 and comparison with other frameworks.

Citation preview

Page 1: Ember.js for SFHTML5

SPAs Redux:Snappy, Performant Apps (with Ember.js)

Anthony BullSr. Web Engineer, CrowdFlowerSFHTML5 Meetup, January 31, 2013

1

Page 2: Ember.js for SFHTML5

Ember.js 1.0.0-pre.4

Latest

2

Page 3: Ember.js for SFHTML5

Ember.js MVC != server-side MVC

3

Page 4: Ember.js for SFHTML5

Ember.js provides the best balance of trade-offs of any (JS) MVC framework when it comes to

building clean, well-factored client-side web apps.

tl;dr

4

Page 5: Ember.js for SFHTML5

2001

JavaScript

2006

Prototype/script.aculo.us

2007

-201

0

YUI

2010

-201

1

Prototype/jQuery

early

201

2To

day

mid 2

012

History of JS MVCs/SPAs/F2E*

* a somewhat-biased account

5

Page 6: Ember.js for SFHTML5

Approach DIYerconvention over

configurationHTML for apps,

not pages

Top Pro flexibilityless code = more

productivecorporate-backing

Top Con re-create the wheel ramp up != trivial verbosity

If I took you on a camping trip... knife/spoon/fork swiss-army knife spork

Framework Comparisons

6

Page 7: Ember.js for SFHTML5

Hello World!

7

Page 8: Ember.js for SFHTML5

<script type="text/x-handlebars" data-template-name="application"> Hello, <strong>{{userName}}</strong>!</script>

A Template

8

Page 9: Ember.js for SFHTML5

var view = Ember.View.create({ templateName: 'application'});

A View

9

Page 10: Ember.js for SFHTML5

App.ApplicationController = Ember.Controller.extend();

A Controller

10

Page 11: Ember.js for SFHTML5

App.ApplicationRoute = Ember.Route.extend({ setupController: function(controller,user) { controller.set(‘content’, App.user); }})

A Route

11

Page 12: Ember.js for SFHTML5

App.user = Ember.Object.create({ name: 'World!'});

An Object

12

Page 13: Ember.js for SFHTML5

App = Ember.Application.create();

App.user = Ember.Object.create({ name: 'World!'});

var view = Ember.View.extend({ templateName: 'application'});

App.ApplicationRoute = Ember.Route.extend({ setupController: function(controller, user){ controller.set('content', App.user); }});

An App

13

Page 14: Ember.js for SFHTML5

sonific8tr

http://github.com/inkredabull/sonific8tr

14

Page 15: Ember.js for SFHTML5

Naming (Very Important!!!)*

Template

View

Controller

Router

Model

stationsApp.StationsController

App.StationViewthis.resource('stations')

App.StationsRoute

App.Station

* convention over configuration

15

Page 16: Ember.js for SFHTML5

• You should do it

• QUnit

• Selenium (Lebowski gem?)

• Capybara

• PhantomJS/poltergeist

Testing

16

Page 18: Ember.js for SFHTML5

• Pedigree (SproutCore, jQuery, Merb, Rails)

• Community (tremendous growth in last year)

• Stability (state mgt./data sync/conventions/docs)

tl;dr - II

18

Page 19: Ember.js for SFHTML5

My job!

Jobs!!!

19

Page 20: Ember.js for SFHTML5

•We’re hiring! (Ember.js/Rails)

• Ski trip!

20

Page 21: Ember.js for SFHTML5

Thanks!

Kariem Hussein, ExabitAlexander Sorokin

Mars HallCVP & Engr at CrowdFlower

Tatiana Josephy

Contact me at: [email protected]

@inkredabull

Tom Dale @tomdaleYehuda Katz @wycats

Peter Wagenet @wagenetTilde @tildeio

Jakub Arnold @darthdeusTrek Glowacki @trek

Clemens Müller @pangratzAndy Matthews @commadelimited

21

Page 22: Ember.js for SFHTML5

More...

22

Page 23: Ember.js for SFHTML5

Toda

y20

07

SproutCoreSproutcore 2

Amber.js / Ember.js

Dec 2

011

May

201

1

0.9.6

0.9.8

1.0.0-pre.1

2008

Apple (MobileMe & iCloud.com)

* http://www.cerebris.com/blog/2012/01/20/warming-up-to-ember-js/http://en.wikipedia.org/wiki/SproutCore

1.0.0-pre.4

1.0.0-pre.2

1.0.0-pre.3

RC 1.0

Coming

History of Ember.js

23

Page 24: Ember.js for SFHTML5

Who’s using Ember.js?

24

Page 25: Ember.js for SFHTML5

Who’s behind Ember.js?

Tom Dale Yehuda Katz

25