SlideShare a Scribd company logo
@leggetter#HTML5AtScale
How to Build Single Page HTML5 Apps that Scale
Phil Leggetter
@leggetter
Caplin Systems
How to Build Single Page HTML5 Apps that Scale
@leggetter#HTML5AtScale
bladerunnerjs.org
OpenSource
What is a large-scale
Single Page HTML5 App?
@leggetter#HTML5AtScale
–Addy Osmani, Patterns For Large-Scale JavaScript Application
Architecture
In my view, large-scale JavaScript apps are non-
trivial applications requiring significant developer
effort to maintain, where most heavy lifting of data
manipulation and display falls to the browser.
Large Codebase
More functionality === More code
@leggetter#HTML5AtScale
Caplin Trader
• SDK:
• ~1,000 JavaScript files
• ~131,000 LoC
• ~131 lines per file
• ~650 test files
• ~95,000 test LoC
• Typical Apps:
• ~425 JavaScript files
• ~50,000 LoC
• ~117 lines per file
• ~200 test files
• ~21,000 test LoC
Complexity
How to Build Single Page HTML5 Apps that Scale
How to Build Single Page HTML5 Apps that Scale
@leggetter#HTML5AtScale
Gmail & Caplin Trader
• Large Single Page Apps (SPAs)
• Complex functionality
• Complex interactions
• User
• Technology
• Leave open all day
Features: Change,
Come & Go
Feature Progression
Contributors
The Human Factor
@leggetter#HTML5AtScale
Who contributes to an app?
• Front-end devs
• Back-end devs
• Designers
• QA
• Infrastructure and release engineers
• Technical authors
• Multiple teams
@leggetter#HTML5AtScale
Maintainable?
1. Massive codebase
2. Architecture
3. Contributor harmony
4. Promote quality
5. Productive developer experience
6. ^All complimentary
The Solutions
1. Components/Widgets/Modules/Features
2. A Services Layer
3. MV*
4. Efficient Testing
5. Tools to Support Workflow
@YourTwitterHandle#DVXFR14{session hashtag} @leggetter#HTML5AtScale
Prove
it!
Feature ==> Blade
Finding assets is
hard
/assets /feature-name
Long App Reloads
Image of app partially
workingWho Broke the App?
How to Build Single Page HTML5 Apps that Scale
How to Build Single Page HTML5 Apps that Scale
@leggetter#HTML5AtScale
Features
• Can run in isolation
• Unaffected by breaking changes elsewhere
• Fast reload times
• Easy to find & change assets
Compose
Components/Modules
into Apps
@leggetter#HTML5AtScale
Adding features to Apps
How to Build Single Page HTML5 Apps that Scale
Services
@leggetter#HTML5AtScale
What is a service?
• Use services to access shared resources
• In-app inter-component messaging
• Persistence Service
• RESTful Service
• Realtime Service
• Services are a Contract/Protocol/Interface
Setting & Getting Services
• Use a unique identifier for each service i.e. a simple string
• Register (code or config). Code example:
!
• Get
http://martinfowler.com/articles/injection.html#ADynamicServiceLocator
How to Build Single Page HTML5 Apps that Scale
How to Build Single Page HTML5 Apps that Scale
How to Build Single Page HTML5 Apps that Scale
@leggetter#HTML5AtScale
Why use services?
• Features should not directly communicate
• Easily change implementation
• Implementations can be injected for different scenarios:
• Workbench / Test / App
Fake Services
Fake/Stub/Mock Services
Real Services
Efficient Testing
(We’ll get to MV*)
@leggetter#HTML5AtScale
~2009 Testing Requirements
• Cross-browser IE6+*, Firefox 3.5*+ & Chrome
• Class-level Unit Tests
• Application Acceptance Tests
* Remember this was 2009
@leggetter#HTML5AtScale
@leggetter#HTML5AtScale
Application ATs
• Selenium Tests
• Selenium User-Extensions
• Actions, Accessors/Assertions & Locators
• VM infrastructure for CI
@leggetter#HTML5AtScale
AT Process
3
3. Launch browser + App
1
1. Pair Browser + Backend VM
2
2. Reset & restart backend services
5
5. Record results
4
4. Execute ATs
6
6. Reset backend services
8. Execute next test…
8
7
7. Restart/refresh browser
@leggetter#HTML5AtScale
Test Results
• ~1300 UTs
• ~500 ATs
• 50 VM infrastructure to run tests concurrently
• 8 Hours
• Test results highly unreliable
• We could only run a full suite of tests once per day - at
night
@leggetter#HTML5AtScale
Inefficient Testing!
• Resetting back end services is too slow
• Lots of moving parts. Things can go wrong.
• Services don’t start = app won’t work. Not code but
environment failure.
• We want to avoid IO
• … and querying the DOM
How to Build Single Page HTML5 Apps that Scale
Don’t Touch that DOM
MVVM
End-to-End Module Testing
• Testing features in
isolation
• Change view model
and assert against
mocked Service
• Inject fake service,
make calls and assert
View Model
How to Build Single Page HTML5 Apps that Scale
Need Proof?
Our full suite Caplin Trader
testing time went from
>8 Hours
< 30 minutes
Much less for a single feature
Tooling & Developer Workflow
Focus on Features
How to Build Single Page HTML5 Apps that Scale
What tooling offers?
@leggetter#HTML5AtScale
Automation
• Define workflow & promote consistency
• Scaffolding
• Dev Server
• Builds/Bundling
• Tests
Intelligence
Compliance
@leggetter#HTML5AtScale
Knowledge of Runtime
Scenarios
• Workbench (dev-mode)
• Test
• App
@leggetter#HTML5AtScale
Dependency Analysis
How to Build Single Page HTML5 Apps that Scale
@leggetter#HTML5AtScale
Customisation
• Augment workflow
• Identify allowable change to workflow
• Automation commands
• Builds/Bundling
• Test Runner
@YourTwitterHandle#DVXFR14{session hashtag} @leggetter#HTML5AtScale
Proven!
@leggetter#HTML5AtScale
Proven!
1. Massive codebase - features
2. Architecture - features, services & MVVM
3. Contributor harmony - separation of concerns; codebase
structure, features & architecture
4. Promote quality - features, services & MVVM
5. Productive developer experience - tooling
6. ^All complimentary - Yep!
@leggetter#HTML5AtScale
Thanks / Questions
•Phil @leggetter
•phil@leggetter.co.uk
!
•BladeRunnerJS
•@BladeRunnerJS
•bladerunnerjs.org

More Related Content

What's hot (20)

PPTX
Validating latest changes with XCI
Victor Morales
 
PPTX
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
Enea Gabriel
 
PDF
O365Con18 - SharePoint Framework for Administrators - Waldek Mastykarz
NCCOMMS
 
PPTX
Integration Testing with Selenium
All Things Open
 
PPTX
Migration from ASP.NET MVC to ASP.NET Core
Miroslav Popovic
 
PPTX
Making Angular2 lean and Fast
Vinci Rufus
 
PDF
Serverless Delivery
Casey Lee
 
PDF
Matheus Marsiglio - Isomorphic React + Redux App
React Conf Brasil
 
PPT
Intro to SPA using JavaScript & ASP.NET
Alan Hecht
 
PDF
Turn On The Lights
Postman
 
PPTX
ASP.NET Core Unit Testing
Shahed Chowdhuri
 
PDF
Continuous delivery of your legacy application
ColdFusionConference
 
PPTX
Building a REST Service in minutes with Spring Boot
Omri Spector
 
PDF
CloudBees Continuous Integration and Test with Appvance PerformanceCloud
Clever Moe
 
PPTX
Cypress workshop for JSFoo 2019
Biswajit Pattanayak
 
PPTX
Ruby Real life Perfomance
viy123
 
PPTX
ASP.NET 5 & Unit Testing
Shahed Chowdhuri
 
PDF
Spring insight what just happened
Boulder Java User's Group
 
PPTX
Using REST with VSTS and TFS
Jeff Bramwell
 
PDF
The Apollo and GraphQL Stack
Sashko Stubailo
 
Validating latest changes with XCI
Victor Morales
 
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
Enea Gabriel
 
O365Con18 - SharePoint Framework for Administrators - Waldek Mastykarz
NCCOMMS
 
Integration Testing with Selenium
All Things Open
 
Migration from ASP.NET MVC to ASP.NET Core
Miroslav Popovic
 
Making Angular2 lean and Fast
Vinci Rufus
 
Serverless Delivery
Casey Lee
 
Matheus Marsiglio - Isomorphic React + Redux App
React Conf Brasil
 
Intro to SPA using JavaScript & ASP.NET
Alan Hecht
 
Turn On The Lights
Postman
 
ASP.NET Core Unit Testing
Shahed Chowdhuri
 
Continuous delivery of your legacy application
ColdFusionConference
 
Building a REST Service in minutes with Spring Boot
Omri Spector
 
CloudBees Continuous Integration and Test with Appvance PerformanceCloud
Clever Moe
 
Cypress workshop for JSFoo 2019
Biswajit Pattanayak
 
Ruby Real life Perfomance
viy123
 
ASP.NET 5 & Unit Testing
Shahed Chowdhuri
 
Spring insight what just happened
Boulder Java User's Group
 
Using REST with VSTS and TFS
Jeff Bramwell
 
The Apollo and GraphQL Stack
Sashko Stubailo
 

Similar to How to Build Single Page HTML5 Apps that Scale (20)

PDF
How to Build Front-End Web Apps that Scale - FutureJS
Phil Leggetter
 
PDF
Building front-end apps that Scale - FOSDEM 2014
Phil Leggetter
 
PDF
Visual Regression Testing at the Speed of Unit Testing -- by Gil Tayar
Applitools
 
PDF
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Phil Leggetter
 
PDF
Extreme Web Performance for Mobile Devices - Velocity NY
Maximiliano Firtman
 
PDF
Extreme Web Performance for Mobile Device Fluent 2015
Maximiliano Firtman
 
PDF
Optimizing web performance (Fronteers edition)
Dave Olsen
 
PDF
Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014
Maximiliano Firtman
 
PPTX
Web Application Software Testing
Andrew Kandels
 
PPTX
Testing Single Page Webapp
Akshay Mathur
 
PPTX
The New Renaissance of JavaScript
Hamlet Batista
 
PDF
Testing Ginormous JavaScript Apps - ScotlandJS 2014
Phil Leggetter
 
PDF
Rubbing the Sankara Stones the wrong way - From the Front 2014
Christian Heilmann
 
PPTX
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Learnosity
 
PPTX
Optimizing Browser Rendering
michael.labriola
 
PDF
Velocity building a performance lab for mobile apps in a day - final
Ashray Mathur
 
PDF
Create an architecture for web test automation
Elias Nogueira
 
PPTX
Mobile gotcha
phegaro
 
PPTX
Tales from the Dark Side: Ori Bendet Selenium Conference India 2016
Ori Bendet
 
PDF
Desarrollo de apps multiplataforma con tecnologías web
Software Guru
 
How to Build Front-End Web Apps that Scale - FutureJS
Phil Leggetter
 
Building front-end apps that Scale - FOSDEM 2014
Phil Leggetter
 
Visual Regression Testing at the Speed of Unit Testing -- by Gil Tayar
Applitools
 
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Phil Leggetter
 
Extreme Web Performance for Mobile Devices - Velocity NY
Maximiliano Firtman
 
Extreme Web Performance for Mobile Device Fluent 2015
Maximiliano Firtman
 
Optimizing web performance (Fronteers edition)
Dave Olsen
 
Extreme Web Performance for Mobile Devices - Velocity Barcelona 2014
Maximiliano Firtman
 
Web Application Software Testing
Andrew Kandels
 
Testing Single Page Webapp
Akshay Mathur
 
The New Renaissance of JavaScript
Hamlet Batista
 
Testing Ginormous JavaScript Apps - ScotlandJS 2014
Phil Leggetter
 
Rubbing the Sankara Stones the wrong way - From the Front 2014
Christian Heilmann
 
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Learnosity
 
Optimizing Browser Rendering
michael.labriola
 
Velocity building a performance lab for mobile apps in a day - final
Ashray Mathur
 
Create an architecture for web test automation
Elias Nogueira
 
Mobile gotcha
phegaro
 
Tales from the Dark Side: Ori Bendet Selenium Conference India 2016
Ori Bendet
 
Desarrollo de apps multiplataforma con tecnologías web
Software Guru
 
Ad

More from Phil Leggetter (19)

PDF
An Introduction to AAARRRP: A framework for Defining Your Developer Relations...
Phil Leggetter
 
PDF
How APIs Enable Contextual Communications
Phil Leggetter
 
PDF
An Introduction to the AAARRRP Developer Relations Strategy Framework and How...
Phil Leggetter
 
PDF
An Introduction to the AAARRRP Developer Relations Strategy Framework and How...
Phil Leggetter
 
PDF
Contextual Communications: What, Why and How? Bristol JS
Phil Leggetter
 
PDF
Real-Time Web Apps & .NET. What Are Your Options? NDC Oslo 2016
Phil Leggetter
 
PDF
Real-Time Web Apps & .NET - What are your options?
Phil Leggetter
 
PDF
The Past, Present and Future of Real-Time Apps and Communications
Phil Leggetter
 
PDF
The Past, Present and Future of Real-Time Apps and Communications
Phil Leggetter
 
PDF
What's the ROI of Developer Relations?
Phil Leggetter
 
PDF
Real-Time Web Apps & Symfony. What are your options?
Phil Leggetter
 
PDF
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Phil Leggetter
 
PDF
Real-Time Web Apps in 2015 & Beyond
Phil Leggetter
 
PDF
Why you should be using Web Components. And How - DevWeek 2015
Phil Leggetter
 
PDF
Realtime Web Apps in 2014 & Beyond
Phil Leggetter
 
PDF
BladeRunnerJS Show & Tell
Phil Leggetter
 
PDF
What Developers Want - Developers Want Realtime - BAPI 2012
Phil Leggetter
 
PDF
How the Realtime Web is influencing the future of communications
Phil Leggetter
 
PDF
Web browsers & the realtime web
Phil Leggetter
 
An Introduction to AAARRRP: A framework for Defining Your Developer Relations...
Phil Leggetter
 
How APIs Enable Contextual Communications
Phil Leggetter
 
An Introduction to the AAARRRP Developer Relations Strategy Framework and How...
Phil Leggetter
 
An Introduction to the AAARRRP Developer Relations Strategy Framework and How...
Phil Leggetter
 
Contextual Communications: What, Why and How? Bristol JS
Phil Leggetter
 
Real-Time Web Apps & .NET. What Are Your Options? NDC Oslo 2016
Phil Leggetter
 
Real-Time Web Apps & .NET - What are your options?
Phil Leggetter
 
The Past, Present and Future of Real-Time Apps and Communications
Phil Leggetter
 
The Past, Present and Future of Real-Time Apps and Communications
Phil Leggetter
 
What's the ROI of Developer Relations?
Phil Leggetter
 
Real-Time Web Apps & Symfony. What are your options?
Phil Leggetter
 
Why You Should be Using Web Components Right Now. And How. ForwardJS July 2015
Phil Leggetter
 
Real-Time Web Apps in 2015 & Beyond
Phil Leggetter
 
Why you should be using Web Components. And How - DevWeek 2015
Phil Leggetter
 
Realtime Web Apps in 2014 & Beyond
Phil Leggetter
 
BladeRunnerJS Show & Tell
Phil Leggetter
 
What Developers Want - Developers Want Realtime - BAPI 2012
Phil Leggetter
 
How the Realtime Web is influencing the future of communications
Phil Leggetter
 
Web browsers & the realtime web
Phil Leggetter
 
Ad

Recently uploaded (20)

PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PDF
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
PDF
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
PDF
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
Essential Content-centric Plugins for your Website
Laura Byrne
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
🚀 Let’s Build Our First Slack Workflow! 🔧.pdf
SanjeetMishra29
 
CapCut Pro PC Crack Latest Version Free Free
josanj305
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
“ONNX and Python to C++: State-of-the-art Graph Compilation,” a Presentation ...
Edge AI and Vision Alliance
 
Linux schedulers for fun and profit with SchedKit
Alessio Biancalana
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
NASA A Researcher’s Guide to International Space Station : Fundamental Physics
Dr. PANKAJ DHUSSA
 
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Essential Content-centric Plugins for your Website
Laura Byrne
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 

How to Build Single Page HTML5 Apps that Scale