SlideShare a Scribd company logo
Patterns and practices for building
enterprise-scale HTML5 apps
Phil @leggetter
phil@pusher.com
phil@pusher.com
Join the conversation on Twitter: @DevWeek #DW2015
Agenda
• Talk & Demos
• Questions anytime*
• Q&A
• Practical
Phil @leggetter
phil@pusher.com
Chief Devangelist
Patterns and practices that fed into the workflows
and application architecture that was core to the
BladeRunnerJS toolkit.
Patterns and practices for building enterprise-scale HTML5 apps
bladerunnerjs.org
OpenSource
What is a large-scale
JavaScript app?
–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
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
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 apps
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
Who contributes to an app?
• Front-end devs
• Back-end devs
• Designers
• QA
• Infrastructure and release engineers
• Technical authors
Maintainable?
1. Massive codebase
2. Architecture
3. Contributor harmony
4. Promote quality
5. Productive developer experience
6. ^All complimentary
The Solution
“Write small, focused, modular
parts, and progressively combine
them into bigger things to make
your app”
@substack | @briantford
The Solutions
1. Components/Widgets/Modules
2. A Services Layer
3. MV*
4. Efficient Testing
5. Tools to Support Workflow
Prove it!
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 apps
Feature ==> Blade
What Problems is
this solving?
Slice up the App
Image of app partially
workingWho Broken the
App?
Long App Reloads
Finding assets
is hard
/assets /feature-name
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 apps
Features
• Unaffected by breaking changes elsewhere
• Easy to find & change assets
• Can run in isolation
• Fast reload times
DEMO
Create a Feature
Compose
Components/
Modules into Apps
Patterns and practices for building enterprise-scale HTML5 apps
DEMO
Add a Feature to an Aspect
Services
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
Services are a Contract/Protocol/Interface
https://www.youtube.com/watch?v=JjqKQ8ezwKQ
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 apps
Using Services
• Use a unique identifier for each service
• Register (code or config). Code example:
• Get
http://martinfowler.com/articles/injection.html#ADynamicServiceLocator
var chatService = require( ‘service!chat.service’ );
DEMO
Using Services
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*)
Caplin Dev Practices
• Multiple contributing teams
• SCRUM - 2 week iteration
• Continuous Integration & Delivery
• Build status displayed on screen
• A focus on Quality Software
~2009 Testing Requirements
• Cross-browser IE6+*, Firefox 3.5*+ & Chrome
• Class-level Unit Tests
• Application Acceptance Tests
* Remember this was 2009
Patterns and practices for building enterprise-scale HTML5 apps
Application ATs
• Selenium Tests
• Selenium User-Extensions
• Actions, Accessors/Assertions & Locators
• VM infrastructure for CI
3
3. Launch browser + App
AT Process
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
Test Results
• ~1300 UTs
• ~500 ATs
• 10 pairs - VM infrastructure to parallelise tests
• 8 Hours
• We could only run a full suite of
tests once per day - at night
• Test results highly unreliable
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
Patterns and practices for building enterprise-scale HTML5 apps
Don’t Touch that DOM
Patterns and practices for building enterprise-scale HTML5 apps
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
Patterns and practices for building enterprise-scale HTML5 apps
Need Proof?
Our full suite Caplin Trader
testing time went from
>8 Hours
< 30 minutes
Much less for a single
feature
http://j.mp/jsscale
Tooling & Developer
Workflow
Focus on Features
Patterns and practices for building enterprise-scale HTML5 apps
What tooling offers?
Automation
• Define workflow & promote consistency
• Scaffolding
• Dev Server
• Builds/Bundling
• Tests
Compliance
Embrace
Constraints
https://gettingreal.37signals.com/ch03_Embrace_Constraints.php
Intelligence
Knowledge of Runtime
Scenarios
• Workbench (dev-mode)
• Test
• App
Dependency Analysis
Dependency Analysis
Customization
• Augment workflow
• Identify allowable change to workflow
• Automation commands
• Builds/Bundling
• Test Runner
DEMO
Tooling
1. Large codebase - By Feature: Component/Service
2. Complex interactions - Components & Services
3. Contributor harmony - Components, Services & Tooling
4. Evolution of Features & Technology - Components (e.g render
tech separation) & Services (common abstractions)
5. Productive developer experience - Tooling to support workflow &
concepts
6. Promote Quality - MVVM, Services and tooling. Facilitated by all of
the above
Proven!
Thanks & Questions?
Phil @leggetter
phil@pusher.com
Practical
• Get USB sticks from me
• Or… go speak to the BladeRunnerJS team
Patterns and practices for building
enterprise-scale HTML5 apps
Phil @leggetter
phil@pusher.com
phil@pusher.com
Join the conversation on Twitter: @DevWeek #DW2015

More Related Content

What's hot (20)

PPTX
Load testing with Visual Studio and Azure - Andrew Siemer
Andrew Siemer
 
PPTX
Develop a Basic REST API from Scratch Using TDD with Val Karpov
MongoDB
 
PDF
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha
 
PPTX
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
PDF
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
Vadym Kazulkin
 
PPTX
Web based automation testing on Node.js environment
Yu-Lin Huang
 
PPTX
ASP.NET 5 & Unit Testing
Shahed Chowdhuri
 
PPTX
Top10 Characteristics of Awesome Apps
Casey Lee
 
PPTX
Alfresco Process Services (APS) and the Internet of Things
Nathan McMinn
 
PPTX
End to end test automation with cypress
Kushan Shalindra Amarasiri - Technical QE Specialist
 
PPTX
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
Vincent Biret
 
PPTX
Our First ADF Experience
Hans De Bal
 
PPTX
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
Sencha
 
PPTX
Alfresco Digital Business Platform - Why, How, What
Mario Romano
 
PPTX
How to build a JavaScript toolkit
Michael Nelson
 
PDF
Common design principles and design patterns in automation testing
KMS Technology
 
PDF
Sexy React Stack
KMS Technology
 
PPTX
Operations Validation for Infrastructure As Code - PSConfEU 2016
Ravikanth Chaganti
 
PPTX
TUTTO SU VISUAL STUDIO ALM 2015
DotNetCampus
 
PDF
Lessons learned: Choosing your documentation system
Pronovix
 
Load testing with Visual Studio and Azure - Andrew Siemer
Andrew Siemer
 
Develop a Basic REST API from Scratch Using TDD with Val Karpov
MongoDB
 
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha
 
Test Automation Framework with BDD and Cucumber
Rhoynar Software Consulting
 
FaaS or not to FaaS. Visible and invisible benefits of the Serverless paradig...
Vadym Kazulkin
 
Web based automation testing on Node.js environment
Yu-Lin Huang
 
ASP.NET 5 & Unit Testing
Shahed Chowdhuri
 
Top10 Characteristics of Awesome Apps
Casey Lee
 
Alfresco Process Services (APS) and the Internet of Things
Nathan McMinn
 
End to end test automation with cypress
Kushan Shalindra Amarasiri - Technical QE Specialist
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
Vincent Biret
 
Our First ADF Experience
Hans De Bal
 
SenchaCon 2016: Cross-Platform Mobile App Development with Cordova and Visual...
Sencha
 
Alfresco Digital Business Platform - Why, How, What
Mario Romano
 
How to build a JavaScript toolkit
Michael Nelson
 
Common design principles and design patterns in automation testing
KMS Technology
 
Sexy React Stack
KMS Technology
 
Operations Validation for Infrastructure As Code - PSConfEU 2016
Ravikanth Chaganti
 
TUTTO SU VISUAL STUDIO ALM 2015
DotNetCampus
 
Lessons learned: Choosing your documentation system
Pronovix
 

Similar to Patterns and practices for building enterprise-scale HTML5 apps (20)

PDF
Fed London - January 2015
Phil Leggetter
 
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
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Phil Leggetter
 
PDF
How to Build Single Page HTML5 Apps that Scale
Phil Leggetter
 
PDF
Scaling mobile dev teams
Priyank Gupta
 
PPTX
Building Advanced Web UI in The Enterprise World
efim13
 
PDF
Product! - The road to production deployment
Filippo Zanella
 
PDF
Architecting for Enterprise with JavaScript
Kurtis Kemple
 
PDF
Building a full-stack app with Golang and Google Cloud Platform in one week
Dr. Felix Raab
 
PPTX
Writing a massive javascript app
Justin Park
 
PPTX
Writing better tests for your java script app
JakeGinnivan
 
PDF
(Ebook) JavaScript Application Design: A Build First Approach by Nicolas Be...
hakwonjoxido51
 
PPTX
Node.js Dublin Meetup April 2014
Damian Beresford
 
PDF
James Turner (Caplin) - Enterprise HTML5 Patterns
akqaanoraks
 
PPTX
Large scale agile development practices
Skills Matter
 
PDF
Visual Regression Testing at the Speed of Unit Testing -- by Gil Tayar
Applitools
 
PDF
Scaling Mobile Engineering
Deniz Veli
 
KEY
corporateJavascript
climboid
 
PDF
Building application in a "Microfrontends" way - Matthias Lauf *XConf Manchester
Thoughtworks
 
Fed London - January 2015
Phil Leggetter
 
How to Build Front-End Web Apps that Scale - FutureJS
Phil Leggetter
 
Building front-end apps that Scale - FOSDEM 2014
Phil Leggetter
 
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Phil Leggetter
 
How to Build Single Page HTML5 Apps that Scale
Phil Leggetter
 
Scaling mobile dev teams
Priyank Gupta
 
Building Advanced Web UI in The Enterprise World
efim13
 
Product! - The road to production deployment
Filippo Zanella
 
Architecting for Enterprise with JavaScript
Kurtis Kemple
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Dr. Felix Raab
 
Writing a massive javascript app
Justin Park
 
Writing better tests for your java script app
JakeGinnivan
 
(Ebook) JavaScript Application Design: A Build First Approach by Nicolas Be...
hakwonjoxido51
 
Node.js Dublin Meetup April 2014
Damian Beresford
 
James Turner (Caplin) - Enterprise HTML5 Patterns
akqaanoraks
 
Large scale agile development practices
Skills Matter
 
Visual Regression Testing at the Speed of Unit Testing -- by Gil Tayar
Applitools
 
Scaling Mobile Engineering
Deniz Veli
 
corporateJavascript
climboid
 
Building application in a "Microfrontends" way - Matthias Lauf *XConf Manchester
Thoughtworks
 
Ad

More from Phil Leggetter (20)

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
Testing Ginormous JavaScript Apps - ScotlandJS 2014
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
 
Testing Ginormous JavaScript Apps - ScotlandJS 2014
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)

PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Digital Circuits, important subject in CS
contactparinay1
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 

Patterns and practices for building enterprise-scale HTML5 apps