embercli rails: an integration love story

59
EmberCLI Rails An Integration Love Story

Upload: jonathan-jackson

Post on 17-Jul-2015

447 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: EmberCLI Rails: An Integration Love Story

EmberCLI RailsAn Integration Love Story

Page 2: EmberCLI Rails: An Integration Love Story

Jonathan Jackson @rondale_sc

rondale-sc

[email protected]

jonathan-jackson.net

Page 3: EmberCLI Rails: An Integration Love Story
Page 4: EmberCLI Rails: An Integration Love Story
Page 5: EmberCLI Rails: An Integration Love Story
Page 6: EmberCLI Rails: An Integration Love Story

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

Page 7: EmberCLI Rails: An Integration Love Story

emberweekend.com

Page 8: EmberCLI Rails: An Integration Love Story

Jonathan Jackson @rondale_sc

rondale-sc

[email protected]

jonathan-jackson.net

Page 9: EmberCLI Rails: An Integration Love Story

What I’ll be covering

Page 10: EmberCLI Rails: An Integration Love Story

• A brief intro to Ember.js

• The History of Rails and Ember

• Introduction to EmberCLI Rails gem

• Goals of the EmberCLI Rails project

Page 11: EmberCLI Rails: An Integration Love Story

A Brief Intro to Ember.js

Page 12: EmberCLI Rails: An Integration Love Story

—Luke Melia

“98% of building good apps is understanding

your layers and knowing what code should go

where.”

Page 13: EmberCLI Rails: An Integration Love Story

MVC

Page 14: EmberCLI Rails: An Integration Love Story

Well, Kinda.

Page 15: EmberCLI Rails: An Integration Love Story

More like MVCR+

Page 16: EmberCLI Rails: An Integration Love Story

Router• Application state

• Updates URL per route transition

Page 17: EmberCLI Rails: An Integration Love Story

Models• Persisting Objects

Page 18: EmberCLI Rails: An Integration Love Story

Views• DOM Interactions

• DOM events to semantic actions

Page 19: EmberCLI Rails: An Integration Love Story

Controllers• Presenting data for view layer to render

Page 20: EmberCLI Rails: An Integration Love Story

Why Ember.js is appealing to Rails developers.

Page 21: EmberCLI Rails: An Integration Love Story

Yehuda

Page 22: EmberCLI Rails: An Integration Love Story

Convention over configuration

Page 23: EmberCLI Rails: An Integration Love Story

Shared nomenclature*

Page 24: EmberCLI Rails: An Integration Love Story

Emphasis on meaningful URLs

Page 25: EmberCLI Rails: An Integration Love Story

Focus on testing

Page 26: EmberCLI Rails: An Integration Love Story

Rails <3 Ember• Yehuda

• Convention over configuration

• Shared nomenclature*

• Emphasis on meaningful URLs

• Focus on Testing

Page 27: EmberCLI Rails: An Integration Love Story

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

Page 28: EmberCLI Rails: An Integration Love Story

The History of Rails and Ember

Page 29: EmberCLI Rails: An Integration Love Story

Globals and inline templatesemberjs.jsbin.com

Page 30: EmberCLI Rails: An Integration Love Story

Ember Rails (gem)

x

Rails

• Globals (still)

• File Structure

• Precompiled templates into asset pipeline

API Testing GeneratorsAsset Compilation

Asset Serving

Page 31: EmberCLI Rails: An Integration Love Story

Ember AppKit• precursor to EmberCLI

• Grunt build tooling

• ES6 transpilation

• Solid project structure

• Frontend/backend package management via NPM/Bower

Page 32: EmberCLI Rails: An Integration Love Story

Bower

Page 33: EmberCLI Rails: An Integration Love Story

Upgrades are hard!

Page 34: EmberCLI Rails: An Integration Love Story

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

Page 35: EmberCLI Rails: An Integration Love Story

Upgrades are hard!

Page 36: EmberCLI Rails: An Integration Love Story

EmberCLI• Successor of Ember AppKit

• Broccoli as a build tool

• Testing harness out of the box

• Constant improvements

• Addons

Page 37: EmberCLI Rails: An Integration Love Story

Upgradability• Solid upgrade path with `ember init`

• guided upgrade with blueprints used for diff

Page 38: EmberCLI Rails: An Integration Love Story

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

Page 39: EmberCLI Rails: An Integration Love Story

No full-stack acceptance testing conventions

Page 40: EmberCLI Rails: An Integration Love Story

Ad hoc development workflows

Page 41: EmberCLI Rails: An Integration Love Story
Page 42: EmberCLI Rails: An Integration Love Story

Doesn't work well with existing applications

Page 43: EmberCLI Rails: An Integration Love Story

Deployments become more complicated

Page 44: EmberCLI Rails: An Integration Love Story
Page 45: EmberCLI Rails: An Integration Love Story

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)

Page 46: EmberCLI Rails: An Integration Love Story

The EmberCLI Rails gem

Somewhere in Between...

Page 47: EmberCLI Rails: An Integration Love Story

Responsibilities of EmberCLI Rails

xAPI Testing

Rails

x GeneratorsAsset Compilation

Asset Serving

Testing

Ember

x x

RAT

GeAssAs

E

Page 48: EmberCLI Rails: An Integration Love Story

Responsibilities of EmberCLI Rails

x x

Rails

API

Testing

Generators

Asset Compilation

Asset Serving

Ember

Page 49: EmberCLI Rails: An Integration Love Story

How does it work?

Page 50: EmberCLI Rails: An Integration Love Story
Page 51: EmberCLI Rails: An Integration Love Story

How do I use it?

Page 52: EmberCLI Rails: An Integration Love Story

We start with a Rails app...

Page 53: EmberCLI Rails: An Integration Love Story
Page 54: EmberCLI Rails: An Integration Love Story
Page 55: EmberCLI Rails: An Integration Love Story
Page 56: EmberCLI Rails: An Integration Love Story

Goals of the EmberCLI Rails Project

Page 57: EmberCLI Rails: An Integration Love Story
Page 58: EmberCLI Rails: An Integration Love Story

Maybe we have some time for a demo?

demo

demo2 - shameless plug

Page 59: EmberCLI Rails: An Integration Love Story

Jonathan Jackson @rondale_sc

rondale-sc

[email protected]

jonathan-jackson.net