Frontend choicesAlex Coles | wroc_love.rb, Wrocław, Polska
View Slide
Anti-climax
front end vs. frontend
Not really about choice
‘I’m a backend guy living in afrontend world’
About me
@myabcAlex ColesBerlin, GermanyFinn GmbH
OpenProjectopenproject.org
1..2..3
eurucampeurucamp.orgCall for Papers openuntil 1st May
jedenone: background
Single page v traditional HTML
SPA depends on your content
no kupa, Sherlock
What’s your content?Information PagesMembership sitesClosed Systems
Content Criteria• Authentication• Caching• Indexing (SEO)• curated Content vs Dynamic
dwatwo: where we are now
History of the Rails Interface
“Rails is so 2005”
“Rails Way” back in 2005• Server Generated HTML (ERB,etc.)• Prototype• Scriptaculous• RJS
“Rails Way” now• Server Generated HTML (ERB,Slim, HAML etc.)• jQuery• jQuery UI• Server generated JavaScriptResponses (SJR)
Where we are now
JavaScript is HUGE
No backendnobackend.org
Hoodiehood.ie
Meteorwww.meteor.com
but I <3 Ruby
So here’s the question
Room for Rails?
The Rails Way
– Marcin Stecki @madsheep at wroc_love.rb“Not his [DHH]'s responsibility to tell us how to dothese things.”
Frontend frameworks
Frontend (MV*) frameworks• AngularJS• Ember.js• KnockoutJS
Frontend (component)frameworks• ReactJS• Backbone.View (alone)• ExtJS
TodoMVCtodomvc.com
KnockoutJS
AngularJS
Ember.js
What is most like Rails?
Ember.js is most like Rails• Everything should inherit from Ember.Object (think ActiveRecord::Base.inherited)• Routing DSL• Vocabulary (templates, partials, etc.)
trzythree: practical usage
Using asset pipeline / sprockets
Use Bower
gem install bower-rails
Rails 4 (Sprockets 2+)
config.assets.paths << File.join(Rails.root,'vendor', 'assets', ‘components')
ember-rails-apigithub.com/dockyard/ember-appkit-rails
What is the way forward?
Split Completely
Two applications: one API, onefrontend
Rails or Sinatra for API A JS workflow for Frontend
Surprisingly testable (and fast)
Dzięki!
Questions?
@myabc