Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Frontend Choices (RubyConf Portugal)
Search
Alex Coles
October 13, 2014
Technology
480
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Frontend Choices (RubyConf Portugal)
Alex Coles
October 13, 2014
More Decks by Alex Coles
See All by Alex Coles
How a language reflects its people (Brighton Ruby)
myabc
0
130
How a language reflects its people
myabc
0
110
Taking Rails beyond the asset pipeline (Workshop at RubyDay Italia)
myabc
0
94
Rails: beyond the asset pipeline (RubyC)
myabc
0
150
Frontend Choices (Tropical Ruby)
myabc
1
820
Frontend Choices
myabc
0
73
Frontend Choices
myabc
0
320
Putting the Hype back in Hypermedia
myabc
1
250
DataMapper
myabc
2
240
Other Decks in Technology
See All in Technology
Bill One 開発エンジニア 紹介資料
sansan33
PRO
7
20k
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
1
360
なぜSRE・セキュリティは評価されないのか?守りの組織を事業成長エンジンに変えた実践
cscengineer
PRO
1
1.3k
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
25k
データエンジニアの困りごとをDevinと一緒に解消する
10xinc
2
610
AI-DLCって実際どう? 〜聞きたいこと全部聞いてみる〜
news_it_enj
0
160
こんなアーキテクチャ図は嫌だ BEYOND THE TIME: 半年後の自分へ贈る15のメッセージ / 15 of Anti-pattern in AWS Architecture Diagrams
naospon
2
140
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
20k
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
1
850
プロダクト思考 × 基盤思考を AIで実現する Compound Engineering
tkc66buzz
1
140
Bet AI Day 2026丨Agentは、「金融」という巨大産業の何を変えられるのか
layerx
PRO
0
560
[RSJ26] Hierarchy-Aware Multimodal Retrieval-Augmented Generation for Embodied Question Answering
keio_smilab
PRO
1
160
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
660
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
510
Designing for Timeless Needs
cassininazir
1
460
[SF Ruby Conf 2025] Rails X
palkan
2
1.3k
KATA
mclloyd
PRO
35
15k
RailsConf 2023
tenderlove
30
1.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
GraphQLとの向き合い方2022年版
quramy
50
15k
The Language of Interfaces
destraynor
162
27k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
230
Are puppies a ranking factor?
jonoalderson
2
3.9k
Transcript
Alex Coles | RubyConf Portugal, Braga Frontend Choices
olá Braga
not really about choice
I’m a backend guy living in a frontend world “
quem sou eu?
@myabc Alex Coles Berlin, Germany Finn GmbH
@myabc openproject.org openproject.org OpenProject
@myabc eurucamp.org eurucamp.org eurucamp
@myabc eurucamp.org eurucamp.org eurucamp
10 years ago
10 years ago 2004
10 years ago what was I doing?
10 years ago what was I doing?
10 years ago what was I doing?
10 years ago what was the world doing?
10 years ago what was the world doing?
10 years ago what was the world doing?
10 years ago what was the world doing?
10 years ago what was the world doing?
10 years ago what was Portugal doing?
10 years ago what was Portugal doing?
10 years ago what was Portugal doing?
10 years ago what were you doing?
10 years ago what were you doing? ?
10 years ago what was Apple doing?
10 years ago what was Apple doing?
10 years ago what was Apple doing?
10 years ago what was the web doing?
10 years ago what was the web doing?
10 years ago there was no jQuery!
10 years ago but the end of 2004 was to
mark a transition
None
None
The Rails Way
Rails is so 2005 “
Rails is so 2005 “
“Rails Way” back in 2005
“Rails Way” back in 2005 •Server Generated HTML (ERB, etc.)
“Rails Way” back in 2005 •Server Generated HTML (ERB, etc.)
•Prototype
“Rails Way” back in 2005 •Server Generated HTML (ERB, etc.)
•Prototype •Scriptaculous
“Rails Way” back in 2005 •Server Generated HTML (ERB, etc.)
•Prototype •Scriptaculous •RJS
http://slash7.com/assets/2006/10/8/RJS-Demistified_Amy-Hoy-slash7_1.pdf RJS
http://slash7.com/assets/2006/10/8/RJS-Demistified_Amy-Hoy-slash7_1.pdf RJS
RJS
RJS <div id="items"></div> <%= link_to_remote 'Add to cart', url:
{ controller: 'cart', action: 'add_to_cart' }%> erb view
RJS <div id="items"></div> <%= link_to_remote 'Add to cart', url:
{ controller: 'cart', action: 'add_to_cart' }%> erb view class CartController < ActionController::Base def add_to_cart @item = CartItem.new @cart.items << @item end end controller
RJS <div id="items"></div> <%= link_to_remote 'Add to cart', url:
{ controller: 'cart', action: 'add_to_cart' }%> erb view class CartController < ActionController::Base def add_to_cart @item = CartItem.new @cart.items << @item end end controller page.insert_html :bottom, :items, partial: 'item', object: @item page.replace_html :items_count, I18n.t(:item, count: @cart.items.count) rjs view
…we mostly had “websites”
yahoo.com Yahoo! 2004
bindows.net Bindows 2004
gmail.com Gmail pre-β 2002-4 http://techcrunch.com/2008/06/06/the-evolution-of-pre-launch-gmail-in-screenshots/
where we are now
…we have “applications”
soundcloud.com Soundcloud
Single Page Application Architecture
Single Page Application Architecture - +
chunking Single Page Application Architecture - +
chunking controller Single Page Application Architecture - +
chunking controller templating Single Page Application Architecture - +
chunking controller templating routing Single Page Application Architecture - +
chunking controller templating routing real-time communicaton Single Page Application Architecture
- +
chunking controller templating routing real-time communicaton local storage Single Page
Application Architecture - +
“Rails Way” now
“Rails Way” now • Server Generated HTML (ERB, Slim, HAML
etc.)
“Rails Way” now • Server Generated HTML (ERB, Slim, HAML
etc.) • jQuery
“Rails Way” now • Server Generated HTML (ERB, Slim, HAML
etc.) • jQuery • jQuery UI
“Rails Way” now • Server Generated HTML (ERB, Slim, HAML
etc.) • jQuery • jQuery UI • Server generated JavaScript Responses (SJR)
JavaScript has grown up
JavaScript has grown up percentage of total JS developer jobs
has doubled from 2005 to 2010 indeed.com
JavaScript has grown up Server-side usage of JS has been
multiplied by 6 from Jan 2012 to Oct 2014 W3Techs.com
no backend nobackend.org
hood.ie Hoodie
isomorphism
meteor.com Meteor
frontend frameworks
frontend (MV*) frameworks
frontend (MV*) frameworks AngularJS
frontend (MV*) frameworks AngularJS KnockoutJS
frontend (MV*) frameworks AngularJS Ember.js KnockoutJS
frontend (component) frameworks
frontend (component) frameworks Ractive.js
ReactJS frontend (component) frameworks Ractive.js
ReactJS Backbone View (alone) frontend (component) frameworks Ractive.js
ReactJS ExtJS Backbone View (alone) frontend (component) frameworks Ractive.js
TodoMVC todomvc.com
More on MV*…
None
None
None
but I <3 Ruby !
so here is the question
“
is there room for Rails?
“ – Marcin Stecki @madsheepPL at wroc_love.rb Not his [DHH’s]
responsibility to tell us how to do these things.
single page vs. traditional HTML
naturally content-dependent
what is your content? general personal
what is your content? Information pages general personal
what is your content? Information pages Membership sites general personal
what is your content? Information pages Closed systems Membership sites
general personal
content criteria
content criteria • authentication
content criteria • authentication • how real is real-time
content criteria • authentication • how real is real-time •
caching
content criteria • authentication • how real is real-time •
caching • indexing (SEO)
how unique is the view to be rendered?
how unique is the view to be rendered? how many
combinations of a unique set of data?
how unique is the view to be rendered? how many
combinations of a unique set of data? • a blog with comments
how unique is the view to be rendered? how many
combinations of a unique set of data? • a blog with comments • a hotel page with reviews
how unique is the view to be rendered? how many
combinations of a unique set of data? • a blog with comments • a hotel page with reviews • a dashboard
if it is curated content Rails way →
other ways are better if it is SPA →
some tips
what is most like Rails? tip 1: familiarity
what is most like Rails? tip 1: familiarity
tip 1: familiarity Ember.js is most like Rails
Ember.js is most like Rails
Ember.js is most like Rails • everything should inherit from
main object
Ember.js is most like Rails • everything should inherit from
main object ActiveRecord::Base.inherited)
Ember.js is most like Rails • everything should inherit from
main object ActiveRecord::Base.inherited) Ember.Object
Ember.js is most like Rails • everything should inherit from
main object ActiveRecord::Base.inherited) Ember.Object Plain Old JavaScript Objects
Ember.js is most like Rails
Ember.js is most like Rails • routing DSL
Ember.js is most like Rails • routing DSL built-in routing
Ember.js is most like Rails • routing DSL built-in routing
built-in routing
Ember.js is most like Rails • routing DSL built-in routing
not in core, third party solutions built-in routing
Ember.js is most like Rails
Ember.js is most like Rails • vocabulary (templates, partials, etc.)
Ember.js is most like Rails • vocabulary (templates, partials, etc.)
Models, Controllers, Views, Initializers
Ember.js is most like Rails • vocabulary (templates, partials, etc.)
Models, Controllers, Views, Initializers Models, Controllers, Views, Initializers
Ember.js is most like Rails • vocabulary (templates, partials, etc.)
Dependency Injection, Factories, Services, Providers, Transclusion Models, Controllers, Views, Initializers Models, Controllers, Views, Initializers
how to make things work with Rails?
using asset pipeline / sprockets tip 2: Rails “the non-Rails
way
use Bower
use Bower
3 options for using Bower
gem install bower-rails 1 option gem
config.assets.paths << File.join(Rails.root, 'vendor', 'assets', ‘components') Rails 4 (Sprockets 2+)
2 option
rails-assets.org rails-assets.org 3 option
ember-rails-api github.com/dockyard/ember-appkit-rails
the app/assets/javascripts silo
one more thing… (sidetrack)
voltframework.com Volt Framework Volt is a framework for building data
rich web applications shockingly fast. Play Video ! Get Started " Home Getting Started Docs API Blog Community #
what is the way forward? →
(IMHO)
split completely ! tip 3: split
I don’t like monoliths
applications 2
applications 2 =
applications 2 = 1 API +
applications 2 frontend = 1 API + 1
API
API Rails
API Rails Sinatra
API Rails Sinatra Lotus.rb
frontend API Rails Sinatra Lotus.rb
frontend API Rails Sinatra JS workflows Lotus.rb
JavaScript tooling
isomorphism is possible http://nerds.airbnb.com/isomorphic-javascript-future-web-apps/
surprisingly well testable (and fast)
muito obrigado!
perguntas?
@myabc