embercli rails: an integration love story

Post on 17-Jul-2015

446 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

EmberCLI RailsAn Integration Love Story

Jonathan Jackson @rondale_sc

rondale-sc

jonathan.jackson1@me.com

jonathan-jackson.net

http://www.meetup.com/EmberJax/

emberweekend.com

Jonathan Jackson @rondale_sc

rondale-sc

jonathan.jackson1@me.com

jonathan-jackson.net

What I’ll be covering

• A brief intro to Ember.js

• The History of Rails and Ember

• Introduction to EmberCLI Rails gem

• Goals of the EmberCLI Rails project

A Brief Intro to Ember.js

—Luke Melia

“98% of building good apps is understanding

your layers and knowing what code should go

where.”

MVC

Well, Kinda.

More like MVCR+

Router• Application state

• Updates URL per route transition

Models• Persisting Objects

Views• DOM Interactions

• DOM events to semantic actions

Controllers• Presenting data for view layer to render

Why Ember.js is appealing to Rails developers.

Yehuda

Convention over configuration

Shared nomenclature*

Emphasis on meaningful URLs

Focus on testing

Rails <3 Ember• Yehuda

• Convention over configuration

• Shared nomenclature*

• Emphasis on meaningful URLs

• Focus on Testing

201-created.com/ember-community-survey-2015

The History of Rails and Ember

Globals and inline templatesemberjs.jsbin.com

Ember Rails (gem)

x

Rails

• Globals (still)

• File Structure

• Precompiled templates into asset pipeline

API Testing GeneratorsAsset Compilation

Asset Serving

Ember AppKit• precursor to EmberCLI

• Grunt build tooling

• ES6 transpilation

• Solid project structure

• Frontend/backend package management via NPM/Bower

Bower

Upgrades are hard!

xx

Ember AppKit Rails (gem)

API Testing GeneratorsAsset Compilation

Asset Serving

Rails Ember

• Rails generators for AppKit resources

• Tests accessible in Rails-land

• Simple API versioning

• Compiled to AMD

Upgrades are hard!

EmberCLI• Successor of Ember AppKit

• Broccoli as a build tool

• Testing harness out of the box

• Constant improvements

• Addons

Upgradability• Solid upgrade path with `ember init`

• guided upgrade with blueprints used for diff

Complete Separation

• Tested independently

• Allows for greater specialization

• Flexible backend

• Separation of concerns at a system level

xxAPI Testing GeneratorsAsset Compilation

Asset Serving

Testing

Rails Ember

No full-stack acceptance testing conventions

Ad hoc development workflows

Doesn't work well with existing applications

Deployments become more complicated

The pitfalls of complete separation

• No full-stack acceptance testing conventions

• Ad hoc solutions to development workflow

• Doesn't work with existing applications

• Without excessive duplication

• Deployments become more complicated (conventions)

The EmberCLI Rails gem

Somewhere in Between...

Responsibilities of EmberCLI Rails

xAPI Testing

Rails

x GeneratorsAsset Compilation

Asset Serving

Testing

Ember

x x

RAT

GeAssAs

E

Responsibilities of EmberCLI Rails

x x

Rails

API

Testing

Generators

Asset Compilation

Asset Serving

Ember

How does it work?

How do I use it?

We start with a Rails app...

Goals of the EmberCLI Rails Project

Maybe we have some time for a demo?

demo

demo2 - shameless plug

Jonathan Jackson @rondale_sc

rondale-sc

jonathan.jackson1@me.com

jonathan-jackson.net

top related