SlideShare a Scribd company logo
1 of 28
Download to read offline
GRAILS FOR
 HIPSTERS
  ROB FLETCHER
   @rfletcherEW
who am I?

• Associate at Energized Work
• Currently at tv.sky.com
• Author of Betamax & various Grails plugins
• Into Grails before it was mainstream
javascript 2006
javascript 2012
is grails hipster-friendly?
enterprise development
hipster development
demo time…
  bit.ly/TWdn1r
192.168.1.57:8080


git.io/hipsteroid
async processing
push data
           vert.x
grails app
            bus
offload expensive work
             vert.x
  Grails app
  grails app                  vert.x app
              bus

AJAX
          HTTP         push
HTTP
           202        JSON
POST
one request…n responses
              vert.x
   Grails app
   grails app          vert.x app
               bus

 AJAX
           HTTP
 HTTP
            202
 POST
other options

• Atmosphere / Comet
• Grails events-push plugin
• Grails Servlet 3.0 support
front-end tooling
not invented here

the philosophy of social, corporate, or
institutional cultures that avoid using or
buying already existing products, research,
standards, or knowledge because of their
external origins
                                        Wikipedia
build & packaging tools
                 brunch.io
                                                      jamjs.org


                                   yeoman.io
  gruntjs.com
                livereload.com

                                                 ender.jit.su
twitter.github.com/bower
                             incident57.com/codekit
tl;dr - here’s a list…


github.com/codylindley/frontend-tools
codekit demo

   LESS                    CSS                    bundled / cached




CoffeeScript             JavaScript               bundled / cached



               CodeKit                Resources
                                        plugin
testing
dual-rendering
one page app navigation
               http://hipsteroid.co
    HTML
    CSS
    script
             JSON                     JSON
                        JSON




/     /timeline     /pictures/$id     /users/$name
deep link: /pictures/$id
      serves                 fetches data &
     HTML & JS                serves JSON



                        app starts      renders
bookmark    renders
                         & route          view
 or link   empty page
                         triggers      template
…with dual rendering
       serves
      HTML & JS



                           app starts
 bookmark   renders full
                            & route
  or link      page
                            triggers
mirrored routing
UrlMappings.groovy           hipsteroid-router.coffee
'/' {                        routes:
   controller = 'home'          '/': 'home'
}                               'timeline': 'timeline'
                                'pictures:id': 'picture'
'/timeline' {                   'users:name': 'profile'
   controller = 'pictures'
   action = 'list'
}

"/pictures/$id" {
   controller = 'pictures'
   action = 'show'
}

"/users/$name" {
   controller = 'user'
   action = 'show'
}
the handlebars plugin




github.com/davidtinker/grails-handlebars
handlebars
timeline.handlebars
<h1>Timeline</h1>
<ul>
{{#each .}}
     <li data-id="{{id}}">
         {{> picture}}
     </li>
{{/each}}
</ul>


picture.handlebars
<figure>
    <img src="{{url}}">
    <figcaption>
         <p>Uploaded {{friendlyTime dateCreated}} by {{uploadedBy.username}}</p>
         {{#isCurrentUser uploadedBy}}
         <button type="button" class="delete" title="Delete">Delete</button>
         {{/isCurrentUser}}
    </figcaption>
</figure>
template re-use
PicturesController.groovy               picture-view.coffee
def show(String id) {
                                        class PictureView extends Backbone.View
   def picture = Picture.get(id)
   if (picture) {
                                          template: Handlebars.templates.picture
      render text: handlebars.render(
         template: 'picture',
                                          render: ->
         model: picture
                                             @$el.html @template(@model.toJSON())
      )
   } else {
      response.sendError SC_NOT_FOUND
   }
}




               web-app/templates/picture.handlebars
thanks
git.io/hipsteroid
@rfletcherEW
@hipsterdevstack
blog.freeside.co
hipsterdevstack.tumblr.com
energizedwork.com

More Related Content

What's hot

Grails Simple Login
Grails Simple LoginGrails Simple Login
Grails Simple Login
moniguna
 
OpenY: Scaling and Sharing with Custom Drupal Distribution
OpenY: Scaling and Sharing with Custom Drupal DistributionOpenY: Scaling and Sharing with Custom Drupal Distribution
OpenY: Scaling and Sharing with Custom Drupal Distribution
DrupalCamp Kyiv
 
Amsterdam.js talk: node webkit
Amsterdam.js talk: node webkitAmsterdam.js talk: node webkit
Amsterdam.js talk: node webkit
Fabian Jakobs
 
Java2day 2013 : Modern workflows for javascript integration
Java2day 2013 : Modern workflows for javascript integrationJava2day 2013 : Modern workflows for javascript integration
Java2day 2013 : Modern workflows for javascript integration
Mite Mitreski
 

What's hot (19)

MeteorJS Session
MeteorJS SessionMeteorJS Session
MeteorJS Session
 
Grails Simple Login
Grails Simple LoginGrails Simple Login
Grails Simple Login
 
Building Modern Web Applications using React and Redux
 Building Modern Web Applications using React and Redux Building Modern Web Applications using React and Redux
Building Modern Web Applications using React and Redux
 
OpenY: Scaling and Sharing with Custom Drupal Distribution
OpenY: Scaling and Sharing with Custom Drupal DistributionOpenY: Scaling and Sharing with Custom Drupal Distribution
OpenY: Scaling and Sharing with Custom Drupal Distribution
 
JOSA TechTalks - Better Web Apps with React and Redux
JOSA TechTalks - Better Web Apps with React and ReduxJOSA TechTalks - Better Web Apps with React and Redux
JOSA TechTalks - Better Web Apps with React and Redux
 
Amsterdam.js talk: node webkit
Amsterdam.js talk: node webkitAmsterdam.js talk: node webkit
Amsterdam.js talk: node webkit
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...
 
Vue.jsをはじめる
Vue.jsをはじめるVue.jsをはじめる
Vue.jsをはじめる
 
Docker, Ansible and Symfony micro-kernel
Docker, Ansible and Symfony micro-kernelDocker, Ansible and Symfony micro-kernel
Docker, Ansible and Symfony micro-kernel
 
How to build crud application using vue js, graphql, and hasura
How to build crud application using vue js, graphql, and hasuraHow to build crud application using vue js, graphql, and hasura
How to build crud application using vue js, graphql, and hasura
 
The Best Way to Become an Android Developer Expert with Android Jetpack
The Best Way to Become an Android Developer Expert  with Android JetpackThe Best Way to Become an Android Developer Expert  with Android Jetpack
The Best Way to Become an Android Developer Expert with Android Jetpack
 
Jenkins with Heroku
Jenkins with HerokuJenkins with Heroku
Jenkins with Heroku
 
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vue
 
Web view
Web viewWeb view
Web view
 
Web view
Web viewWeb view
Web view
 
Intro to sbt-web
Intro to sbt-webIntro to sbt-web
Intro to sbt-web
 
Google app-engine-with-python
Google app-engine-with-pythonGoogle app-engine-with-python
Google app-engine-with-python
 
Java2day 2013 : Modern workflows for javascript integration
Java2day 2013 : Modern workflows for javascript integrationJava2day 2013 : Modern workflows for javascript integration
Java2day 2013 : Modern workflows for javascript integration
 

Similar to Grails for hipsters

[HEWEBAR 2012] Adaptive Images in Responsive Web Design
[HEWEBAR 2012] Adaptive Images in Responsive Web Design[HEWEBAR 2012] Adaptive Images in Responsive Web Design
[HEWEBAR 2012] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
Web app and more
Web app and moreWeb app and more
Web app and more
faming su
 

Similar to Grails for hipsters (20)

Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
Single Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle StorySingle Page JavaScript WebApps... A Gradle Story
Single Page JavaScript WebApps... A Gradle Story
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)
 
Front End Development for Back End Developers - Denver Startup Week 2017
Front End Development for Back End Developers - Denver Startup Week 2017Front End Development for Back End Developers - Denver Startup Week 2017
Front End Development for Back End Developers - Denver Startup Week 2017
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
 
d.mix: Programming by a Sample
d.mix: Programming by a Sampled.mix: Programming by a Sample
d.mix: Programming by a Sample
 
Modern android development
Modern android developmentModern android development
Modern android development
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017
 
Responsive Design from problem to production
Responsive Design from problem to productionResponsive Design from problem to production
Responsive Design from problem to production
 
[HEWEBAR 2012] Adaptive Images in Responsive Web Design
[HEWEBAR 2012] Adaptive Images in Responsive Web Design[HEWEBAR 2012] Adaptive Images in Responsive Web Design
[HEWEBAR 2012] Adaptive Images in Responsive Web Design
 
Introduction to html5
Introduction to html5Introduction to html5
Introduction to html5
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Web app and more
Web app and moreWeb app and more
Web app and more
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
 
Web Components With Rails
Web Components With RailsWeb Components With Rails
Web Components With Rails
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
 
Front End Development for Backend Developers - GIDS 2019
Front End Development for Backend Developers - GIDS 2019Front End Development for Backend Developers - GIDS 2019
Front End Development for Backend Developers - GIDS 2019
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 

Grails for hipsters