SlideShare uma empresa Scribd logo
1 de 29
Satisfying Business and Engineering
Requirements
Client-server JavaScript, SEO, and Optimized Page Load
Jason Strimpel, Pseudo Classically Trained
Software Engineer @WalmartLabs
The Evolution of the Web
and you may find yourself living in a shotgun shack
Applications Desktop MobileInformation
What are we trying to solve?
SEO
Easily find items
Page Load
Fast first page
load
Page
Transition
Speedy
navigation
between pages
321
These statements are 100% accurate and true
Engineer 1: Java is the cat’s pajamas; Your toy language amuses me
Engineer 2: JavaScript is free like the wind; Java is the language of
fascists
Engineers
Every Back and Front End Engineer, Every Company
Competing Interests in Web
Application Development
Engineering Managers
Code coverage!
Technical debt!
I haven’t coded in 10 years and I sucked at it anyway!
Every Engineering Manager, Every Company
SEO EVERYTHING!!!
This should be a simple change.
I need a flying donkey RIGHT HERE!
Product Managers
Every Product Manager, Every Company
The Rise of the Web
the only thing a gambler needs
• Deployed JavaScript increased
45% in 2011 (HTTP Archive)
• 161 new node modules per day
(http://modulecounts.com)
• JavaScript #1 language (RedMonk 2014)
HTML 5
Web
Components
MV* Libs
Awesomeness
Time
Graph is to scale in real life
JavaScript and
the Web
are a BIG DEAL!
Solution 1: Classic Web Application
a tale as old as time
• Pros
– Excellent SEO support
– Optimized first page load
• Cons
– Duplicate logic
– No clear lines of separation
Rendering
Services
Templates Assets Models Routing
Rendering Templates Assets Models Routing
ClientServer
Solution 2: Single Page Application
new and improved
• Pros
– Distributed processing &
minimal payload
– Separation of data &
presentation
• Cons
– Poor SEO support
– First page load is not
optimized
Rendering
Services
Templates Assets Models Routing
Static
Resources
Proxy to
Service
Assets Models Routing
ClientServer
Solution 3: Hybrid Web Application
• Pros
– Excellent SEO support
– Optimized first page load
– Distributed processing
– Single UI layer
– One code base
– One rendering life cycle
• Cons
– Conditional blocks for server
and client only code
Services
Rendering Templates Assets Models Routing
Client-Server Hybrid
The Stack
Hapi
Backbone.js
jQuery
RequireJS
Application
Components
Models
Rendering Templates
Assets
(i18n/I10n)
Models Routing
ApplicationStructure
DOM Events
Monitoring Synchers
ClientCommonServer
Application
• Structure
• Wiring
• Assets
• Configuration
• Initialization
Components
Component are self-contained,
parameterized, reusable,
composable MVC “mini-
applications”.
• Life cycle
• Business logic
• Events
Models &
Collections
• Tunnel
• Short Circuit
• Optional Syncher
Who cares?
SEO
Which way did he go George?
Solution: First page response is
rendered on the server
Engineering: Single code base
and common rendering life cycle.
Business: Users can easily find
your content.
Optimized First Page Load
Better...stronger...faster
Solution: First page response is rendered on the server.
Engineering: Reduced network calls.
Business: Decreased
bounce rates.
Page Transitions
coast to coast
Solution: Cache
and render on
the client.
Engineering:
Distributed
rendering.
Business:
Increased
conversions.
Mo’ Money
Mo’ Money
Mo’ Money
Demo
The Future
I gotta wear shades
• Hapi first class citizen
• Child views
• Asynchronous Rendering
• Generator
• Lazo mock objects
• Increase code coverage
• Decrease page weight
• And many more
github.com/walmartlabs/lazojs
Hungry for
more?
Questions?
You have question? You do, you don't, yes, no... I should buy a boat! Are
they making pants tighter? I don't know, I don't wear jeans.
Twitter: @StrimpelJason
Github: https://github.com/jstrimpel
LinkedIn: https://www.linkedin.com/in/strimpeljason
Appendix
First Page Request
www.meow.com
Parse
Response
Rehydrate &
Attach Views
Route Table
Component
Action
Rendering
Context
Render
Take me to
meow.com
Internets! Client Server
Page Request
Subsequent Page Requests
www.meow.com => www.foowww.meow/blog
Model DataPage Request Route Table
Component
Action
Rendering
Context
I fancy
meow.com/
blog ServerClient
Attach ViewsRender
Only
fetches
data not
on the
client
Models & Collections
• Extended Backbone models and
collections
• Parameters and model name
define model uniqueness
• Service URL or syncher
Services
Client Server
Model
Proxy
Syncher ?
Yes
No
Optimizing a Page Transition
model syncher
Model X
Model C
Model B
Model A
Model C
Model B
Page Y
Model A
ClientServer
Model C
Syncher
X
Model A Model B
Model X
Page Y
Server Client
Components
self-contained, parameterized, composable MVC “mini-applications”
Method Invocations
Events
• Controller
– Business logic, life cycle,
and view selection
• Model
– Encapsulates data and
notifies view of changes
• View
– Renders model and
responds to user gestures
Parent => Child
Model
Controller
View Model
Controller
View
Components
self-contained, parameterized, composable MVC “mini-applications”
Method Invocations
Events
• Controller
– Business logic, life cycle,
and view selection
• Model
– Encapsulates data and
notifies view of changes
• View
– Renders model and
responds to user gestures
Parent => Child
Model
Controller
View Model
Controller
View

Mais conteúdo relacionado

Mais procurados

Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
KMS Technology
 
Mobile Web vs Native App
Mobile Web vs Native AppMobile Web vs Native App
Mobile Web vs Native App
Ajen 陳
 

Mais procurados (20)

Joe Emison - 10X Product Development
Joe Emison - 10X Product DevelopmentJoe Emison - 10X Product Development
Joe Emison - 10X Product Development
 
Single page application and Framework
Single page application and FrameworkSingle page application and Framework
Single page application and Framework
 
Code stock
Code stockCode stock
Code stock
 
Vaadin Designer (Labs release) @ GWT.create 2015
Vaadin Designer (Labs release) @ GWT.create 2015 Vaadin Designer (Labs release) @ GWT.create 2015
Vaadin Designer (Labs release) @ GWT.create 2015
 
Single page application
Single page applicationSingle page application
Single page application
 
Website development & it's trends
Website development & it's trendsWebsite development & it's trends
Website development & it's trends
 
The API and APP-ification of the Web
The API and APP-ification of the WebThe API and APP-ification of the Web
The API and APP-ification of the Web
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
 
Tech Thursdays: Building Products
Tech Thursdays: Building ProductsTech Thursdays: Building Products
Tech Thursdays: Building Products
 
Angular Connect
Angular ConnectAngular Connect
Angular Connect
 
PyCon PL 2014 executable api
PyCon PL 2014   executable apiPyCon PL 2014   executable api
PyCon PL 2014 executable api
 
Famo.us - build native quality apps using html5 within a day
Famo.us - build native quality apps using html5 within a dayFamo.us - build native quality apps using html5 within a day
Famo.us - build native quality apps using html5 within a day
 
Js foo famo.us- build native quality apps using html5 within a day
Js foo  famo.us- build native quality apps using html5 within a dayJs foo  famo.us- build native quality apps using html5 within a day
Js foo famo.us- build native quality apps using html5 within a day
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
Donald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New TricksDonald Ferguson - Old Programmers Can Learn New Tricks
Donald Ferguson - Old Programmers Can Learn New Tricks
 
Js foo famo.us- build native quality apps using html5 within a day
Js foo  famo.us- build native quality apps using html5 within a dayJs foo  famo.us- build native quality apps using html5 within a day
Js foo famo.us- build native quality apps using html5 within a day
 
Mobile Web vs Native App
Mobile Web vs Native AppMobile Web vs Native App
Mobile Web vs Native App
 
Introduction to Vaadin, GWT.create 2015
Introduction to Vaadin, GWT.create 2015Introduction to Vaadin, GWT.create 2015
Introduction to Vaadin, GWT.create 2015
 
Building share point apps with angularjs
Building share point apps with angularjsBuilding share point apps with angularjs
Building share point apps with angularjs
 
Pearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET DeveloperPearls and Must-Have Tools for the Modern Web / .NET Developer
Pearls and Must-Have Tools for the Modern Web / .NET Developer
 

Destaque

Destaque (6)

Encouraging creativity and reflection in the curriculum
Encouraging creativity and reflection in the curriculumEncouraging creativity and reflection in the curriculum
Encouraging creativity and reflection in the curriculum
 
What is business engineering?
What is business engineering?What is business engineering?
What is business engineering?
 
Body of Knowledge of Business Engineering
Body of Knowledge of Business EngineeringBody of Knowledge of Business Engineering
Body of Knowledge of Business Engineering
 
Asia Logistics Insights: Driving Continuous Improvement to Make Indonesia a L...
Asia Logistics Insights: Driving Continuous Improvement to Make Indonesia a L...Asia Logistics Insights: Driving Continuous Improvement to Make Indonesia a L...
Asia Logistics Insights: Driving Continuous Improvement to Make Indonesia a L...
 
Patterns of Business Model Generator
Patterns of Business Model GeneratorPatterns of Business Model Generator
Patterns of Business Model Generator
 
Business Model Patterns and Examples Part I
Business Model Patterns and Examples Part IBusiness Model Patterns and Examples Part I
Business Model Patterns and Examples Part I
 

Semelhante a Satisfying Business and Engineering Requirements: Client-server JavaScript, SEO, and Optimized Page Load

Feature driven agile oriented web applications
Feature driven agile oriented web applicationsFeature driven agile oriented web applications
Feature driven agile oriented web applications
Ram G Athreya
 
Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
Harbinger Systems - HRTech Builder of Choice
 

Semelhante a Satisfying Business and Engineering Requirements: Client-server JavaScript, SEO, and Optimized Page Load (20)

Performance and Scalability Art of Isomorphic React Applications
Performance and Scalability Art of Isomorphic React ApplicationsPerformance and Scalability Art of Isomorphic React Applications
Performance and Scalability Art of Isomorphic React Applications
 
5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season
5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season
5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season
 
Modern Web Applications
Modern Web ApplicationsModern Web Applications
Modern Web Applications
 
Js foo - Sept 8 upload
Js foo - Sept 8 uploadJs foo - Sept 8 upload
Js foo - Sept 8 upload
 
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
STP 2014 - Lets Learn from the Top Performance Mistakes in 2013
 
The Delight and Difficulties of Universal Java Script with React
The Delight and Difficulties of Universal Java Script with ReactThe Delight and Difficulties of Universal Java Script with React
The Delight and Difficulties of Universal Java Script with React
 
OSCON 2012: Design and Debug HTML5 Apps for Devices with RIB and Web Simulator
OSCON 2012: Design and Debug HTML5 Apps for Devices with RIB and Web SimulatorOSCON 2012: Design and Debug HTML5 Apps for Devices with RIB and Web Simulator
OSCON 2012: Design and Debug HTML5 Apps for Devices with RIB and Web Simulator
 
Angular Ivy- An Overview
Angular Ivy- An OverviewAngular Ivy- An Overview
Angular Ivy- An Overview
 
Basics of Backbone.js
Basics of Backbone.jsBasics of Backbone.js
Basics of Backbone.js
 
A Day Building Fast, Responsive, Extensible Single Page Applications
A Day Building Fast, Responsive, Extensible Single Page ApplicationsA Day Building Fast, Responsive, Extensible Single Page Applications
A Day Building Fast, Responsive, Extensible Single Page Applications
 
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJSMicro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
Micro Front Ends : Divided We Rule by Parth Ghiya - AhmedabadJS
 
Curriculum vitae of nguyen hai quy
Curriculum vitae of nguyen hai quyCurriculum vitae of nguyen hai quy
Curriculum vitae of nguyen hai quy
 
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdfWessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
 
Feature driven agile oriented web applications
Feature driven agile oriented web applicationsFeature driven agile oriented web applications
Feature driven agile oriented web applications
 
Isomorphic React Applications: Performance And Scalability
Isomorphic React Applications: Performance And ScalabilityIsomorphic React Applications: Performance And Scalability
Isomorphic React Applications: Performance And Scalability
 
Pros and Cons of developing a Thick Clientside App
Pros and Cons of developing a Thick Clientside AppPros and Cons of developing a Thick Clientside App
Pros and Cons of developing a Thick Clientside App
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...
Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...
Cross platform engineering - Lessons Learned (Michael Asimakopoulos, Valadis ...
 
Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Último (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Satisfying Business and Engineering Requirements: Client-server JavaScript, SEO, and Optimized Page Load

  • 1. Satisfying Business and Engineering Requirements Client-server JavaScript, SEO, and Optimized Page Load Jason Strimpel, Pseudo Classically Trained Software Engineer @WalmartLabs
  • 2. The Evolution of the Web and you may find yourself living in a shotgun shack Applications Desktop MobileInformation
  • 3. What are we trying to solve? SEO Easily find items Page Load Fast first page load Page Transition Speedy navigation between pages 321
  • 4. These statements are 100% accurate and true Engineer 1: Java is the cat’s pajamas; Your toy language amuses me Engineer 2: JavaScript is free like the wind; Java is the language of fascists Engineers Every Back and Front End Engineer, Every Company Competing Interests in Web Application Development Engineering Managers Code coverage! Technical debt! I haven’t coded in 10 years and I sucked at it anyway! Every Engineering Manager, Every Company SEO EVERYTHING!!! This should be a simple change. I need a flying donkey RIGHT HERE! Product Managers Every Product Manager, Every Company
  • 5. The Rise of the Web the only thing a gambler needs • Deployed JavaScript increased 45% in 2011 (HTTP Archive) • 161 new node modules per day (http://modulecounts.com) • JavaScript #1 language (RedMonk 2014) HTML 5 Web Components MV* Libs Awesomeness Time Graph is to scale in real life JavaScript and the Web are a BIG DEAL!
  • 6. Solution 1: Classic Web Application a tale as old as time • Pros – Excellent SEO support – Optimized first page load • Cons – Duplicate logic – No clear lines of separation Rendering Services Templates Assets Models Routing Rendering Templates Assets Models Routing ClientServer
  • 7. Solution 2: Single Page Application new and improved • Pros – Distributed processing & minimal payload – Separation of data & presentation • Cons – Poor SEO support – First page load is not optimized Rendering Services Templates Assets Models Routing Static Resources Proxy to Service Assets Models Routing ClientServer
  • 8. Solution 3: Hybrid Web Application • Pros – Excellent SEO support – Optimized first page load – Distributed processing – Single UI layer – One code base – One rendering life cycle • Cons – Conditional blocks for server and client only code Services Rendering Templates Assets Models Routing Client-Server Hybrid
  • 9.
  • 10. The Stack Hapi Backbone.js jQuery RequireJS Application Components Models Rendering Templates Assets (i18n/I10n) Models Routing ApplicationStructure DOM Events Monitoring Synchers ClientCommonServer
  • 11. Application • Structure • Wiring • Assets • Configuration • Initialization
  • 12. Components Component are self-contained, parameterized, reusable, composable MVC “mini- applications”. • Life cycle • Business logic • Events
  • 13. Models & Collections • Tunnel • Short Circuit • Optional Syncher
  • 15. SEO Which way did he go George? Solution: First page response is rendered on the server Engineering: Single code base and common rendering life cycle. Business: Users can easily find your content.
  • 16.
  • 17. Optimized First Page Load Better...stronger...faster Solution: First page response is rendered on the server. Engineering: Reduced network calls. Business: Decreased bounce rates.
  • 18. Page Transitions coast to coast Solution: Cache and render on the client. Engineering: Distributed rendering. Business: Increased conversions.
  • 20. Demo
  • 21. The Future I gotta wear shades • Hapi first class citizen • Child views • Asynchronous Rendering • Generator • Lazo mock objects • Increase code coverage • Decrease page weight • And many more github.com/walmartlabs/lazojs Hungry for more?
  • 22. Questions? You have question? You do, you don't, yes, no... I should buy a boat! Are they making pants tighter? I don't know, I don't wear jeans. Twitter: @StrimpelJason Github: https://github.com/jstrimpel LinkedIn: https://www.linkedin.com/in/strimpeljason
  • 24. First Page Request www.meow.com Parse Response Rehydrate & Attach Views Route Table Component Action Rendering Context Render Take me to meow.com Internets! Client Server Page Request
  • 25. Subsequent Page Requests www.meow.com => www.foowww.meow/blog Model DataPage Request Route Table Component Action Rendering Context I fancy meow.com/ blog ServerClient Attach ViewsRender Only fetches data not on the client
  • 26. Models & Collections • Extended Backbone models and collections • Parameters and model name define model uniqueness • Service URL or syncher Services Client Server Model Proxy Syncher ? Yes No
  • 27. Optimizing a Page Transition model syncher Model X Model C Model B Model A Model C Model B Page Y Model A ClientServer Model C Syncher X Model A Model B Model X Page Y Server Client
  • 28. Components self-contained, parameterized, composable MVC “mini-applications” Method Invocations Events • Controller – Business logic, life cycle, and view selection • Model – Encapsulates data and notifies view of changes • View – Renders model and responds to user gestures Parent => Child Model Controller View Model Controller View
  • 29. Components self-contained, parameterized, composable MVC “mini-applications” Method Invocations Events • Controller – Business logic, life cycle, and view selection • Model – Encapsulates data and notifies view of changes • View – Renders model and responds to user gestures Parent => Child Model Controller View Model Controller View

Notas do Editor

  1. MESSAGE: INTRODUCTION Software engineer on the platform team in a branch of Walmartlabs in San Diego How many people are engineers, managers, product people? This is not extremely technical, but we will take a look at some code later and if we have time we can run through slide in the appendix that explain how things work. TRANSITION: BUT BEFORE WE GET INTO THIS I WANTED TO SET SOME CONTEXT
  2. MESSAGE: EVERYTHING IS MOVING TO THE WEB Web driven phones JavaScript on the server is now a real solution Pokki App store that delivers 100% HTML and JS apps Permeated many other devices and markets TRANSITION: AS AN ENGINEER IT IS MY JOB TO PROVIDE AN OPTIMAL USER EXPERIENCE. SO WHAT DOES THAT MEAN?
  3. MESSAGE: IT DEPENDS ON THE PROBLEM YOU ARE SOLVING. IN OUR CASE IT TO CREATE A WEB FRAMEWORK THAT WOULD SOLVE THE SEO PROBLEM. SEO PAGE LOAD PAGE TRANSITION TRANSITION: NOW THAT WE KNOW THE PROBLEM WE ARE SOLVING FOR LET’S TAKE A LOOK AT WHO WE ARE WORKING WITH?
  4. MESSAGE: PEOPLE ARE IMPORTANT. NOT JUST MAKING THEM HAPPY, BUT EMPOWERING THEM TO DO THERE JOB. PRODUCT: these are the people settings the requirements ENGINEERS: the implementers; push back on requests; realists; they can never agree with each other MANAGERS: these people are concerned with deliver quality as fast as possible and metrics TRANSITION: BEFORE WE GET INTO THE POSSIBLE SOLVES TO MAKE THESE PEOPLE’S LIVES EASIER I WANTED TOUCH ON HOW THINGS HAVE BEEN TRENDING.
  5. MESSAGE: WE TALKED ABOUT THE TREND ALL THINGS WEB. WITHIN THIS LETS TAKE A LOOK AT ANOTHER TREND. JavaScript usage has increased – more complex app, but if you take a look at this highly scientific graph you will see MV* libs TRANSITION: NOW THAT WE HAVE SOME CONTEXT ABOUT TRENDS, THE ISSUE WE ARE TRYING TO SOLVE, AND THE MAJOR PLAYERS LET’S TAKE A LOOK AT SOME POSSIBLE SOLUTIONS
  6. MESSAGE: THIS IS THE STRUCTURE THAT HAS BEEN USED SINCE THE DAWN OF ECOMMERCE. IT WORKED WELL UNTIL AJAX CAME ALONG AND THINGS GOT COMPLICATED. Solves the problem, but it high inefficient – confusing life cycles, duplicate efforts, etc. TRANSITION: BECAUSE OF THE INCREASING COMPLEXITY AND DUPLICATION ANOTHER APPROACH WAS TAKEN.
  7. MESSAGE: THIS WAS THE SOLUTION TO FIX THE INEFFICIENCIES AND TO REDUCE DUPLICATION. As you can see this eliminates the duplication by shifting everything to the client This comes at a cost though and the cost is SEO and a decreased time to render TRANSITION: SO THIS REALLY DOESN’T SOLVE OUR BUSINESS PROBLEM. IT IS GREAT FOR ENGINEERING. SO IS THERE ANOTHER WAY?
  8. MESSAGE: THIS IS WHAT IS SOMETIMES REFERRED TO AS THE HOLY GRAIL. THE BEST OF BOTH WORLDS. Reduced the UI to a single layer TRANSITION: GIVEN OUR USE CASE LET’S TAKE A LOOK AT THE SOLUTIONS THAT EXIST TODAY.
  9. MESSAGE: HERE ARE A FEW OF THE SOLUTIONS THAT EXIST TODAY. GREAT SOLUTIONS. SMART PEOPLE. BUT LETS EXAMINE THEM WITHIN THE CONTEXT OF THE PROBLEM WE ARE TRYING TO SOLVE. LIBS – no structure or wiring REAL TIME – doesn’t really fit our use case CLIENT ONLY – client only; poor seo and first page load IN ADDTION TO SEO AND OPTIMIZED PAGE LOAD; SPECIFIC BENEFITS DESIGNED FOR THE FRONT-END ENGINEER IMPROVES DEVELOPER EFFICIENCY – SINGLE CODE BASE, NO CONTEXT SWITCHING, NO FRONT AND BACK ENGINEERS FOR THE UI LAYER NO MORE DRAWING THE LINE IN THE SAND – NO MORE DUPLICATE IMPLEMENTATIONS OR FIGURING OUT WHEN THE CLIENT TAKES OVER WIRING – ASSETS, DEPS, COMBO HANDLING, LIFE CYCLES PRODUCTION READINESS: LOGGING, SERVER MONITORING, UNIT TESTING FRAMEWORK (GRUNT-CASTLE) TRANSITION: SO LET’S TAKE A CLOSER LOOK AT THE STACK.
  10. MESSAGE: AT A VERY HIGH LEVEL THIS IS LAZO. Primary libs Vertical stack are the major parts of a Lazo application Horizontal stack is a division of duties; most of it is shared TRANSITION: LETS TAKE A DEEPER DIVE INTO THE APPLICATION PIECES.
  11. MESSAGE: THE POINT OF THE APPLICATION IS TIE THINGS TOGETHER. STRUCTURE – makes it easy to understand and find things WIRING – allows you to focus on developing your application vs. gluing it together ASSETS – makes internationalization and including resources such as strings and images easy; CSS and JS as well CONFIGURATION – allows you to easily configure your application for different environments INITIALIZATION – a hook point for doing any work that needs to be done on application start up TRANSITION: IN A NUTSHELL THAT THE POINT OF THE APPLICATION OBJECT. LET’S TAKE A LOOK AT ANOTHER MAJOR PLAYER IN THE STACK, THE COMPONENT.
  12. MESSAGE: THESE ARE NOT WEB COMPONENTS. THESE ARE LAZO COMPONENTS WHICH HOOK INTO THE RENDER LIFE CYCLE TO REALLY JUST RETURN MARKUP TO A PLACE IN THE REQUEST RESPONSE. LIFE CYCLE - this is key to ensuring that rendering and request response happen in a consistent manner allowing you to focus on your application BUSINESS LOGIC – this goes in the component controller as opposed to stuffing things in a view object; all views get access to the controller that instantiated them EVENTS – this allows for communication between components on the client TRANSITION: WE COVERED THE OVERALL STRUCTURE VIA THE APPLICATION AND THE ECAPSULATION AND REUSAGE FROM THE COMPONENTS LETS TAKE A LOOK AT HOW LAZO MODELS DATA.
  13. MESSAGE: CARRYING THE SAME EXAMPLE FORWARD LETS TAKE A LOOK AT HOW MODELS AND COLLECTIONS FIT INTO A COMPONENT. TUNNEL - no more CORS SHORT CIRCUIT – dedup and load from client cache OPTIONAL SYNCHER – data aggregation and manipulation on the server TRANSITION: THESE ARE THE BASIC BUILDING BLOCKS OF A LAZO APPLICATION.
  14. MESSAGE: BUT WHY LAZO? WHAT IS THIS GIVING ME? TRANSITION: LETS TAKE A LOOK AT SOME OF THE REQUIREMENTS FOR OUR USE CASE IN THE CONTEXT OF LAZO.
  15. MESSAGE: REMEMBER SEO? SOLUTION - indexable ENGINEERING – no more classic app and SPA didn’t work; no duplication; less engineering cost BUSINESS – if a user can’t find your content then there is 0% chance for revenue TRANSITION: ON TO OUR NEXT USE CASE
  16. MESSAGE: HOW MANY PEOPLE DIDN’T LIKE THAT DELAY? HOW MANY PEOPLE THINK THAT THEIR USERS DON’T LIKE THAT DELAY? SOLUTION - killing two birds with one stone ENGINEERING – no fetching data from the client; it is already there BUSINESS –more revenue opportunities TRANSITION: LETS TAKE A LOOK AT ONE MORE USE CASE.
  17. MESSAGE: IMAGINE THAT THE USER FOUND YOUR PRODUCT BECAUSE OF GREAT SEO. ADDED IT TO THEIR CART BECAUSE THE PAGE LOADED QUICKLY. NOW THE FINAL STEP IS CONVERSION. SOLUTION - FASTER. since our code runs on both the server and client we can execute it on the client for subsequent page requests; using models if they exist on the client ENGINEERING – less server processing BUSINESS – an increase in revenue TRANSITION: WHAT DOES SOLVING THE USE CASE REALLY PROVIDE YOU?
  18. INCREASED SALES AND/OR ADVERTISING REVENUE DECREASED ENGINEERING COSTS INCEASE SHAREHOLDER WEALTH
  19. AS PROMISED LETS DIVE INTO SOME CODE EXAMPLES HOW MANY OF YOU ARE FAMILIAR WITH TODOMVC?
  20. THIS IS NEW. THERE IS ROOM FOR IMPROVEMENT. THESE ARE JUST SOME THE THINGS WE ARE LOOKING AT. WE NEED HELP.
  21. HOW ARE WE DOING ON TIME?
  22. I AM GOING TO WALK THROUGH THE FIRST PAGE REQUEST AT A HIGH LEVEL
  23. IF A BROWSER SUPPORTS THE HISTORY API THEN IT WILL EXECUTE ON THE CLIENT. IF NOT IT AUTOMATICALLY FALLS BACK TO SERVER RENDERING. FORWARD THINKING APPROACH.
  24. NO CORS. EVERYTHING GOES THROUGH A TUNNEL.
  25. HERE IS AN EXAMPLE USE CASE OF A PROXY
  26. TODO: move diagrams to appendix; reusage
  27. TODO: move diagrams to appendix; reusage