26
@leojh Developing Single Page Applications with Ember.js (or, How to Treat JavaScript Fatigue)

Developing Single Page Apps with Ember.js

Embed Size (px)

Citation preview

Page 1: Developing Single Page Apps with Ember.js

@leojh

Developing Single Page Applications with Ember.js

(or, How to Treat JavaScript Fatigue)

Page 2: Developing Single Page Apps with Ember.js

Leo HernandezDeveloper @ NinjaMSP

South FloridaJavaScript through Ember & React

@leojh

Page 3: Developing Single Page Apps with Ember.js

2015 … the year of JavaScript fatigue

@leojh

Page 4: Developing Single Page Apps with Ember.js

“mfw when I see everyone complaining about JavaScript tooling and micro

libraries”-- @trek on Dec 29th, 2015

@leojh

Page 5: Developing Single Page Apps with Ember.js

Just some of the contributors of JavaScript fatigueAngular, React

… new frameworks every

week

ES6/ES2015

… new standards coming out

all the time

Babel

WebPack, Browserfy

Bower, NPM

Node

Gulp and Grunt

… AND more

@leojh

Page 6: Developing Single Page Apps with Ember.js

It’s seemingly impossible to keep up

@leojh

Page 7: Developing Single Page Apps with Ember.js

Add to that, configuring all these things together

@leojh

Page 8: Developing Single Page Apps with Ember.js

1. Open your editor2. Make a folder3. Create a Git repo4. Configure Node5. Chose a Package Manager6. Configure your build7. Tie in Babel for ES6+8. Keep configuring9. …

10. Hopefully run your app sometime @leojh

Page 9: Developing Single Page Apps with Ember.js

Ember Offers an Alternative

@leojh

Page 10: Developing Single Page Apps with Ember.js

Ember is convention based

The Community picks the conventions

@leojh

Page 11: Developing Single Page Apps with Ember.js

Ember is provides an integrated application framework plus a build, and

development environment

@leojh

Page 12: Developing Single Page Apps with Ember.js

1. npm install -g ember-cli2. ember new my-app3. cd my-app4. npm install && bower install5. ember s

@leojh

Page 13: Developing Single Page Apps with Ember.js

That’s it… you’re coding

@leojh

Page 14: Developing Single Page Apps with Ember.js

All the build and configuration is done for you …

Integrated build, minification, source maps, environment variables …

@leojh

Page 15: Developing Single Page Apps with Ember.js

Ember has a few major concepts to know about ...

@leojh

Page 16: Developing Single Page Apps with Ember.js

ember-cli

Used to run commands on ember used for development

Run the serverRun your tests

Generate artifacts@leojh

Page 17: Developing Single Page Apps with Ember.js

Router

Defines your URLs

@leojh

Page 18: Developing Single Page Apps with Ember.js

Routes

Fetches and serves dataPlace for View Logic

@leojh

Page 19: Developing Single Page Apps with Ember.js

Models

Specify your DataPlace for Data Logic

Mutates Data

@leojh

Page 20: Developing Single Page Apps with Ember.js

Controllers

Use is discouragedPlace for additional View Logic

@leojh

Page 21: Developing Single Page Apps with Ember.js

Web Components

A big deal in the framework

They function with the premise of Data-Down-Actions-Up

@leojh

Page 22: Developing Single Page Apps with Ember.js

Templates

Your Components, Routes, and Application are marked up using HTMLBars

@leojh

Page 23: Developing Single Page Apps with Ember.js

Ember-Data

Like an ORM but for REST ApisFetches data to hydrate Models

Syncs local Models with API

@leojh

Page 24: Developing Single Page Apps with Ember.js

So a typical dev lifecycle is like this:

Using ember-cliCreate a Route and a ModelCreate a Component and TemplatesRender DataHandle User ActionsMutate DataSync your Data with your backend @leojh

Page 25: Developing Single Page Apps with Ember.js

Workshop

Go over most important Ember conceptsCreate a sample Contacts application

@leojh

Page 26: Developing Single Page Apps with Ember.js

Thank you!

Questions

@leojh