Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ember.js: An Antidote To Your Hype Fatigue

Ember.js: An Antidote To Your Hype Fatigue

Godfrey Chan

May 07, 2015
Tweet

More Decks by Godfrey Chan

Other Decks in Programming

Transcript

  1. Programmer to Thought Leader™ Professional Thought Leadership Angelina Fabbro, Sara

    Chipps, Gabe Scholz, Tom Dale, Horse JS, Allen Pike g g n n o o r r w w ™
  2. THE HYPE CYCLE PLATEAU OF PRODUCTIVITY SLOPE OF ENLIGHTENMENT TROUGH

    OF DISILLUSIONMENT TECHNOLOGY TRIGGER PEAK OF INFLATED EXPECTATIONS VISIBILITY MATURITY Ember in the Real World by Brandon Hays, Fluent Conf
  3. “HYPE” IS NOT AN INSULT, IT’S AN INEVITABILITY PLATEAU OF

    PRODUCTIVITY SLOPE OF ENLIGHTENMENT TROUGH OF DISILLUSIONMENT TECHNOLOGY TRIGGER PEAK OF INFLATED EXPECTATIONS VISIBILITY MATURITY Ember in the Real World by Brandon Hays, Fluent Conf
  4. MVC

  5. MVC

  6. [ [ MVC ]s + Router + Data Store ]

    + Testing + Build Tools
  7. [ [ MVC ]s + Router + Data Store ]

    + Testing + Build Tools + Deployment
  8. [ [ [ MVC ]s + Router + Data Store

    ] + Testing + Build Tools + Deployment ] + Ecosystem
  9. Relationships // app/models/post.js export default DS.Model.extend({ title: DS.attr(“string”), body: DS.attr(“string”),

    published: DS.attr(“date”), author: DS.belongsTo(“user”), comments: DS.hasMany(“comment”), });
  10. store.find(“post”); store.find(“post”, {q: “Rails”}); store.find(“post”, 1); store.filter(“post”, function(post) { ...

    }); store.createRecord(“post”, { title: “Rails is Omakase”, body: “...” }); Identity Store
  11. // app/adapters/application.js export default DS.RestAdapter.extend({ host: “https://...” }); // app/adapters/user.js

    export default FirebaseAdapter.extend({ firebase: “https://...” }); Data Sources
  12. % ember new test-app version: 0.2.3 installing create .bowerrc create

    .editorconfig create .ember-cli create .jshintrc create .travis.yml create Brocfile.js create README.md create app/app.js create app/components/.gitkeep create app/controllers/.gitkeep create app/helpers/.gitkeep create app/index.html ... Installed packages for tooling via npm. Installed browser packages via Bower. Successfully initialized git.
  13. % ember serve version: 0.2.3 Livereload server on port 35729

    Serving on http://localhost:4200/ Build successful - 3774ms. Slowest Trees | Total ----------------------------------------------+--------------------- Concat: Vendor | 3005ms Slowest Trees (cumulative) | Total (avg) ----------------------------------------------+--------------------- Concat: Vendor (1) | 3005ms Babel (2) | 231ms (115 ms)
  14. % ember generate resource post version: 0.2.3 installing create app/models/post.js

    installing create tests/unit/models/post-test.js installing create app/routes/post.js create app/templates/post.hbs installing create tests/unit/routes/post-test.js
  15. % ember generate resource post version: 0.2.3 installing create app/models/post.js

    installing create tests/unit/models/post-test.js installing create app/routes/post.js create app/templates/post.hbs installing create tests/unit/routes/post-test.js
  16. moduleForModel('post'); test('slug', function(assert) { var post = this.subject({ title: 'Rails

    is omakase' }); assert.equal(post.get('slug'), 'rails-is-omakase'); });
  17. moduleForComponent('delete-button'); test('delete confirmation', function(assert) { var component = this.subject({ text:

    'Delete post' }); component.$().click(); assert.equal(component.$().text(), 'Are you sure?'); });
  18. module('Acceptance: check out', { ... }); test('Express checkout', function(assert) {

    visit('/products/agile-web-development-with-rails'); click('#express-checkout'); fillIn('#login .username', 'godfrey'); fillIn('#login .secret', 'secret'); click('#login .submit'); andThen(function() { var confirmation = find('#notice h3').text(); assert.equal(confirmation, 'Thank you for your order'); }); });
  19. % ember test version: 0.2.3 Built project successfully. ok 1

    PhantomJS 1.9 - JSHint - .: app.js should pass jshint ok 2 PhantomJS 1.9 - JSHint - helpers: helpers/resolver.js should pass jshint ... ok 11 PhantomJS 1.9 - route:post: it exists 1..11 # tests 11 # pass 11 # fail 0 # ok
  20. Testing module('Acceptance: check out', { ... }); test('Express checkout', function(assert)

    { visit('/products/agile-web-development-with-rails') .then(function() { click('#express-checkout'); }) .then(function() { fillIn('#login .username', 'godfrey'); fillIn('#login .secret', 'secret'); }) .then(function() { click('#login .submit'); }) .then(function() { var confirmation = find('#notice h3').text(); assert.equal(confirmation, 'Thank you for your order'); }); });
  21. Synergy™ module('Acceptance: check out', { ... }); test('Express checkout', function(assert)

    { visit('/products/agile-web-development-with-rails'); click('#express-checkout'); fillIn('#login .username', 'godfrey'); fillIn('#login .secret', 'secret'); click('#login .submit'); andThen(function() { var confirmation = find('#notice h3').text(); assert.equal(confirmation, 'Thank you for your order'); }); });
  22. A directive that is restricted to element names with an

    isolated scope that uses transclusion.
  23. ES6 Modules // app/models/post.js import DS from “ember-data”; export default

    DS.Model.extend({ title: DS.attr(“string”), body: DS.attr(“string”), published: DS.attr(“date”), }); // test/unit/models/post-test.js import Post from 'test-app/models/post'; // ...
  24. // app/models/user.js import DS from 'ember-data'; import computed from 'ember-computed-decorators';

    export default DS.Model.extend({ firstName: DS.attr(“string”), lastName: DS.attr(“string”), @computed(“firstName”, “lastName”) fullName(firstName, lastName) { return `${ firstName } ${ lastName }`; } });
  25. // app/models/user.js import DS from 'ember-data'; import computed from 'ember-computed-decorators';

    export default DS.Model.extend({ firstName: DS.attr(“string”), lastName: DS.attr(“string”), @computed(“firstName”, “lastName”) fullName(firstName, lastName) { return `${ firstName } ${ lastName }`; } });
  26. May 1.11 1.12 Beta 3 Apr Mar Feb Jan Dec

    Nov Oct Sep Aug 1.10 1.12 Beta 2 1.12 Beta 1 1.11 Beta 5 1.11 Beta 4 1.11 Beta 3 Canary Beta Release 1.11 Beta 2 1.11 Beta 1 1.10 Beta 4 1.10 Beta 3 1.10 Beta 2 1.10 Beta 1 1.9 1.9 Beta 4 1.9 Beta 3 1.9 Beta 1 1.8 1.8 Beta 5 1.8 Beta 4 1.8 Beta 3 1.8 Beta 2 1.8 Beta 1 1.7 1.7 Beta 5 1.7 Beta 4 Bound Attributes HTML Bars Glimmer Block Params Injected Properties New CP Syntax {{component}} Streams Handlebars 2.0 Metamorph 2015
  27. May 1.11 1.12 Beta 3 Apr Mar Feb Jan Dec

    Nov Oct Sep Aug 1.10 1.12 Beta 2 1.12 Beta 1 1.11 Beta 5 1.11 Beta 4 1.11 Beta 3 Canary Beta Release 1.11 Beta 2 1.11 Beta 1 1.10 Beta 4 1.10 Beta 3 1.10 Beta 2 1.10 Beta 1 1.9 1.9 Beta 4 1.9 Beta 3 1.9 Beta 1 1.8 1.8 Beta 5 1.8 Beta 4 1.8 Beta 3 1.8 Beta 2 1.8 Beta 1 1.7 1.7 Beta 5 1.7 Beta 4 Bound Attributes HTML Bars Glimmer Block Params Injected Properties New CP Syntax {{component}} Streams Handlebars 2.0 Metamorph 2015
  28. Notable Features Shipped During 1.x 1.2 Router loading/error substates 1.3

    Router auto location 1.6 ES6-ify Ember internals 1.7 Query params, nestable routes 1.8 Remove metamorph <script> tags 1.9 Handlebars 2.0, Streams 1.10 HTMLBars, {{else if}}, block params 1.11 Bound attributes
  29. Notable Features Shipped During 1.x 1.2 Router loading/error substates 1.3

    Router auto location 1.6 ES6-ify Ember internals 1.7 Query params, nestable routes 1.8 Remove metamorph <script> tags 1.9 Handlebars 2.0, Streams 1.10 HTMLBars, {{else if}}, block params 1.11 Bound attributes
  30. Notable Features Shipped During 1.x 1.2 Router loading/error substates 1.3

    Router auto location 1.6 ES6-ify Ember internals 1.7 Query params, nestable routes 1.8 Remove metamorph <script> tags 1.9 Handlebars 2.0, Streams 1.10 HTMLBars, {{else if}}, block params 1.11 Bound attributes 1.12 ??? 1.13? Glimmer
  31. Notable Features Shipped During 1.x 1.2 Router loading/error substates 1.3

    Router auto location 1.6 ES6-ify Ember internals 1.7 Query params, nestable routes 1.8 Remove metamorph <script> tags 1.9 Handlebars 2.0, Streams 1.10 HTMLBars, {{else if}}, block params 1.11 Bound attributes 1.12 ??? 1.13? Glimmer, One-way binding
  32. Notable Features Shipped During 1.x 1.2 Router loading/error substates 1.3

    Router auto location 1.6 ES6-ify Ember internals 1.7 Query params, nestable routes 1.8 Remove metamorph <script> tags 1.9 Handlebars 2.0, Streams 1.10 HTMLBars, {{else if}}, block params 1.11 Bound attributes 1.12 ??? 1.13? Glimmer, One-way binding, Routable components, <... />, ...
  33. Notable Features Shipped During 1.x 1.2 Router loading/error substates 1.3

    Router auto location 1.6 ES6-ify Ember internals 1.7 Query params, nestable routes 1.8 Remove metamorph <script> tags 1.9 Handlebars 2.0, Streams 1.10 HTMLBars, {{else if}}, block params 1.11 Bound attributes 1.12 ??? 1.13? Glimmer, One-way binding, Routable components, <... />, ...
  34. THE HYPE CYCLE PLATEAU OF PRODUCTIVITY SLOPE OF ENLIGHTENMENT TROUGH

    OF DISILLUSIONMENT TECHNOLOGY TRIGGER PEAK OF INFLATED EXPECTATIONS VISIBILITY MATURITY Ember in the Real World by Brandon Hays, Fluent Conf