SlideShare a Scribd company logo
1 of 20
Developing Large Scale 
Applications in AngularJS 
Yes, it’s possible! 
Shyam Seshadri 
CEO, Fundoo Solutions (http://www.befundoo.com) 
@omniscient1
AngularJS – It’s not just for toy 
apps
Who am I? 
Entrepreneur 
http://www.befundoo.com 
Xoogler 
Author
Currently @ 
AngularJS & NodeJS 
• Architecture Consulting 
• Development Consulting 
• Hands-on Workshops 
Product Development 
• Mobile & Web 
Evangelism 
• Latest & Greatest Technologies
Agenda 
 AngularJS – Why it’s amazing 
 The difference between a small and large app 
 Structuring your AngularJS Project 
 Common Bottlenecks in Web Applications 
 Speeding up your web application
AngularJS – 5 great things 
• Less code, more work - Data Binding 
• HTML for templating – Directives 
• Separating your concerns – MVC 
• Ease of testing – Karma, Jasmine, Protractor 
• Brilliant community – Anywhere, Everywhere
When an app grows too big 
Small App (~1000’s LOC) 
• Tiny, Fast 
• Easy to develop 
• Testing is trivial 
• Simple project structure 
works 
Large App (~10K-50K LOC) 
• Large 
• Can quickly become 
unmaintainable 
• Can be prone to bugs 
• Project Structure hard to 
scale if base is not good 
• Testing requires thought
Structuring a Large AngularJS Project 
High Level Thoughts 
• Modular approach 
• Independent, reusable modules 
• All necessary files together 
• Conceptually 
• Components – Reusable, not specific to a view 
• Sections – Controllers, HTML, directly for a view 
• Tests right beside the code
A Sample Large App Structure 
ChallengeApp 
• components 
• auth 
• auth.service.js 
• auth.service_spec.js 
• ui 
• fileupload 
• fileupload.directive.js 
• fileupload.directive.tpl.html 
• fileupload.directive.css 
• fileupload.directive_spec.js
A Sample Large App Structure 
ChallengeApp 
• sections 
• home 
• home.html 
• home.controller.js 
• home.controller_spec.js 
• home.css 
• list 
• list.html 
• list.controller.js 
• list.controller_spec.js 
• list.css 
• app.js 
• main.css 
• index.html
How to write slow web applications 
Load lots of 
scripts and css 
(in head!) 
Slow 
subsequent 
loads 
Heavy DOM 
Rendering / 
Manipulation 
Bad CSS 
Angular – Too 
many watchers 
/ scopes
The Easy stuff 
• Load CSS in HEAD 
• Load JS at end of BODY Order 
• Concat/Minify/Gzip files and then load 
• Not too many parallel requests 
• Lazy load if too many / too large files 
Network 
• Reduce content in UI 
• Reduce watchers / expensive 
bindings 
DOM
A Quick Case Study - EPG 
• Program Grid (x by y) 
• 500 channels 
• 14 days, half hour slots 
EPG 
• Smooth scrolling 
• Minimal Loading indicators / stops 
• Different states for each program 
• IE8 Support 
Requirement
First Attempt at EPG 
• ng-repeat within ng-repeat 
• ng-class & ng-bind for all program data 
• Load data upfront 
• Time to render : ~6 seconds!!! 
• http://plnkr.co/edit/BLFb1O?p=preview 
• With polling to refresh the data 
• http://plnkr.co/edit/SebQIW?p=preview
The Bottlenecks 
Initial Data 
Load 
ng-repeat not 
optimal for 
large data sets 
DOM 
manipulation & 
Re-rendering 
# of watchers
Analyzing the ng-repeat effect 
• What if we completely dropped ng-repeat? 
• Use jQuery and manual HTML manipulation 
• Would things speed up? 
• http://plnkr.co/edit/mVpuPu?p=preview
Simple Optimizations in AngularJS 
Use track by 
syntax with ng-repeat 
bindOnce if 
data is not 
going to change 
ng-if over ng-show/ 
ng-hide 
Reduce 
watchers / bind 
expressions
Optimizing the Grid – What we did 
• Data was fetch & display 
• Did not change after initial load 
• Moved to custom directive without ng-bind 
& ng-repeat 
• Lazy Loading 
• Placeholders for content out of view 
• Load as and when needed 
• Cache Priming 
• Preload views beside current as & when 
time permits
Things to keep in mind 
• CSS / JS Minification 
• Lazy Loading, if needed 
• Proper structure & build process upfront 
Build / 
Deploy 
• Avoid too many parallel requests 
• Gzip / Caching strategies 
• Cache Priming Network 
• Reduce DOM elements in UI 
• Reduce watchers / expensive bindings 
• Data-binding – Use bind-once when possible DOM
Thank You! 
Shyam Seshadri 
Fundoo Solutions 
@omniscient1

More Related Content

What's hot

React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
Marcin Grzywaczewski
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and Beyond
Spike Brehm
 
Choosing the best JavaScript framework/library/toolkit
Choosing the best JavaScript framework/library/toolkitChoosing the best JavaScript framework/library/toolkit
Choosing the best JavaScript framework/library/toolkit
Hristo Chakarov
 

What's hot (20)

Transforming Front-End Disaster Code™ Into A Maintainable Masterpiece
Transforming Front-End Disaster Code™ Into A Maintainable MasterpieceTransforming Front-End Disaster Code™ Into A Maintainable Masterpiece
Transforming Front-End Disaster Code™ Into A Maintainable Masterpiece
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 
Introduction to require js
Introduction to require jsIntroduction to require js
Introduction to require js
 
React Native
React NativeReact Native
React Native
 
Modern javascript
Modern javascriptModern javascript
Modern javascript
 
How NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscapeHow NOT to get lost in the current JavaScript landscape
How NOT to get lost in the current JavaScript landscape
 
AngularJS + React
AngularJS + ReactAngularJS + React
AngularJS + React
 
Angular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFxAngular vs React: Building modern SharePoint interfaces with SPFx
Angular vs React: Building modern SharePoint interfaces with SPFx
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
jQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript TestingjQuery Chicago 2014 - Next-generation JavaScript Testing
jQuery Chicago 2014 - Next-generation JavaScript Testing
 
Building a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and BeyondBuilding a Single-Page App: Backbone, Node.js, and Beyond
Building a Single-Page App: Backbone, Node.js, and Beyond
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison
 
Mean Stack - An Overview
Mean Stack - An OverviewMean Stack - An Overview
Mean Stack - An Overview
 
Adobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - IntroductionAdobe CQ5 for Developers - Introduction
Adobe CQ5 for Developers - Introduction
 
Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?Angular 2 vs React. What to chose in 2017?
Angular 2 vs React. What to chose in 2017?
 
Choosing the best JavaScript framework/library/toolkit
Choosing the best JavaScript framework/library/toolkitChoosing the best JavaScript framework/library/toolkit
Choosing the best JavaScript framework/library/toolkit
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
 
The Dark Side of Single Page Applications
The Dark Side of Single Page ApplicationsThe Dark Side of Single Page Applications
The Dark Side of Single Page Applications
 
React Vs AnagularJS
React Vs AnagularJSReact Vs AnagularJS
React Vs AnagularJS
 
React basic by Yoav Amit, Wix
React basic by Yoav Amit, Wix React basic by Yoav Amit, Wix
React basic by Yoav Amit, Wix
 

Viewers also liked

How to contribute back to Drupal
How to contribute back to DrupalHow to contribute back to Drupal
How to contribute back to Drupal
Ravindra Singh
 

Viewers also liked (20)

Comparison -- Drupal Theming and TYPO3 Theming
Comparison -- Drupal Theming and TYPO3 Theming Comparison -- Drupal Theming and TYPO3 Theming
Comparison -- Drupal Theming and TYPO3 Theming
 
[Webinar] Scientific Computation and Data Visualization with Ruby
[Webinar] Scientific Computation and Data Visualization with Ruby [Webinar] Scientific Computation and Data Visualization with Ruby
[Webinar] Scientific Computation and Data Visualization with Ruby
 
[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion
[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion
[Srijan Wednesday Webinars] Building Full-Fledged Native Apps Using RubyMotion
 
[Srijan Wednesday Webinars] The Fundamentals of ReactJS
[Srijan Wednesday Webinars] The Fundamentals of ReactJS[Srijan Wednesday Webinars] The Fundamentals of ReactJS
[Srijan Wednesday Webinars] The Fundamentals of ReactJS
 
[Srijan Wednesday Webinars] Strategies to Help You Scale Agile
[Srijan Wednesday Webinars] Strategies to Help You Scale Agile[Srijan Wednesday Webinars] Strategies to Help You Scale Agile
[Srijan Wednesday Webinars] Strategies to Help You Scale Agile
 
Starting a Drupal 8 Project? Let’s do a Technical Discovery - DrupalConAsia 2...
Starting a Drupal 8 Project? Let’s do a Technical Discovery - DrupalConAsia 2...Starting a Drupal 8 Project? Let’s do a Technical Discovery - DrupalConAsia 2...
Starting a Drupal 8 Project? Let’s do a Technical Discovery - DrupalConAsia 2...
 
My Agile Story - Presentation at AgileNCR 2013
My Agile Story - Presentation at AgileNCR 2013My Agile Story - Presentation at AgileNCR 2013
My Agile Story - Presentation at AgileNCR 2013
 
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
[Srijan Wednesday Webinar] Mastering Drupal 8 Development with Drupal Console
 
How to contribute back to Drupal
How to contribute back to DrupalHow to contribute back to Drupal
How to contribute back to Drupal
 
[Srijan Wednesday Webinar] Easy Performance Wins for Your Rails App
[Srijan Wednesday Webinar] Easy Performance Wins for Your Rails App[Srijan Wednesday Webinar] Easy Performance Wins for Your Rails App
[Srijan Wednesday Webinar] Easy Performance Wins for Your Rails App
 
[Srijan Wednesday Webinars] Transitioning to an Organization-wide Agile Culture
[Srijan Wednesday Webinars] Transitioning to an Organization-wide Agile Culture[Srijan Wednesday Webinars] Transitioning to an Organization-wide Agile Culture
[Srijan Wednesday Webinars] Transitioning to an Organization-wide Agile Culture
 
[Srijan Wednesday Webinars] Unraveling Drupal as a Versatile Enterprise Solution
[Srijan Wednesday Webinars] Unraveling Drupal as a Versatile Enterprise Solution[Srijan Wednesday Webinars] Unraveling Drupal as a Versatile Enterprise Solution
[Srijan Wednesday Webinars] Unraveling Drupal as a Versatile Enterprise Solution
 
Srijan gets coverage in "The Economist"
Srijan gets coverage in "The Economist"Srijan gets coverage in "The Economist"
Srijan gets coverage in "The Economist"
 
[Srijan Wednesday Webinars] Meet Commerce 2.X
[Srijan Wednesday Webinars]  Meet Commerce 2.X[Srijan Wednesday Webinars]  Meet Commerce 2.X
[Srijan Wednesday Webinars] Meet Commerce 2.X
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
 
[Srijan Wednesday Webinars] Why Enterprises Should Embrace Distributed Agile ...
[Srijan Wednesday Webinars] Why Enterprises Should Embrace Distributed Agile ...[Srijan Wednesday Webinars] Why Enterprises Should Embrace Distributed Agile ...
[Srijan Wednesday Webinars] Why Enterprises Should Embrace Distributed Agile ...
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
 
[Srijan Wednesday Webinars] Native CRM Systems on Drupal: Now & in the Future
[Srijan Wednesday Webinars] Native CRM Systems on Drupal: Now & in the Future[Srijan Wednesday Webinars] Native CRM Systems on Drupal: Now & in the Future
[Srijan Wednesday Webinars] Native CRM Systems on Drupal: Now & in the Future
 
[Srijan Wednesday Webinars] NASA, Netflix, Tinder: Digital Transformation and...
[Srijan Wednesday Webinars] NASA, Netflix, Tinder: Digital Transformation and...[Srijan Wednesday Webinars] NASA, Netflix, Tinder: Digital Transformation and...
[Srijan Wednesday Webinars] NASA, Netflix, Tinder: Digital Transformation and...
 
[Srijan Wednesday Webinars] Drupal 8: Goodbye to 10 Years of Theming Headaches
[Srijan Wednesday Webinars] Drupal 8: Goodbye to 10 Years of Theming Headaches[Srijan Wednesday Webinars] Drupal 8: Goodbye to 10 Years of Theming Headaches
[Srijan Wednesday Webinars] Drupal 8: Goodbye to 10 Years of Theming Headaches
 

Similar to [Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS

Architecting for Hyper Growth and Great Engineering Culture
Architecting for Hyper Growth and Great Engineering CultureArchitecting for Hyper Growth and Great Engineering Culture
Architecting for Hyper Growth and Great Engineering Culture
ifnu bima
 
Getting started with dev tools (atl)
Getting started with dev tools (atl)Getting started with dev tools (atl)
Getting started with dev tools (atl)
Thinkful
 

Similar to [Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS (20)

Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
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
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
 
Mobile web performance dwx13
Mobile web performance dwx13Mobile web performance dwx13
Mobile web performance dwx13
 
Web Performance Optimization (WPO)
Web Performance Optimization (WPO)Web Performance Optimization (WPO)
Web Performance Optimization (WPO)
 
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...Measure and Increase Developer Productivity with Help of Serverless at AWS Co...
Measure and Increase Developer Productivity with Help of Serverless at AWS Co...
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11
 
Surrogate dependencies (in node js) v1.0
Surrogate dependencies  (in node js)  v1.0Surrogate dependencies  (in node js)  v1.0
Surrogate dependencies (in node js) v1.0
 
Angular.js in XPages
Angular.js in XPagesAngular.js in XPages
Angular.js in XPages
 
Conquering AngularJS Limitations
Conquering AngularJS LimitationsConquering AngularJS Limitations
Conquering AngularJS Limitations
 
Conquering AngularJS Limitations
Conquering AngularJS LimitationsConquering AngularJS Limitations
Conquering AngularJS Limitations
 
Architecting for Huper Growth and Great Engineering Culture
Architecting for Huper Growth and Great Engineering CultureArchitecting for Huper Growth and Great Engineering Culture
Architecting for Huper Growth and Great Engineering Culture
 
Architecting for Hyper Growth and Great Engineering Culture
Architecting for Hyper Growth and Great Engineering CultureArchitecting for Hyper Growth and Great Engineering Culture
Architecting for Hyper Growth and Great Engineering Culture
 
10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today10 Things You Can Do to Speed Up Your Web App Today
10 Things You Can Do to Speed Up Your Web App Today
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
Getting started with dev tools (atl)
Getting started with dev tools (atl)Getting started with dev tools (atl)
Getting started with dev tools (atl)
 

More from Srijan Technologies

[Srijan Wednesday Webinar] Building BPMN Web Portals with Camunda and Drupal
[Srijan Wednesday Webinar] Building BPMN Web Portals with Camunda and Drupal[Srijan Wednesday Webinar] Building BPMN Web Portals with Camunda and Drupal
[Srijan Wednesday Webinar] Building BPMN Web Portals with Camunda and Drupal
Srijan Technologies
 
[Srijan Wednesday Webinar] Decoupled Demystified: The Present & Future of Dr...
 [Srijan Wednesday Webinar] Decoupled Demystified: The Present & Future of Dr... [Srijan Wednesday Webinar] Decoupled Demystified: The Present & Future of Dr...
[Srijan Wednesday Webinar] Decoupled Demystified: The Present & Future of Dr...
Srijan Technologies
 
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
Srijan Technologies
 

More from Srijan Technologies (20)

[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
 
[Srijan Wednesday Webinars] How to Set Up a Node.js Microservices Architectur...
[Srijan Wednesday Webinars] How to Set Up a Node.js Microservices Architectur...[Srijan Wednesday Webinars] How to Set Up a Node.js Microservices Architectur...
[Srijan Wednesday Webinars] How to Set Up a Node.js Microservices Architectur...
 
[Srijan Wednesday Webinars] How to Build a Cloud Native Platform for Enterpri...
[Srijan Wednesday Webinars] How to Build a Cloud Native Platform for Enterpri...[Srijan Wednesday Webinars] How to Build a Cloud Native Platform for Enterpri...
[Srijan Wednesday Webinars] How to Build a Cloud Native Platform for Enterpri...
 
[Srijan Wednesday Webinars] Using Drupal as Data Pipeline for Digital Signage
[Srijan Wednesday Webinars] Using Drupal as Data Pipeline for Digital Signage[Srijan Wednesday Webinars] Using Drupal as Data Pipeline for Digital Signage
[Srijan Wednesday Webinars] Using Drupal as Data Pipeline for Digital Signage
 
[Srijan Wednesday Webinars] New Recipe of Decoupling: Drupal 8, Symfony and S...
[Srijan Wednesday Webinars] New Recipe of Decoupling: Drupal 8, Symfony and S...[Srijan Wednesday Webinars] New Recipe of Decoupling: Drupal 8, Symfony and S...
[Srijan Wednesday Webinars] New Recipe of Decoupling: Drupal 8, Symfony and S...
 
[Srijan Wednesday Webinars] Let’s Take the Best Route - Exploring Drupal 8 Ro...
[Srijan Wednesday Webinars] Let’s Take the Best Route - Exploring Drupal 8 Ro...[Srijan Wednesday Webinars] Let’s Take the Best Route - Exploring Drupal 8 Ro...
[Srijan Wednesday Webinars] Let’s Take the Best Route - Exploring Drupal 8 Ro...
 
[Srijan Wednesday Webinars] Is Your Business Ready for GDPR
[Srijan Wednesday Webinars] Is Your Business Ready for GDPR[Srijan Wednesday Webinars] Is Your Business Ready for GDPR
[Srijan Wednesday Webinars] Is Your Business Ready for GDPR
 
[Srijan Wednesday Webinars] Artificial Intelligence & the Future of Business
[Srijan Wednesday Webinars] Artificial Intelligence & the Future of Business[Srijan Wednesday Webinars] Artificial Intelligence & the Future of Business
[Srijan Wednesday Webinars] Artificial Intelligence & the Future of Business
 
[Srijan Wednesday Webinars] How to Design a Chatbot that Works
[Srijan Wednesday Webinars] How to Design a Chatbot that Works[Srijan Wednesday Webinars] How to Design a Chatbot that Works
[Srijan Wednesday Webinars] How to Design a Chatbot that Works
 
[Srijan Wednesday Webinars] Simplifying Migration to Drupal 8
[Srijan Wednesday Webinars] Simplifying Migration to Drupal 8[Srijan Wednesday Webinars] Simplifying Migration to Drupal 8
[Srijan Wednesday Webinars] Simplifying Migration to Drupal 8
 
Final dependency presentation.odp
Final dependency presentation.odpFinal dependency presentation.odp
Final dependency presentation.odp
 
[Srijan Wednesday Webinar] Leveraging the OGD Platform and Visualization Engine
[Srijan Wednesday Webinar] Leveraging the OGD Platform and Visualization Engine[Srijan Wednesday Webinar] Leveraging the OGD Platform and Visualization Engine
[Srijan Wednesday Webinar] Leveraging the OGD Platform and Visualization Engine
 
[Srijan Wednesday Webinars] Why Adopt Analytics Driven Testing
[Srijan Wednesday Webinars] Why Adopt Analytics Driven Testing [Srijan Wednesday Webinars] Why Adopt Analytics Driven Testing
[Srijan Wednesday Webinars] Why Adopt Analytics Driven Testing
 
[Srijan Wednesday Webinar] Key ingredients of a Powerful Test Automation System
[Srijan Wednesday Webinar] Key ingredients of a Powerful Test Automation System[Srijan Wednesday Webinar] Key ingredients of a Powerful Test Automation System
[Srijan Wednesday Webinar] Key ingredients of a Powerful Test Automation System
 
[Srijan Wednesday Webinar] Building BPMN Web Portals with Camunda and Drupal
[Srijan Wednesday Webinar] Building BPMN Web Portals with Camunda and Drupal[Srijan Wednesday Webinar] Building BPMN Web Portals with Camunda and Drupal
[Srijan Wednesday Webinar] Building BPMN Web Portals with Camunda and Drupal
 
[Srijan Wednesday Webinar] Decoupled Demystified: The Present & Future of Dr...
 [Srijan Wednesday Webinar] Decoupled Demystified: The Present & Future of Dr... [Srijan Wednesday Webinar] Decoupled Demystified: The Present & Future of Dr...
[Srijan Wednesday Webinar] Decoupled Demystified: The Present & Future of Dr...
 
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
[Srijan Wednesday Webinars] Automating Visual Regression using ‘Galen’
 
[Srijan Wednesday Webinars] Building a High Performance QA Team
[Srijan Wednesday Webinars] Building a High Performance QA Team[Srijan Wednesday Webinars] Building a High Performance QA Team
[Srijan Wednesday Webinars] Building a High Performance QA Team
 
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
[Srijan Wednesday Webinar] Mastering Mobile Test Automation with Appium
 
[Srijan Wednesday Webinars] Opportunities and Challenges in Enterprise UX Design
[Srijan Wednesday Webinars] Opportunities and Challenges in Enterprise UX Design[Srijan Wednesday Webinars] Opportunities and Challenges in Enterprise UX Design
[Srijan Wednesday Webinars] Opportunities and Challenges in Enterprise UX Design
 

Recently uploaded

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
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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...
 
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
 
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...
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS

  • 1. Developing Large Scale Applications in AngularJS Yes, it’s possible! Shyam Seshadri CEO, Fundoo Solutions (http://www.befundoo.com) @omniscient1
  • 2. AngularJS – It’s not just for toy apps
  • 3. Who am I? Entrepreneur http://www.befundoo.com Xoogler Author
  • 4. Currently @ AngularJS & NodeJS • Architecture Consulting • Development Consulting • Hands-on Workshops Product Development • Mobile & Web Evangelism • Latest & Greatest Technologies
  • 5. Agenda  AngularJS – Why it’s amazing  The difference between a small and large app  Structuring your AngularJS Project  Common Bottlenecks in Web Applications  Speeding up your web application
  • 6. AngularJS – 5 great things • Less code, more work - Data Binding • HTML for templating – Directives • Separating your concerns – MVC • Ease of testing – Karma, Jasmine, Protractor • Brilliant community – Anywhere, Everywhere
  • 7. When an app grows too big Small App (~1000’s LOC) • Tiny, Fast • Easy to develop • Testing is trivial • Simple project structure works Large App (~10K-50K LOC) • Large • Can quickly become unmaintainable • Can be prone to bugs • Project Structure hard to scale if base is not good • Testing requires thought
  • 8. Structuring a Large AngularJS Project High Level Thoughts • Modular approach • Independent, reusable modules • All necessary files together • Conceptually • Components – Reusable, not specific to a view • Sections – Controllers, HTML, directly for a view • Tests right beside the code
  • 9. A Sample Large App Structure ChallengeApp • components • auth • auth.service.js • auth.service_spec.js • ui • fileupload • fileupload.directive.js • fileupload.directive.tpl.html • fileupload.directive.css • fileupload.directive_spec.js
  • 10. A Sample Large App Structure ChallengeApp • sections • home • home.html • home.controller.js • home.controller_spec.js • home.css • list • list.html • list.controller.js • list.controller_spec.js • list.css • app.js • main.css • index.html
  • 11. How to write slow web applications Load lots of scripts and css (in head!) Slow subsequent loads Heavy DOM Rendering / Manipulation Bad CSS Angular – Too many watchers / scopes
  • 12. The Easy stuff • Load CSS in HEAD • Load JS at end of BODY Order • Concat/Minify/Gzip files and then load • Not too many parallel requests • Lazy load if too many / too large files Network • Reduce content in UI • Reduce watchers / expensive bindings DOM
  • 13. A Quick Case Study - EPG • Program Grid (x by y) • 500 channels • 14 days, half hour slots EPG • Smooth scrolling • Minimal Loading indicators / stops • Different states for each program • IE8 Support Requirement
  • 14. First Attempt at EPG • ng-repeat within ng-repeat • ng-class & ng-bind for all program data • Load data upfront • Time to render : ~6 seconds!!! • http://plnkr.co/edit/BLFb1O?p=preview • With polling to refresh the data • http://plnkr.co/edit/SebQIW?p=preview
  • 15. The Bottlenecks Initial Data Load ng-repeat not optimal for large data sets DOM manipulation & Re-rendering # of watchers
  • 16. Analyzing the ng-repeat effect • What if we completely dropped ng-repeat? • Use jQuery and manual HTML manipulation • Would things speed up? • http://plnkr.co/edit/mVpuPu?p=preview
  • 17. Simple Optimizations in AngularJS Use track by syntax with ng-repeat bindOnce if data is not going to change ng-if over ng-show/ ng-hide Reduce watchers / bind expressions
  • 18. Optimizing the Grid – What we did • Data was fetch & display • Did not change after initial load • Moved to custom directive without ng-bind & ng-repeat • Lazy Loading • Placeholders for content out of view • Load as and when needed • Cache Priming • Preload views beside current as & when time permits
  • 19. Things to keep in mind • CSS / JS Minification • Lazy Loading, if needed • Proper structure & build process upfront Build / Deploy • Avoid too many parallel requests • Gzip / Caching strategies • Cache Priming Network • Reduce DOM elements in UI • Reduce watchers / expensive bindings • Data-binding – Use bind-once when possible DOM
  • 20. Thank You! Shyam Seshadri Fundoo Solutions @omniscient1

Editor's Notes

  1. Grown from a side project for one engineer to a fulltime revolution in the arena of web development
  2. Boilerplate removed. 1000’s of lines of code less HTML, no new templating language like XML. Extend HTML with new components Modular architecture. Separation of concerns, Lets one focus on functionality, or UI. Model driven Testing first, focus on TDD from the start. Dependency Injecton
  3. App specific vs function specific. Auth, Widgets can be reused from components UI, controllers possibly reusable between mobile and web.
  4. Script = blocking Parallel request limit Gradients, etc Each watcher + DOM manipulation might take ms, but 1000 of those add up
  5. Non starter, dead on arrival. Had to rework it completleyhap://plnkr.co/edit/SebQIW?p=preview
  6. Non starter, dead on arrival. ng-repeat does a dom manipulation for each individual element. Those add up quickly for large lists
  7. Non starter, dead on arrival. Had to rework it completleyhap://plnkr.co/edit/SebQIW?p=preview