SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
Views, anywhere!
                                     @sylvinus

                          Paris Node Meetup, 8th June 2011




Wednesday, June 8, 2011
( I never thought I’d be
        the opening act for God,
           but here we are! ;-)


Wednesday, June 8, 2011
Old server-side apps

                                      Server

                                App.(php|rb|...)


                           GET/POST             HTML


                                      Browser


Wednesday, June 8, 2011
Current client-side apps

                                      Server          API


                GET       “Loader” HTML        GET/POST   JSON



                                      App.js


                                     Browser

Wednesday, June 8, 2011
We should NOT be happy
                 • Google & other crawlers?
                 • Browser history? (twitter.com#wtf)
                 • Accessibility?
                 • Mobile devices?
                 • Set-top boxes? CEHTML?
                 • Whatever is next?

Wednesday, June 8, 2011
Plain old HTML is
                             your friend.



Wednesday, June 8, 2011
Why Server-side JS?


                 • JS is cool
                 • Client or Server, only one language
                 • Client or Server, only one app!



Wednesday, June 8, 2011
Updated design

                                      Server

                               App.js                 API


              GET/POST    Full HTML            GET/POST   JSON


                                          App.js

                                  Browser

Wednesday, June 8, 2011
Basic idea

        • One common app core
        • Two adapters : Nodejs & Browsers
        • As much as possible in the shared core!
        • This is nothing really new (cf Gmail, again)
        • BUT Nodejs makes it so much easier


Wednesday, June 8, 2011
Demo



Wednesday, June 8, 2011
History?
                 • HTML5 pushState() !
                 • Server answers to GET /index.html
                 • Client listens to “/index.html” event
                 • If !HTML5, 2 possible fallbacks:
                          • #bang
                          • HTML-only mode

Wednesday, June 8, 2011
Benefits

      • Only one codebase
      • Serve HTML-only versions of your JS app
             for Crawlers, Odd devices, IE6, ...

      • (Respect the way the web was built)
      • Feel better about pushing advanced
             client-side features


Wednesday, June 8, 2011
The View Class
            View.render(callback)
            - Executed on server & client
            - Plug APIs, Templates, ...
            - callback(error, html)
            View.enhance()
            - Executed on client only
            - Bind event listeners, too much jQuery plugins
            View.transitionTo(newView)
            - Executed on client only
            - Plug some fancy animations!

Wednesday, June 8, 2011
Should you go this way?


                 • Check the requirements of your app
                 • Check your love for JS :)
                 • 29th June: get all of this (& more)
                          built-in with the Joshfire framework!




Wednesday, June 8, 2011
Thanks!
                           Questions?




Wednesday, June 8, 2011

Contenu connexe

Similaire à Javascript Views, Client-side or Server-side with NodeJS

Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011
Bachkoutou Toutou
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
eug3n_cojocaru
 
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Guillaume Laforge
 
Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06
Skills Matter
 
让开发也懂前端
让开发也懂前端让开发也懂前端
让开发也懂前端
lifesinger
 
Android presentation 2011
Android presentation 2011Android presentation 2011
Android presentation 2011
Bram Vandeputte
 
Koss, How to make desktop caliber browser apps
Koss, How to make desktop caliber browser appsKoss, How to make desktop caliber browser apps
Koss, How to make desktop caliber browser apps
Evil Martians
 

Similaire à Javascript Views, Client-side or Server-side with NodeJS (20)

3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time 3D in the Browser via WebGL: It's Go Time
3D in the Browser via WebGL: It's Go Time
 
MongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema DesignMongoDB at Sailthru: Scaling and Schema Design
MongoDB at Sailthru: Scaling and Schema Design
 
Groke
GrokeGroke
Groke
 
Choosing the right Content Management System
Choosing the right Content Management SystemChoosing the right Content Management System
Choosing the right Content Management System
 
2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon
 
Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011
 
Webinar Mobile ECM Apps with Nuxeo EP
Webinar Mobile ECM Apps with Nuxeo EPWebinar Mobile ECM Apps with Nuxeo EP
Webinar Mobile ECM Apps with Nuxeo EP
 
JavaSE - The road forward
JavaSE - The road forwardJavaSE - The road forward
JavaSE - The road forward
 
AppScale Talk at SBonRails
AppScale Talk at SBonRailsAppScale Talk at SBonRails
AppScale Talk at SBonRails
 
Anarchist guide to titanium ui
Anarchist guide to titanium uiAnarchist guide to titanium ui
Anarchist guide to titanium ui
 
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
Gaelyk - Guillaume Laforge - GR8Conf Europe 2011
 
2011 The Year of Web apps
2011 The Year of Web apps2011 The Year of Web apps
2011 The Year of Web apps
 
Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06
 
Android Development Slides
Android Development SlidesAndroid Development Slides
Android Development Slides
 
让开发也懂前端
让开发也懂前端让开发也懂前端
让开发也懂前端
 
201101 HornetQ
201101 HornetQ201101 HornetQ
201101 HornetQ
 
Android presentation 2011
Android presentation 2011Android presentation 2011
Android presentation 2011
 
20100608sigmod
20100608sigmod20100608sigmod
20100608sigmod
 
Consuming the Twitter Streaming API with Ruby and MongoDB
Consuming the Twitter Streaming API with Ruby and MongoDBConsuming the Twitter Streaming API with Ruby and MongoDB
Consuming the Twitter Streaming API with Ruby and MongoDB
 
Koss, How to make desktop caliber browser apps
Koss, How to make desktop caliber browser appsKoss, How to make desktop caliber browser apps
Koss, How to make desktop caliber browser apps
 

Plus de Sylvain Zimmer

Joshfire Framework 0.9 Technical Overview
Joshfire Framework 0.9 Technical OverviewJoshfire Framework 0.9 Technical Overview
Joshfire Framework 0.9 Technical Overview
Sylvain Zimmer
 
Archicamp présentation
Archicamp présentationArchicamp présentation
Archicamp présentation
Sylvain Zimmer
 

Plus de Sylvain Zimmer (13)

Developer-friendly taskqueues: What you should ask yourself before choosing one
Developer-friendly taskqueues: What you should ask yourself before choosing oneDeveloper-friendly taskqueues: What you should ask yourself before choosing one
Developer-friendly taskqueues: What you should ask yourself before choosing one
 
Ranking the Web with Spark
Ranking the Web with SparkRanking the Web with Spark
Ranking the Web with Spark
 
The original vision of Nutch, 14 years later: Building an open source search ...
The original vision of Nutch, 14 years later: Building an open source search ...The original vision of Nutch, 14 years later: Building an open source search ...
The original vision of Nutch, 14 years later: Building an open source search ...
 
PyCon FR 2016 - Et si on recodait Google en Python ?
PyCon FR 2016 - Et si on recodait Google en Python ?PyCon FR 2016 - Et si on recodait Google en Python ?
PyCon FR 2016 - Et si on recodait Google en Python ?
 
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
Why and how Pricing Assistant migrated from Celery to RQ - Paris.py #2
 
[fr] Introduction et Live-code Backbone.js à DevoxxFR 2013
[fr] Introduction et Live-code Backbone.js à DevoxxFR 2013[fr] Introduction et Live-code Backbone.js à DevoxxFR 2013
[fr] Introduction et Live-code Backbone.js à DevoxxFR 2013
 
140byt.es - The Dark Side of Javascript
140byt.es - The Dark Side of Javascript140byt.es - The Dark Side of Javascript
140byt.es - The Dark Side of Javascript
 
Joshfire Framework 0.9 Technical Overview
Joshfire Framework 0.9 Technical OverviewJoshfire Framework 0.9 Technical Overview
Joshfire Framework 0.9 Technical Overview
 
no.de quick presentation at #ParisJS 4
no.de quick presentation at #ParisJS 4no.de quick presentation at #ParisJS 4
no.de quick presentation at #ParisJS 4
 
Kinect + Javascript tech talk at #ParisJS Jan 2011
Kinect + Javascript tech talk at #ParisJS Jan 2011Kinect + Javascript tech talk at #ParisJS Jan 2011
Kinect + Javascript tech talk at #ParisJS Jan 2011
 
Web Crawling with NodeJS
Web Crawling with NodeJSWeb Crawling with NodeJS
Web Crawling with NodeJS
 
Archicamp présentation
Archicamp présentationArchicamp présentation
Archicamp présentation
 
Twisted presentation & Jamendo usecases
Twisted presentation & Jamendo usecasesTwisted presentation & Jamendo usecases
Twisted presentation & Jamendo usecases
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
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...
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 

Javascript Views, Client-side or Server-side with NodeJS

  • 1. Views, anywhere! @sylvinus Paris Node Meetup, 8th June 2011 Wednesday, June 8, 2011
  • 2. ( I never thought I’d be the opening act for God, but here we are! ;-) Wednesday, June 8, 2011
  • 3. Old server-side apps Server App.(php|rb|...) GET/POST HTML Browser Wednesday, June 8, 2011
  • 4. Current client-side apps Server API GET “Loader” HTML GET/POST JSON App.js Browser Wednesday, June 8, 2011
  • 5. We should NOT be happy • Google & other crawlers? • Browser history? (twitter.com#wtf) • Accessibility? • Mobile devices? • Set-top boxes? CEHTML? • Whatever is next? Wednesday, June 8, 2011
  • 6. Plain old HTML is your friend. Wednesday, June 8, 2011
  • 7. Why Server-side JS? • JS is cool • Client or Server, only one language • Client or Server, only one app! Wednesday, June 8, 2011
  • 8. Updated design Server App.js API GET/POST Full HTML GET/POST JSON App.js Browser Wednesday, June 8, 2011
  • 9. Basic idea • One common app core • Two adapters : Nodejs & Browsers • As much as possible in the shared core! • This is nothing really new (cf Gmail, again) • BUT Nodejs makes it so much easier Wednesday, June 8, 2011
  • 11. History? • HTML5 pushState() ! • Server answers to GET /index.html • Client listens to “/index.html” event • If !HTML5, 2 possible fallbacks: • #bang • HTML-only mode Wednesday, June 8, 2011
  • 12. Benefits • Only one codebase • Serve HTML-only versions of your JS app for Crawlers, Odd devices, IE6, ... • (Respect the way the web was built) • Feel better about pushing advanced client-side features Wednesday, June 8, 2011
  • 13. The View Class View.render(callback) - Executed on server & client - Plug APIs, Templates, ... - callback(error, html) View.enhance() - Executed on client only - Bind event listeners, too much jQuery plugins View.transitionTo(newView) - Executed on client only - Plug some fancy animations! Wednesday, June 8, 2011
  • 14. Should you go this way? • Check the requirements of your app • Check your love for JS :) • 29th June: get all of this (& more) built-in with the Joshfire framework! Wednesday, June 8, 2011
  • 15. Thanks! Questions? Wednesday, June 8, 2011