SlideShare a Scribd company logo
Architecting Your
Next SPA
By Guy Nesher
Agenda
• State of Single Page Applications
• Best Practices
• Choosing Your Next Library
• Questions
About Me
Guy Nesher
Consultant at
nesher.guy@gmail.com
@guynesher
Trust me, I’m a lawyer
State of Single Page Applications
Single Page Applications
• 2002 First examples of SPA
• 2006 jQuery
• 2009 ES6
• 2010 AngularJS, Backbone
• 2010 – 2018 - ~40 SPA libraries released, millions of active projects
• JavaScript Fatigue
SPA Libraries Today
Name NPM Downloads (Weekly) Initial Release
React 2,451,970 5 Years
Angular 687,004 2 Years*
Vue.js 357,950 4 Years
AngularJS 333,241 ---
Backbone 244,316 ---
EmberJS 66,066 6 Years
Preact 53,113 3 Years
SPA Best Practices
Small Reusable Components
Rule 1
Components
• Made popular by React (2013)
• Everything (almost) is a component
• User defined DOM tags
• Small, Composable and Reusable
• Component interaction via template
Requirements
• Easily switch data source
• Configurable* (Direction of Popup)
• Notify on data change
• Contained CSS * Simple Bootstrap dropdown
Container / Presentational Components
Container Component
• Handles layout
• Interacts with the data layer
• Mutates data from components
• Not reusable (mostly)
Presentational Component
• Single responsibility
• Handles the look & feel
• Minimal logic
• Reusable
• One way data binding
Container / Presentational Components
Container Component
PresentationalComponent
Properties /
Callbacks
Events
Data Provider
Scoped Styles
• Angular and Vue offer scoped CSS for components
• For React try react-css-modules / Glamor
• ‘>>>’ And ‘/deep/’ should be avoided
• BEM – Block Element Modifier
• Sass / Less demise
Composition Over Inheritance
• Specifically recommended by React and Vue
• Works well with Components
• Logic is shared via external help methods
• Easier to read / test / reuse
Component Comparison
Vue Angular React
Template Engine HTML HTML JSX
Template Location Part of controller .vue
file
Separate file Part of controller
Component Definition Plain object Class + Decorators Class
Component
Communication
Callbacks / Event
Emitters
Event Emitters Callbacks
Props One Way, Mutable* One Way, Mutable One Way, Immutable
Web Components
• A set of new standards
• Allow the creation of custom DOM elements
• Not fully supported (use stenciljs)
• Angular 6 supports export
State Management
Rule 2
From MV* To Flux
• Architecture developed by Facebook (2014)
• Focused on Unidirectional data flow
• Application state is managed within global stores
• Action / Dispatcher used to manage data flow
Flux today
• Redux – refined Flux, supports all platforms
• Mobx / Vuex / NGXS – reactive, less boilerplate, a little more magic
• Learn to use the devtools
• Always use a state management solution
Structure Your Project
Rule 3
Group By Feature/Function Folders
• Each feature / function includes all related files
• Features are recursive
• Avoid deep nesting
• Features folders can be broken to types folder
Grouping By Features
With Type Grouping
profile/
components/
button/
directives/
utils/
Without grouping
profile/
profile.js
profile.css
profile-utils.js
profile-directive.js
* Avoid capitalization
App Maintenance
Rule 4
Static Typing
• Typescript / Flow
• Easier to catch errors
• Easier to share / understand code
• Small development cost, relatively big gains
Long Term Support
• LTS - Security / Bug fixes for older version of the library
• Current support:
• Angular – 1 year*
• Vue – 9 months**
• React – N/A
• Keep your libraries up to date
* Minimum 1 year
** based on v1.1 support
Unit Testing
• Simpler than ever
• Similar syntax / functionality across all libraries
• Sign of maturity*
• Medium investments / Medium – High returns
Choosing Your Next SPA
Library
Performance
Performance
1. ~10 libraries faster than the “Big 3”
2. Surplus (fastest) use JSX, removes virtual DOM and gains ~20%
speed increase
3. You probably never heard of them
4. Big 3 perform roughly the same
* Based on http://www.stefankrause.net/js-frameworks-benchmark7/table.html
Performance, Load Time
Better Criteria
• Community Size
• Documentation / Learning Resources / Learning Curve
• Additional Capabilities
• Personal Preference
Questions
nesher.guy@gmail.com
@guynehser

More Related Content

What's hot

Backing Library Operations with Open Source Applications
Backing Library Operations with Open Source ApplicationsBacking Library Operations with Open Source Applications
Backing Library Operations with Open Source Applications
Myka Kennedy Stephens
 
Microservices: A developer's approach
Microservices: A developer's approachMicroservices: A developer's approach
Microservices: A developer's approach
Foyzul Karim
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
Thomas Robbins
 
Signal rity1
Signal rity1Signal rity1
Signal rity1
Yaniv Rodenski
 
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
JavaCro'15 - Secure Web Services Development - Askar AkhmerovJavaCro'15 - Secure Web Services Development - Askar Akhmerov
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Node ts1
Node ts1Node ts1
Node ts1
Yaniv Rodenski
 
Static Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource ConditionStatic Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource Condition
IWMW
 
Full stack development using javascript what and why - ajay chandravadiya
Full stack development using javascript   what and why - ajay chandravadiyaFull stack development using javascript   what and why - ajay chandravadiya
Full stack development using javascript what and why - ajay chandravadiya
ajayrcgmail
 
Implementing OpenAthens Single Sign-On Authentication
Implementing OpenAthens Single Sign-On AuthenticationImplementing OpenAthens Single Sign-On Authentication
Implementing OpenAthens Single Sign-On Authentication
Myka Kennedy Stephens
 
Express yourself
Express yourselfExpress yourself
Express yourself
Yaniv Rodenski
 
Microservices with Spring Boot
Microservices with Spring BootMicroservices with Spring Boot
Microservices with Spring Boot
Rasheed Waraich
 
Introduction to Webcomponents
Introduction to WebcomponentsIntroduction to Webcomponents
Introduction to Webcomponents
Harish Karthick
 
Using the Kentico CMS API
Using the Kentico CMS APIUsing the Kentico CMS API
Using the Kentico CMS API
Thomas Robbins
 
Advance java session 2
Advance java session 2Advance java session 2
Advance java session 2
Smita B Kumar
 
Managing your user data with Sitecore xDB
Managing your user data with Sitecore xDBManaging your user data with Sitecore xDB
Managing your user data with Sitecore xDB
Ruud van Falier
 
Discovery Layers: An Overview and Case Study
Discovery Layers: An Overview and Case StudyDiscovery Layers: An Overview and Case Study
Discovery Layers: An Overview and Case Study
Myka Kennedy Stephens
 
JBCNConf 2017 - Building microservices with Vert.x
JBCNConf 2017 - Building microservices with Vert.xJBCNConf 2017 - Building microservices with Vert.x
JBCNConf 2017 - Building microservices with Vert.x
Bert Jan Schrijver
 
GeekOut 2017 - Microservices in action at the Dutch National Police
GeekOut 2017 -  Microservices in action at the Dutch National PoliceGeekOut 2017 -  Microservices in action at the Dutch National Police
GeekOut 2017 - Microservices in action at the Dutch National Police
Bert Jan Schrijver
 
WordPress at Scale Webinar
WordPress at Scale WebinarWordPress at Scale Webinar
WordPress at Scale Webinar
Pantheon
 
Introduction to the Nancy Framework
Introduction to the Nancy FrameworkIntroduction to the Nancy Framework
Introduction to the Nancy Framework
Tim Bourguignon
 

What's hot (20)

Backing Library Operations with Open Source Applications
Backing Library Operations with Open Source ApplicationsBacking Library Operations with Open Source Applications
Backing Library Operations with Open Source Applications
 
Microservices: A developer's approach
Microservices: A developer's approachMicroservices: A developer's approach
Microservices: A developer's approach
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
 
Signal rity1
Signal rity1Signal rity1
Signal rity1
 
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
JavaCro'15 - Secure Web Services Development - Askar AkhmerovJavaCro'15 - Secure Web Services Development - Askar Akhmerov
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
 
Node ts1
Node ts1Node ts1
Node ts1
 
Static Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource ConditionStatic Site Generators - Developing Websites in Low-resource Condition
Static Site Generators - Developing Websites in Low-resource Condition
 
Full stack development using javascript what and why - ajay chandravadiya
Full stack development using javascript   what and why - ajay chandravadiyaFull stack development using javascript   what and why - ajay chandravadiya
Full stack development using javascript what and why - ajay chandravadiya
 
Implementing OpenAthens Single Sign-On Authentication
Implementing OpenAthens Single Sign-On AuthenticationImplementing OpenAthens Single Sign-On Authentication
Implementing OpenAthens Single Sign-On Authentication
 
Express yourself
Express yourselfExpress yourself
Express yourself
 
Microservices with Spring Boot
Microservices with Spring BootMicroservices with Spring Boot
Microservices with Spring Boot
 
Introduction to Webcomponents
Introduction to WebcomponentsIntroduction to Webcomponents
Introduction to Webcomponents
 
Using the Kentico CMS API
Using the Kentico CMS APIUsing the Kentico CMS API
Using the Kentico CMS API
 
Advance java session 2
Advance java session 2Advance java session 2
Advance java session 2
 
Managing your user data with Sitecore xDB
Managing your user data with Sitecore xDBManaging your user data with Sitecore xDB
Managing your user data with Sitecore xDB
 
Discovery Layers: An Overview and Case Study
Discovery Layers: An Overview and Case StudyDiscovery Layers: An Overview and Case Study
Discovery Layers: An Overview and Case Study
 
JBCNConf 2017 - Building microservices with Vert.x
JBCNConf 2017 - Building microservices with Vert.xJBCNConf 2017 - Building microservices with Vert.x
JBCNConf 2017 - Building microservices with Vert.x
 
GeekOut 2017 - Microservices in action at the Dutch National Police
GeekOut 2017 -  Microservices in action at the Dutch National PoliceGeekOut 2017 -  Microservices in action at the Dutch National Police
GeekOut 2017 - Microservices in action at the Dutch National Police
 
WordPress at Scale Webinar
WordPress at Scale WebinarWordPress at Scale Webinar
WordPress at Scale Webinar
 
Introduction to the Nancy Framework
Introduction to the Nancy FrameworkIntroduction to the Nancy Framework
Introduction to the Nancy Framework
 

Similar to Architecting Single Page Applications

Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
Derek Jacoby
 
Mastering react with redux
Mastering react with reduxMastering react with redux
Mastering react with redux
Gaurav Singh
 
Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"
LogeekNightUkraine
 
The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...
The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...
The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...
Jon Peck
 
AngularJS
AngularJSAngularJS
AngularJS
Yogesh L
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2
Erik Noren
 
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
Jonathan Ralton
 
Microfrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased basedMicrofrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased based
Vinci Rufus
 
End to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) EuropeEnd to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) Europe
Alexandre Morgaut
 
Alfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European BankAlfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European Bank
Piergiorgio Lucidi
 
Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...
Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...
Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...
Decision CAMP
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
Geoff Harcourt
 
Where to save my data, for devs!
Where to save my data, for devs!Where to save my data, for devs!
Where to save my data, for devs!
SharePoint Saturday New Jersey
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
Troy Miles
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Arun Gupta
 
USG Summit - September 2014 - Web Management using Drupal
USG Summit - September 2014 - Web Management using DrupalUSG Summit - September 2014 - Web Management using Drupal
USG Summit - September 2014 - Web Management using Drupal
Eric Sembrat
 
The Meteor Framework
The Meteor FrameworkThe Meteor Framework
The Meteor Framework
Damien Magoni
 
Apereo OAE - Bootcamp
Apereo OAE - BootcampApereo OAE - Bootcamp
Apereo OAE - Bootcamp
Nicolaas Matthijs
 
Cross Site Collection Navigation
Cross Site Collection NavigationCross Site Collection Navigation
Cross Site Collection Navigation
Thomas Daly
 
Building SharePoint Single Page Applications Using AngularJS
Building SharePoint Single Page Applications Using AngularJSBuilding SharePoint Single Page Applications Using AngularJS
Building SharePoint Single Page Applications Using AngularJS
SharePointInstitute
 

Similar to Architecting Single Page Applications (20)

Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
 
Mastering react with redux
Mastering react with reduxMastering react with redux
Mastering react with redux
 
Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"Andrii Sliusar "Module Architecture of React-Redux Applications"
Andrii Sliusar "Module Architecture of React-Redux Applications"
 
The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...
The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...
The Great Consolidation - Entertainment Weekly Migration Case Study - SANDcam...
 
AngularJS
AngularJSAngularJS
AngularJS
 
ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2ASP.NET Core Demos Part 2
ASP.NET Core Demos Part 2
 
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection BoundarySPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
SPSNE17 - The Wall: Overcoming SharePoint’s Site Collection Boundary
 
Microfrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased basedMicrofrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased based
 
End to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) EuropeEnd to-end W3C - JS.everywhere(2012) Europe
End to-end W3C - JS.everywhere(2012) Europe
 
Alfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European BankAlfresco Summit 2014 - Crafter CMS - Case European Bank
Alfresco Summit 2014 - Crafter CMS - Case European Bank
 
Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...
Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...
Decision CAMP 2014 - Erik Marutian - Using rules-based gui framework to power...
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
Where to save my data, for devs!
Where to save my data, for devs!Where to save my data, for devs!
Where to save my data, for devs!
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
 
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
Lessons Learned from Real-World Deployments of Java EE 7 at JavaOne 2014
 
USG Summit - September 2014 - Web Management using Drupal
USG Summit - September 2014 - Web Management using DrupalUSG Summit - September 2014 - Web Management using Drupal
USG Summit - September 2014 - Web Management using Drupal
 
The Meteor Framework
The Meteor FrameworkThe Meteor Framework
The Meteor Framework
 
Apereo OAE - Bootcamp
Apereo OAE - BootcampApereo OAE - Bootcamp
Apereo OAE - Bootcamp
 
Cross Site Collection Navigation
Cross Site Collection NavigationCross Site Collection Navigation
Cross Site Collection Navigation
 
Building SharePoint Single Page Applications Using AngularJS
Building SharePoint Single Page Applications Using AngularJSBuilding SharePoint Single Page Applications Using AngularJS
Building SharePoint Single Page Applications Using AngularJS
 

Recently uploaded

Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 

Recently uploaded (20)

Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 

Architecting Single Page Applications

  • 2. Agenda • State of Single Page Applications • Best Practices • Choosing Your Next Library • Questions
  • 3. About Me Guy Nesher Consultant at nesher.guy@gmail.com @guynesher
  • 4. Trust me, I’m a lawyer
  • 5. State of Single Page Applications
  • 6. Single Page Applications • 2002 First examples of SPA • 2006 jQuery • 2009 ES6 • 2010 AngularJS, Backbone • 2010 – 2018 - ~40 SPA libraries released, millions of active projects • JavaScript Fatigue
  • 7. SPA Libraries Today Name NPM Downloads (Weekly) Initial Release React 2,451,970 5 Years Angular 687,004 2 Years* Vue.js 357,950 4 Years AngularJS 333,241 --- Backbone 244,316 --- EmberJS 66,066 6 Years Preact 53,113 3 Years
  • 10. Components • Made popular by React (2013) • Everything (almost) is a component • User defined DOM tags • Small, Composable and Reusable • Component interaction via template
  • 11. Requirements • Easily switch data source • Configurable* (Direction of Popup) • Notify on data change • Contained CSS * Simple Bootstrap dropdown
  • 12. Container / Presentational Components Container Component • Handles layout • Interacts with the data layer • Mutates data from components • Not reusable (mostly) Presentational Component • Single responsibility • Handles the look & feel • Minimal logic • Reusable • One way data binding
  • 13. Container / Presentational Components Container Component PresentationalComponent Properties / Callbacks Events Data Provider
  • 14. Scoped Styles • Angular and Vue offer scoped CSS for components • For React try react-css-modules / Glamor • ‘>>>’ And ‘/deep/’ should be avoided • BEM – Block Element Modifier • Sass / Less demise
  • 15. Composition Over Inheritance • Specifically recommended by React and Vue • Works well with Components • Logic is shared via external help methods • Easier to read / test / reuse
  • 16. Component Comparison Vue Angular React Template Engine HTML HTML JSX Template Location Part of controller .vue file Separate file Part of controller Component Definition Plain object Class + Decorators Class Component Communication Callbacks / Event Emitters Event Emitters Callbacks Props One Way, Mutable* One Way, Mutable One Way, Immutable
  • 17. Web Components • A set of new standards • Allow the creation of custom DOM elements • Not fully supported (use stenciljs) • Angular 6 supports export
  • 19. From MV* To Flux • Architecture developed by Facebook (2014) • Focused on Unidirectional data flow • Application state is managed within global stores • Action / Dispatcher used to manage data flow
  • 20. Flux today • Redux – refined Flux, supports all platforms • Mobx / Vuex / NGXS – reactive, less boilerplate, a little more magic • Learn to use the devtools • Always use a state management solution
  • 22. Group By Feature/Function Folders • Each feature / function includes all related files • Features are recursive • Avoid deep nesting • Features folders can be broken to types folder
  • 23. Grouping By Features With Type Grouping profile/ components/ button/ directives/ utils/ Without grouping profile/ profile.js profile.css profile-utils.js profile-directive.js * Avoid capitalization
  • 25. Static Typing • Typescript / Flow • Easier to catch errors • Easier to share / understand code • Small development cost, relatively big gains
  • 26. Long Term Support • LTS - Security / Bug fixes for older version of the library • Current support: • Angular – 1 year* • Vue – 9 months** • React – N/A • Keep your libraries up to date * Minimum 1 year ** based on v1.1 support
  • 27. Unit Testing • Simpler than ever • Similar syntax / functionality across all libraries • Sign of maturity* • Medium investments / Medium – High returns
  • 28. Choosing Your Next SPA Library
  • 30. Performance 1. ~10 libraries faster than the “Big 3” 2. Surplus (fastest) use JSX, removes virtual DOM and gains ~20% speed increase 3. You probably never heard of them 4. Big 3 perform roughly the same * Based on http://www.stefankrause.net/js-frameworks-benchmark7/table.html
  • 32. Better Criteria • Community Size • Documentation / Learning Resources / Learning Curve • Additional Capabilities • Personal Preference

Editor's Notes

  1. Convey two points I’m serious But also made some poor life choices
  2. AngularJS And Backbone had very little in common
  3. CSS properties (variables) are supported
  4. Vue recommends not to mutate props, will be overwritten
  5. 2018 - The Year of Web Components, Dominik Kundel