SlideShare a Scribd company logo
1 of 98
A Day Building Fast,
Responsive, Extensible
Single Page Applications
Chris Love
@ChrisLove
Love2Dev.com
Who Am I
• Front-End Web Dev MVP
• ASP Insider
• Internet Explorer User Agent
• Author
• Speaker
• Tweaker, Lover of Web, JavaScript, CSS & HTML5
• @ChrisLove
• https://love2dev.com
Slide Deck & Source Code
• Normal Slide Decks – http://slidesha.re/15YTrTT
• Today’s Slides - http://bit.ly/1m66Hu6
• Source Code – http://GitHub.com/docluv/movies
What Does A Modern
Web App Look Like?
What is Changing the
Definition of the Web?
What Does the Developer
Experience Look Like?
Defining the Modern Web Application
Its Not This
Its Not This
326 Http Requests
23 Style Sheets 80kb
84 Images 587kb
101 External Scripts 806kb
229 Primed Http Requests
76 seconds to fully load
Multiple Unminimized Resources
Speed Index 5949
12+MB of Content
Multiple 404s
Mostly Uncached Content
Performance
• Multiple Studies Show Correlation Between Conversions & Speed
• 57% Will Abandon a Slow Site After 3 Seconds
• We Have to Concentrate 50% Harder For Slow Sites
• 78% Have Felt Stress or Anger With Slow Sites
• 44% Say Slow Sites Make Them Anxious
• 4% Have Thrown Their Phone
Matt Cutts
"Also take a step back for a minute and consider the intent of this
change: a faster web is great for everyone, but especially for users.
Lots of websites have demonstrated that speeding up the user
experience results in more usage. So speeding up your website isn’t
just something that can affect your search rankings–it’s a fantastic
idea for your users.“
http://bit.ly/SPPB4k
Time is Money
• Faster Sites Have Higher Conversion Rates
• WalMart - http://bit.ly/S1fHSZ
• Google – http://bit.ly/WajJbB
• Amazon – http://bit.ly/S3UoAj
• ShopZilla - http://bit.ly/RIQMDM
WalMart
Folks at Walmart knew their pages were slow. As a for instance, initial
measurement showed that an item page took about 24 seconds to
load for the slowest 5% of users. Why? The usual culprits: too many
page elements, slow third-party scripts, multiple hosts (25% of page
content is served by partners, affiliates, and Marketplace), and
various best practice no-nos
http://bit.ly/WajJbB
Google’s ½ Second
Half a second delay caused a 20% drop in traffic. Half a second delay
killed user satisfaction.
The lesson, Marissa said, is that speed matters. People do not like to
wait. Do not make them.
http://bit.ly/TPPhUp
http://bit.ly/16zFCXL
Performance
• Performance Matters
• It Must Be a 1st Class Feature in Any Application
• Not an Afterthought Right Before Deployment
• 80% of Performance Is In the Client, Not the Server
• Cellular Networks Make Page Load Even Tougher
• 500ms Inherent Delay
• Bandwidth Constraints
Modern Web
Applications MUST Load
Fast and Respond Fast
Mobile or Device Fragmentation
Touch
Web APIs
HTML5 CSS3 JavaScript
The Modern Web Hour Glass
HTML5
JavaScript
CSS3
ASP.NET.IIS
DB – SQL Server/NoSQL
(API + HTML5 + CSS3 + JavaScript +
Standards Compliant Browser) *
(Touch + Mobility + Performance)
=== Great Single Page Application
Let’s Code
Introduction to Fluid Layouts
•Morph to Fill The ViewPort Space
•Rely on CSS
• Absolute Positioning
DOCTYPE
Replace This:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
With This:
<!DOCTYPE html>
<html>
DOCTYPE
"DOCTYPEs are required for legacy reasons. When omitted, browsers tend to use
a different rendering mode that is incompatible with some specifications.
Including the DOCTYPE in a document ensures that the browser makes a best-
effort attempt at following the relevant
specifications." http://www.w3.org/TR/html5/syntax.html#the-doctype
Absolute Positioning
.site-header {
position: absolute;
top: 0;
right: 0;
left: 0;
height: 80px;
}
Let’s Code
Responsive Web Design
• Introduced by Ethan Marcotte 2010 - bit.ly/178an9e
• Web Design Approach To Create An Optimal Viewing Experience
Across All Browser ViewPorts
• Fluid Layouts
• Media Queries
• Minimal if any JavaScript Required
“this unspoken agreement to pretend that we had a certain size. And
that size changed over the years. For a while, we all sort of tacitly
agreed that 640 by 480 was the right size, and then later than
changed to 800:600, and 1024; we seem to have settled on this 960
pixel as being this like, default. It’s still unknown. We still don’t know
the size of the browser; it’s just like this consensual hallucination that
we’ve all agreed to participate in: “Let’s assume the browser has a
browser width of at least 960 pixels.”
Jeremy Keith
bit.ly/1bhH6rw
Responsive Design
“The emergence of ideas like “responsive design” and “future-friendly
thinking” are in part a response to the collective realization that
designing products that solve one problem in one context at a time is
no longer sustainable. By refocusing our process on systems that are
explicitly designed to adapt to a changing environment, we have an
opportunity to develop durable, long-lasting designs that renew their
usefulness and value over time.”
Wilson Miner
bit.ly/1fbq5lB
Responsive Design
“Any attempt to draw a line around a particular device class has as
much permanence as a literal line in the sand. Pause for a moment
and the line blurs. Look away and it will be gone.
Let’s take the absolute best case scenario. You’re building a web app
for internal users for whom you get to specify what computer is
purchased and used. You can specify the browser, the monitor size,
keyboard, etc.”
Jason Grigsby
bit.ly/KzJH9G
Responsive Design
“How long do you think that hardware will be able to be found? Three
years from now when a computer dies and has to be replaced, what are
the chances that the new monitor will be a touchscreen?
By making a decision to design solely for a “desktop UI”, you are creating
technical debt and limiting the longevity of the app you’re building. You’re
designing to a collective hallucination. You don’t have to have a crystal ball
to see where things are headed.
And once you start accepting the reality that the lines inside form factors
are as blurry as the lines between them, then responsiveness becomes a
necessity.”
Jason Grigsby
bit.ly/KzJH9G
Responsive Design
Mobile First
• Determine The Most Important Information
• Expand From There
• Start Responsive Design Mobile First
Responsive Layout
Responsive Layout
Responsive Layout
Media Queries
@media (min-width:600px) {
/* Rules Here */
}
@media (min-width:800px) {
/* Rules Here */
}
Responsive Design Best Practices
•Start Small Screen First
•Forces Most Important Data First
•Easier to Adjust CSS Rules
•Let Data Drive Media Queries First
•Its Ok to Use Some JavaScript
•But Not Required
Let’s Code
Touch Your Application
Touch Your Application
• Content Must Be Touchable
• Account for Fat Fingers
• Support APIs
• Mouse
• Touch (Apple)
• Pointer (MSFT & W3C)
Touch Your Application
Touch Your Application
• The Average Human Finger
is 11mm in Diameter
• Fingers Range from 8mm -
19mm
• Baby to Large Man
Touch Your Application
• Touch Points Need Margin
• Or Separation From
Neighbors
Touch Gestures
• Pan
• Pinch/Zoom
• Swipe
• Tap
• Tap + Hold
• Rotate
Touch-action
• CSS Property to Help Determine How Touch is Handled
• Auto
• None
• Pan-x
• Pan-y
• Can disable Auto-zoom
• Enable Scrolling
Scrolling Content
overflow: scroll;
-webkit-overflow-scrolling: touch;
-ms-overflow-style: -ms-autohiding-scrollbar;
-ms-scroll-chaining: none;
-ms-scroll-translation: vertical-to-horizontal;
DeepTissue
• Abstracts Touch & Mouse APIs
• Abstracts Input Modality Gestures
• http://deeptissuejs.com
INPUT TYPE=XXXX
• New Input Types Drive On-Screen
Keyboards
• Drives Native Validation
• Tel, email, url, number, etc
Let’s Code
The Server-Side Story
• Provide Markup, CSS, JavaScript, Images
• API End Points
• Possible Legacy URL Redirects
• Deal with Search Engine Spiders and Legacy Browsers
The Modern Web Hour Glass
HTML5
JavaScript
CSS3
ASP.NET.IIS
DB – SQL Server/NoSQL
SPAHelper Library
• Extends ASP.NET MVC
• Custom SPAWebViewPage
• SPAModel
• SPAHelper
• http://bit.ly/1dUYLGJ
SPAWebViewPage
• Must Use it as Base for MVC View
• Extends MVC’s WebViewPage
• SPARenderPage
• Causes only Changed Content to be Sent to Client
• Works in Concert with Backpack to Cache Markup in localStorage
SPAWebViewPage
• Must Configure View web.config file:
• <pages pageBaseType="SPAHelper.SPAWebViewPage">
SPAWebViewPage
@if (!Html.HasEscapeFragment())
{
@SPARenderPage("views/home-view.cshtml")
@SPARenderPage("views/movies-view.cshtml")
@SPARenderPage("views/movie-view.cshtml")
…
@SPARenderPage("views/notfound-view.cshtml")
@SPARenderPage("templates/_templates.cshtml")
}
SPAModel
• The SPAModel provides a base for an ASP.NET MVC single page
application model
• The model has properties for the application's Title and Description
• The SetRoute function parses a SPA route to isolate the primary
root
SPAHelper
• The SPAHelper class is a collection of static and static ASP.NET MVC
HTML Helper extension functions
• SPALink
• LastUpdated
• HasEscapeFragment
• HasForceReload
_escape_fragment_
• Google’s Specification for AJAX Applications
• http://bit.ly/117sTgL
• Allows Routes to be Sent to Server Via QueryString
• Server Sends Google Fully Rendered Markup
• Good Core Site Solution
• Legacy Browser Version
• Andy Hume of the Guardian - http://vimeo.com/channels/smashingconf
Cutting The Mustard
• Feature Detect to Determine Browser Capabilities
• Never Browser Sniff
if (!('querySelector' in document) //at least IE8
|| !('localStorage' in window) //at least IE8
|| !('addEventListener' in window) //at least IE8
|| !('matchMedia' in window)) {//at least IE10
} else {
}
Let’s Code
The Client-Side Story
• Things You Used to Do On the Server Now Live In the Client
• Routing
• Rendering
• Data Caching
• Need to be Conscience of How Browsers Work
• Critical Rendering Path
• Memory Management
• Leverage HTML5 Features
• Storage
• Animations
Press # For More
• Routes Are Not Sent to Server
• No Request/Response Iniated
• Must Respond to Route in the Client
• #! Is the Defacto Standard
Press # For More
window.addEventListener("hashchange", function (e) {
//swap the View Here
});
What About These Guys?
•Angular
•Ember
•Backbone
•Durandal
Common Problems
•Too Large
•Try to be everything to everybody
•Memory Leaks
•Many Brittle Practices
•Routing
•Virtualize Native Functionality
The Love2SPA Way
• SPAjs
• Backpack/Mud Bath *
• DollarBill**
• Caching AJAX Layer
• HTML Template Engine
• Deeptissue
• Toolbar, Panorama, Other Small UI Libraries
* Under Development ** jQuery Compatible
The Love2SPA Way – Typical Stats
• 35-80kb minified, not gzipped JavaScript
• 20-35kb minified, not gzipped CSS
• 5-35kb minified, not gzipped HTML
• 3 Core Http Requests
• < 1 second Load Time
The Love2SPA Way
• Extensible
• Scalable
• Maintainable
• Testable
• Deployable
• Have Tangible ROI
SPAjs
• Responsible for Routing
• View Switching
• Executes Animations
• Relies on Animate.css - http://bit.ly/1hayo4s
• Executing View Onload and Unload Functions
Backpack
• Stores View Markup & Templates in localStorage
• 1st Implemented by Google & Bing
• http://bit.ly/117puyn
• Implements an API expected by SPAjs
• MudBath a work in Progress
• Implements Same API
• Used IndexDB
AjaxPrefilter
• Caches Data in localStorage with a TTL
• 1st Implement by Paul Irish
• http://bit.ly/117p7E9
• Can be Used with Any AJAX Implementation
• Eliminates Unnecessary HTTP Requests
JavaScript Templating
• Merges JavaScript Objects with Markup
• Many Libraries
• Micro-Templating
• MUSTACHE
• Handlebars
• Generated Markup Appended to DOM
JavaScript Templating
<script id="MoviePosterGridTemplate" type="text/x-mustache-template">
{{#movies}}
<div class="movie-target">
<a href="#!movie/{{id}}/{{title}}">
<img alt="{{title}}" src="{{poster}}" class="movie-grid-poster">
<figcaption class="demo-photo-caption">{{title}}</figcaption>
</a>
</div>
{{/movies}}
</script>
Let’s Code
Create Modular, Extensible JavaScript
Application
• Functions 1st Class in JavaScript
• Functions are Objects
• var foo = {};
• All Objects have a Prototype
• new Keyword creates a new Object
• Many popular Patterns
Extensible
Core
Module
Module
Module
Think Like jQuery
• The jQuery Module Pattern is Familiar
• Not Hard to Implement
• Allows for Extensibility
A SPA Application Module
App
View
View
View
Let’s Code
Building Web Applications
• Just Like C# Applications
• Release
• Debug
• The Web Needs a Compiler
• 2 Great Options
• Grunt
• Gulp
Building Web Applications
• Grunt & Gulp Are Node Modules
• http://gruntjs.com
• http://gulpjs.com
• Both have great eco-systems
• Add To package.json
• Run npm install
• Create gruntfile.js
• Grunt.cmd
Let’s Code
Going Offline
• Leverage the AppCache
• Create a Manifest File
• Don’t Let it be a Handicap
• http://bit.ly/117q27A
• Makes Sure Your App Will Work Without Connectivity
• Good for Caching Images and Resources
• Makes the Browser look Local Before Going to the Server
Developing with AppCache is a PITA
@{if (HttpContext.Current.IsDebuggingEnabled)
{
@:<html lang="en">
}
else
{
@:<html lang="en" manifest="app.cache">
}
}
Manifest File
• CACHE
• lists all resources that should be downloaded for offline use
• NETWORK
• identifies any URLs that require the device be connected to the network
• FALLBACK
• lists replacement URLs for network URLs to be used when the device is
offline
How AppCache Works
• When the browser reads the manifest file it downloads the
specified resources locally
• Those resources are referred too instead of making a
request to the server
• Resources are refreshed if the manifest file has been
updated
Let’s Code
High Performance Single Page Web
Applications
• Responsive Design
• Touch
• Mobile First
• SPA
• Extensible, Scalable Architecture
• Web Build and Workflow
• Goes Really Fast!
• ~395 Pages
• 20 Chapters
• $9.99 http://amzn.to/1a55L89
Questions

More Related Content

What's hot

BD Conf: Visit speed - Page speed is only the beginning
BD Conf: Visit speed - Page speed is only the beginningBD Conf: Visit speed - Page speed is only the beginning
BD Conf: Visit speed - Page speed is only the beginningPeter McLachlan
 
Single page applications the basics
Single page applications the basicsSingle page applications the basics
Single page applications the basicsChris Love
 
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 TodayChris Love
 
Advanced front end debugging with ms edge and ms tools
Advanced front end debugging with ms edge and ms toolsAdvanced front end debugging with ms edge and ms tools
Advanced front end debugging with ms edge and ms toolsChris Love
 
HK CodeConf 2015 - Your WebPerf Sucks
HK CodeConf 2015 - Your WebPerf Sucks HK CodeConf 2015 - Your WebPerf Sucks
HK CodeConf 2015 - Your WebPerf Sucks Holger Bartel
 
Mobile SEO (English Version)
Mobile SEO (English Version)Mobile SEO (English Version)
Mobile SEO (English Version)ssuserd60633
 
Develop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will loveDevelop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will loveChris Love
 
Beyond Responsive Workshop [Beyond Tellerrand 2014]
Beyond Responsive Workshop [Beyond Tellerrand 2014]Beyond Responsive Workshop [Beyond Tellerrand 2014]
Beyond Responsive Workshop [Beyond Tellerrand 2014]Aaron Gustafson
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
Page Performance: A No-Holds Barred, Holistic Look
Page Performance: A No-Holds Barred, Holistic LookPage Performance: A No-Holds Barred, Holistic Look
Page Performance: A No-Holds Barred, Holistic LookJeff Whitfield
 
Orchestrating web engagement requires momentum in contextual intelligence
Orchestrating web engagement requires momentum in contextual intelligence Orchestrating web engagement requires momentum in contextual intelligence
Orchestrating web engagement requires momentum in contextual intelligence Padma Sambhav Pati
 
Build Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićBuild Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićMeetMagentoNY2014
 
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012Rigor
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Webphilogb
 
Creating Responsive Website Using Bootstrap
Creating Responsive Website Using BootstrapCreating Responsive Website Using Bootstrap
Creating Responsive Website Using Bootstrapgavaskar s
 

What's hot (20)

BD Conf: Visit speed - Page speed is only the beginning
BD Conf: Visit speed - Page speed is only the beginningBD Conf: Visit speed - Page speed is only the beginning
BD Conf: Visit speed - Page speed is only the beginning
 
Single page applications the basics
Single page applications the basicsSingle page applications the basics
Single page applications the basics
 
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
 
Advanced front end debugging with ms edge and ms tools
Advanced front end debugging with ms edge and ms toolsAdvanced front end debugging with ms edge and ms tools
Advanced front end debugging with ms edge and ms tools
 
HK CodeConf 2015 - Your WebPerf Sucks
HK CodeConf 2015 - Your WebPerf Sucks HK CodeConf 2015 - Your WebPerf Sucks
HK CodeConf 2015 - Your WebPerf Sucks
 
Mobile SEO (English Version)
Mobile SEO (English Version)Mobile SEO (English Version)
Mobile SEO (English Version)
 
Develop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will loveDevelop a vanilla.js spa you and your customers will love
Develop a vanilla.js spa you and your customers will love
 
Beyond Responsive Workshop [Beyond Tellerrand 2014]
Beyond Responsive Workshop [Beyond Tellerrand 2014]Beyond Responsive Workshop [Beyond Tellerrand 2014]
Beyond Responsive Workshop [Beyond Tellerrand 2014]
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Page Performance: A No-Holds Barred, Holistic Look
Page Performance: A No-Holds Barred, Holistic LookPage Performance: A No-Holds Barred, Holistic Look
Page Performance: A No-Holds Barred, Holistic Look
 
Responsive Design
Responsive DesignResponsive Design
Responsive Design
 
Responsive and Fast
Responsive and FastResponsive and Fast
Responsive and Fast
 
Orchestrating web engagement requires momentum in contextual intelligence
Orchestrating web engagement requires momentum in contextual intelligence Orchestrating web engagement requires momentum in contextual intelligence
Orchestrating web engagement requires momentum in contextual intelligence
 
Responsive Enhancement
Responsive EnhancementResponsive Enhancement
Responsive Enhancement
 
Build Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje JurišićBuild Better Responsive websites. Hrvoje Jurišić
Build Better Responsive websites. Hrvoje Jurišić
 
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
The Need For Speed - Rigor's slides from ShopVisible Client Connect 2012
 
SEO: Now What Does Google Want?!
SEO: Now What Does Google Want?!SEO: Now What Does Google Want?!
SEO: Now What Does Google Want?!
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
Creating Responsive Website Using Bootstrap
Creating Responsive Website Using BootstrapCreating Responsive Website Using Bootstrap
Creating Responsive Website Using Bootstrap
 
Esse Quam Videri
Esse Quam VideriEsse Quam Videri
Esse Quam Videri
 

Similar to A Day Building Fast, Responsive, Extensible Single Page Applications

Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere Chris Love
 
Responsive web design
Responsive web designResponsive web design
Responsive web designChris Love
 
A night at the spa
A night at the spaA night at the spa
A night at the spaChris Love
 
Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work EverywhereUsing Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work EverywhereChris Love
 
Developing and deploying a website with html5
Developing and deploying a website with html5Developing and deploying a website with html5
Developing and deploying a website with html5Chris Love
 
Rise and Fall of the Frontend Developer
Rise and Fall of the Frontend DeveloperRise and Fall of the Frontend Developer
Rise and Fall of the Frontend DeveloperRafael Casuso Romate
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuningJohn McCaffrey
 
5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season
5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season
5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday SeasonG3 Communications
 
Monkeytalk Fall 2012 - Responsive Web Design
Monkeytalk Fall 2012 - Responsive Web DesignMonkeytalk Fall 2012 - Responsive Web Design
Monkeytalk Fall 2012 - Responsive Web DesignSerge Hufkens
 
WordPress Theme Performance - WP Vienna meetup 8.6.2016
WordPress Theme Performance - WP Vienna meetup 8.6.2016WordPress Theme Performance - WP Vienna meetup 8.6.2016
WordPress Theme Performance - WP Vienna meetup 8.6.2016jancbeck
 
Responsive Web Design - Why and How
Responsive Web Design - Why and HowResponsive Web Design - Why and How
Responsive Web Design - Why and HowJudi Wunderlich
 
UX Alive Conference speaker is Vitaly Friedman (Smashing Magazine) presentations
UX Alive Conference speaker is Vitaly Friedman (Smashing Magazine) presentationsUX Alive Conference speaker is Vitaly Friedman (Smashing Magazine) presentations
UX Alive Conference speaker is Vitaly Friedman (Smashing Magazine) presentationsUX Alive Conference
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slowdmethvin
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practicesmintersam
 
Web Performance 101 - Gil Givati
Web Performance 101 - Gil GivatiWeb Performance 101 - Gil Givati
Web Performance 101 - Gil GivatiMika Josting
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016Chris Love
 

Similar to A Day Building Fast, Responsive, Extensible Single Page Applications (20)

Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere
 
Responsive web design
Responsive web designResponsive web design
Responsive web design
 
A night at the spa
A night at the spaA night at the spa
A night at the spa
 
Using Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work EverywhereUsing Responsive Web Design To Make Your Web Work Everywhere
Using Responsive Web Design To Make Your Web Work Everywhere
 
Developing and deploying a website with html5
Developing and deploying a website with html5Developing and deploying a website with html5
Developing and deploying a website with html5
 
Rise and Fall of the Frontend Developer
Rise and Fall of the Frontend DeveloperRise and Fall of the Frontend Developer
Rise and Fall of the Frontend Developer
 
Web Design Trends: 2018 Edition
Web Design Trends: 2018 EditionWeb Design Trends: 2018 Edition
Web Design Trends: 2018 Edition
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season
5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season
5 Steps To Deliver The Fastest Mobile Shopping Experience This Holiday Season
 
Basics of Backbone.js
Basics of Backbone.jsBasics of Backbone.js
Basics of Backbone.js
 
Monkeytalk Fall 2012 - Responsive Web Design
Monkeytalk Fall 2012 - Responsive Web DesignMonkeytalk Fall 2012 - Responsive Web Design
Monkeytalk Fall 2012 - Responsive Web Design
 
WordPress Theme Performance - WP Vienna meetup 8.6.2016
WordPress Theme Performance - WP Vienna meetup 8.6.2016WordPress Theme Performance - WP Vienna meetup 8.6.2016
WordPress Theme Performance - WP Vienna meetup 8.6.2016
 
Responsive Web Design - Why and How
Responsive Web Design - Why and HowResponsive Web Design - Why and How
Responsive Web Design - Why and How
 
Modern Web Applications
Modern Web ApplicationsModern Web Applications
Modern Web Applications
 
UX Alive Conference speaker is Vitaly Friedman (Smashing Magazine) presentations
UX Alive Conference speaker is Vitaly Friedman (Smashing Magazine) presentationsUX Alive Conference speaker is Vitaly Friedman (Smashing Magazine) presentations
UX Alive Conference speaker is Vitaly Friedman (Smashing Magazine) presentations
 
PrairieDevCon 2014 - Web Doesn't Mean Slow
PrairieDevCon 2014 -  Web Doesn't Mean SlowPrairieDevCon 2014 -  Web Doesn't Mean Slow
PrairieDevCon 2014 - Web Doesn't Mean Slow
 
Building SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.jsBuilding SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.js
 
Mobile Best Practices
Mobile Best PracticesMobile Best Practices
Mobile Best Practices
 
Web Performance 101 - Gil Givati
Web Performance 101 - Gil GivatiWeb Performance 101 - Gil Givati
Web Performance 101 - Gil Givati
 
10 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 201610 things you can do to speed up your web app today 2016
10 things you can do to speed up your web app today 2016
 

More from Chris Love

Quick Fetch API Introduction
Quick Fetch API IntroductionQuick Fetch API Introduction
Quick Fetch API IntroductionChris Love
 
Introduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsIntroduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsChris Love
 
Introduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsIntroduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsChris Love
 
Lazy load Website Assets
Lazy load Website AssetsLazy load Website Assets
Lazy load Website AssetsChris Love
 
Progressive Web Apps for Education
Progressive Web Apps for EducationProgressive Web Apps for Education
Progressive Web Apps for EducationChris Love
 
The server is dead going serverless to create a highly scalable application y...
The server is dead going serverless to create a highly scalable application y...The server is dead going serverless to create a highly scalable application y...
The server is dead going serverless to create a highly scalable application y...Chris Love
 
Real World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker CachingReal World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker CachingChris Love
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsChris Love
 
Implementing a Responsive Image Strategy
Implementing a Responsive Image StrategyImplementing a Responsive Image Strategy
Implementing a Responsive Image StrategyChris Love
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tipsChris Love
 
An Introduction to Microsoft Edge
An Introduction to Microsoft EdgeAn Introduction to Microsoft Edge
An Introduction to Microsoft EdgeChris Love
 
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code CampDoing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code CampChris Love
 

More from Chris Love (14)

Quick Fetch API Introduction
Quick Fetch API IntroductionQuick Fetch API Introduction
Quick Fetch API Introduction
 
Introduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsIntroduction to Progressive Web Applications
Introduction to Progressive Web Applications
 
Introduction to Progressive Web Applications
Introduction to Progressive Web ApplicationsIntroduction to Progressive Web Applications
Introduction to Progressive Web Applications
 
Lazy load Website Assets
Lazy load Website AssetsLazy load Website Assets
Lazy load Website Assets
 
Progressive Web Apps for Education
Progressive Web Apps for EducationProgressive Web Apps for Education
Progressive Web Apps for Education
 
The server is dead going serverless to create a highly scalable application y...
The server is dead going serverless to create a highly scalable application y...The server is dead going serverless to create a highly scalable application y...
The server is dead going serverless to create a highly scalable application y...
 
Real World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker CachingReal World Lessons in Progressive Web Application & Service Worker Caching
Real World Lessons in Progressive Web Application & Service Worker Caching
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
Implementing a Responsive Image Strategy
Implementing a Responsive Image StrategyImplementing a Responsive Image Strategy
Implementing a Responsive Image Strategy
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
An Introduction to Microsoft Edge
An Introduction to Microsoft EdgeAn Introduction to Microsoft Edge
An Introduction to Microsoft Edge
 
Touch the web
Touch the webTouch the web
Touch the web
 
SPAs Are Easy
SPAs Are EasySPAs Are Easy
SPAs Are Easy
 
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code CampDoing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
 

Recently uploaded

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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)wesley chun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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 CVKhem
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
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...Miguel Araújo
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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...Drew Madelung
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

A Day Building Fast, Responsive, Extensible Single Page Applications

  • 1. A Day Building Fast, Responsive, Extensible Single Page Applications Chris Love @ChrisLove Love2Dev.com
  • 2. Who Am I • Front-End Web Dev MVP • ASP Insider • Internet Explorer User Agent • Author • Speaker • Tweaker, Lover of Web, JavaScript, CSS & HTML5 • @ChrisLove • https://love2dev.com
  • 3. Slide Deck & Source Code • Normal Slide Decks – http://slidesha.re/15YTrTT • Today’s Slides - http://bit.ly/1m66Hu6 • Source Code – http://GitHub.com/docluv/movies
  • 4. What Does A Modern Web App Look Like? What is Changing the Definition of the Web? What Does the Developer Experience Look Like?
  • 5. Defining the Modern Web Application
  • 7.
  • 8. Its Not This 326 Http Requests 23 Style Sheets 80kb 84 Images 587kb 101 External Scripts 806kb 229 Primed Http Requests 76 seconds to fully load Multiple Unminimized Resources Speed Index 5949 12+MB of Content Multiple 404s Mostly Uncached Content
  • 9. Performance • Multiple Studies Show Correlation Between Conversions & Speed • 57% Will Abandon a Slow Site After 3 Seconds • We Have to Concentrate 50% Harder For Slow Sites • 78% Have Felt Stress or Anger With Slow Sites • 44% Say Slow Sites Make Them Anxious • 4% Have Thrown Their Phone
  • 10. Matt Cutts "Also take a step back for a minute and consider the intent of this change: a faster web is great for everyone, but especially for users. Lots of websites have demonstrated that speeding up the user experience results in more usage. So speeding up your website isn’t just something that can affect your search rankings–it’s a fantastic idea for your users.“ http://bit.ly/SPPB4k
  • 11. Time is Money • Faster Sites Have Higher Conversion Rates • WalMart - http://bit.ly/S1fHSZ • Google – http://bit.ly/WajJbB • Amazon – http://bit.ly/S3UoAj • ShopZilla - http://bit.ly/RIQMDM
  • 12. WalMart Folks at Walmart knew their pages were slow. As a for instance, initial measurement showed that an item page took about 24 seconds to load for the slowest 5% of users. Why? The usual culprits: too many page elements, slow third-party scripts, multiple hosts (25% of page content is served by partners, affiliates, and Marketplace), and various best practice no-nos http://bit.ly/WajJbB
  • 13. Google’s ½ Second Half a second delay caused a 20% drop in traffic. Half a second delay killed user satisfaction. The lesson, Marissa said, is that speed matters. People do not like to wait. Do not make them. http://bit.ly/TPPhUp
  • 15. Performance • Performance Matters • It Must Be a 1st Class Feature in Any Application • Not an Afterthought Right Before Deployment • 80% of Performance Is In the Client, Not the Server • Cellular Networks Make Page Load Even Tougher • 500ms Inherent Delay • Bandwidth Constraints
  • 16. Modern Web Applications MUST Load Fast and Respond Fast
  • 17. Mobile or Device Fragmentation
  • 18. Touch
  • 21. The Modern Web Hour Glass HTML5 JavaScript CSS3 ASP.NET.IIS DB – SQL Server/NoSQL
  • 22. (API + HTML5 + CSS3 + JavaScript + Standards Compliant Browser) * (Touch + Mobility + Performance) === Great Single Page Application
  • 24. Introduction to Fluid Layouts •Morph to Fill The ViewPort Space •Rely on CSS • Absolute Positioning
  • 25.
  • 26. DOCTYPE Replace This: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> With This: <!DOCTYPE html> <html>
  • 27. DOCTYPE "DOCTYPEs are required for legacy reasons. When omitted, browsers tend to use a different rendering mode that is incompatible with some specifications. Including the DOCTYPE in a document ensures that the browser makes a best- effort attempt at following the relevant specifications." http://www.w3.org/TR/html5/syntax.html#the-doctype
  • 28. Absolute Positioning .site-header { position: absolute; top: 0; right: 0; left: 0; height: 80px; }
  • 30. Responsive Web Design • Introduced by Ethan Marcotte 2010 - bit.ly/178an9e • Web Design Approach To Create An Optimal Viewing Experience Across All Browser ViewPorts • Fluid Layouts • Media Queries • Minimal if any JavaScript Required
  • 31. “this unspoken agreement to pretend that we had a certain size. And that size changed over the years. For a while, we all sort of tacitly agreed that 640 by 480 was the right size, and then later than changed to 800:600, and 1024; we seem to have settled on this 960 pixel as being this like, default. It’s still unknown. We still don’t know the size of the browser; it’s just like this consensual hallucination that we’ve all agreed to participate in: “Let’s assume the browser has a browser width of at least 960 pixels.” Jeremy Keith bit.ly/1bhH6rw Responsive Design
  • 32. “The emergence of ideas like “responsive design” and “future-friendly thinking” are in part a response to the collective realization that designing products that solve one problem in one context at a time is no longer sustainable. By refocusing our process on systems that are explicitly designed to adapt to a changing environment, we have an opportunity to develop durable, long-lasting designs that renew their usefulness and value over time.” Wilson Miner bit.ly/1fbq5lB Responsive Design
  • 33. “Any attempt to draw a line around a particular device class has as much permanence as a literal line in the sand. Pause for a moment and the line blurs. Look away and it will be gone. Let’s take the absolute best case scenario. You’re building a web app for internal users for whom you get to specify what computer is purchased and used. You can specify the browser, the monitor size, keyboard, etc.” Jason Grigsby bit.ly/KzJH9G Responsive Design
  • 34. “How long do you think that hardware will be able to be found? Three years from now when a computer dies and has to be replaced, what are the chances that the new monitor will be a touchscreen? By making a decision to design solely for a “desktop UI”, you are creating technical debt and limiting the longevity of the app you’re building. You’re designing to a collective hallucination. You don’t have to have a crystal ball to see where things are headed. And once you start accepting the reality that the lines inside form factors are as blurry as the lines between them, then responsiveness becomes a necessity.” Jason Grigsby bit.ly/KzJH9G Responsive Design
  • 35.
  • 36.
  • 37.
  • 38. Mobile First • Determine The Most Important Information • Expand From There • Start Responsive Design Mobile First
  • 42. Media Queries @media (min-width:600px) { /* Rules Here */ } @media (min-width:800px) { /* Rules Here */ }
  • 43. Responsive Design Best Practices •Start Small Screen First •Forces Most Important Data First •Easier to Adjust CSS Rules •Let Data Drive Media Queries First •Its Ok to Use Some JavaScript •But Not Required
  • 46. Touch Your Application • Content Must Be Touchable • Account for Fat Fingers • Support APIs • Mouse • Touch (Apple) • Pointer (MSFT & W3C)
  • 48. Touch Your Application • The Average Human Finger is 11mm in Diameter • Fingers Range from 8mm - 19mm • Baby to Large Man
  • 49. Touch Your Application • Touch Points Need Margin • Or Separation From Neighbors
  • 50. Touch Gestures • Pan • Pinch/Zoom • Swipe • Tap • Tap + Hold • Rotate
  • 51. Touch-action • CSS Property to Help Determine How Touch is Handled • Auto • None • Pan-x • Pan-y • Can disable Auto-zoom • Enable Scrolling
  • 52. Scrolling Content overflow: scroll; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; -ms-scroll-chaining: none; -ms-scroll-translation: vertical-to-horizontal;
  • 53. DeepTissue • Abstracts Touch & Mouse APIs • Abstracts Input Modality Gestures • http://deeptissuejs.com
  • 54.
  • 55. INPUT TYPE=XXXX • New Input Types Drive On-Screen Keyboards • Drives Native Validation • Tel, email, url, number, etc
  • 57. The Server-Side Story • Provide Markup, CSS, JavaScript, Images • API End Points • Possible Legacy URL Redirects • Deal with Search Engine Spiders and Legacy Browsers
  • 58. The Modern Web Hour Glass HTML5 JavaScript CSS3 ASP.NET.IIS DB – SQL Server/NoSQL
  • 59. SPAHelper Library • Extends ASP.NET MVC • Custom SPAWebViewPage • SPAModel • SPAHelper • http://bit.ly/1dUYLGJ
  • 60. SPAWebViewPage • Must Use it as Base for MVC View • Extends MVC’s WebViewPage • SPARenderPage • Causes only Changed Content to be Sent to Client • Works in Concert with Backpack to Cache Markup in localStorage
  • 61. SPAWebViewPage • Must Configure View web.config file: • <pages pageBaseType="SPAHelper.SPAWebViewPage">
  • 63. SPAModel • The SPAModel provides a base for an ASP.NET MVC single page application model • The model has properties for the application's Title and Description • The SetRoute function parses a SPA route to isolate the primary root
  • 64. SPAHelper • The SPAHelper class is a collection of static and static ASP.NET MVC HTML Helper extension functions • SPALink • LastUpdated • HasEscapeFragment • HasForceReload
  • 65. _escape_fragment_ • Google’s Specification for AJAX Applications • http://bit.ly/117sTgL • Allows Routes to be Sent to Server Via QueryString • Server Sends Google Fully Rendered Markup • Good Core Site Solution • Legacy Browser Version • Andy Hume of the Guardian - http://vimeo.com/channels/smashingconf
  • 66. Cutting The Mustard • Feature Detect to Determine Browser Capabilities • Never Browser Sniff if (!('querySelector' in document) //at least IE8 || !('localStorage' in window) //at least IE8 || !('addEventListener' in window) //at least IE8 || !('matchMedia' in window)) {//at least IE10 } else { }
  • 68. The Client-Side Story • Things You Used to Do On the Server Now Live In the Client • Routing • Rendering • Data Caching • Need to be Conscience of How Browsers Work • Critical Rendering Path • Memory Management • Leverage HTML5 Features • Storage • Animations
  • 69. Press # For More • Routes Are Not Sent to Server • No Request/Response Iniated • Must Respond to Route in the Client • #! Is the Defacto Standard
  • 70. Press # For More window.addEventListener("hashchange", function (e) { //swap the View Here });
  • 71. What About These Guys? •Angular •Ember •Backbone •Durandal
  • 72. Common Problems •Too Large •Try to be everything to everybody •Memory Leaks •Many Brittle Practices •Routing •Virtualize Native Functionality
  • 73.
  • 74. The Love2SPA Way • SPAjs • Backpack/Mud Bath * • DollarBill** • Caching AJAX Layer • HTML Template Engine • Deeptissue • Toolbar, Panorama, Other Small UI Libraries * Under Development ** jQuery Compatible
  • 75. The Love2SPA Way – Typical Stats • 35-80kb minified, not gzipped JavaScript • 20-35kb minified, not gzipped CSS • 5-35kb minified, not gzipped HTML • 3 Core Http Requests • < 1 second Load Time
  • 76.
  • 77. The Love2SPA Way • Extensible • Scalable • Maintainable • Testable • Deployable • Have Tangible ROI
  • 78. SPAjs • Responsible for Routing • View Switching • Executes Animations • Relies on Animate.css - http://bit.ly/1hayo4s • Executing View Onload and Unload Functions
  • 79. Backpack • Stores View Markup & Templates in localStorage • 1st Implemented by Google & Bing • http://bit.ly/117puyn • Implements an API expected by SPAjs • MudBath a work in Progress • Implements Same API • Used IndexDB
  • 80. AjaxPrefilter • Caches Data in localStorage with a TTL • 1st Implement by Paul Irish • http://bit.ly/117p7E9 • Can be Used with Any AJAX Implementation • Eliminates Unnecessary HTTP Requests
  • 81. JavaScript Templating • Merges JavaScript Objects with Markup • Many Libraries • Micro-Templating • MUSTACHE • Handlebars • Generated Markup Appended to DOM
  • 82. JavaScript Templating <script id="MoviePosterGridTemplate" type="text/x-mustache-template"> {{#movies}} <div class="movie-target"> <a href="#!movie/{{id}}/{{title}}"> <img alt="{{title}}" src="{{poster}}" class="movie-grid-poster"> <figcaption class="demo-photo-caption">{{title}}</figcaption> </a> </div> {{/movies}} </script>
  • 84. Create Modular, Extensible JavaScript Application • Functions 1st Class in JavaScript • Functions are Objects • var foo = {}; • All Objects have a Prototype • new Keyword creates a new Object • Many popular Patterns
  • 86. Think Like jQuery • The jQuery Module Pattern is Familiar • Not Hard to Implement • Allows for Extensibility
  • 87. A SPA Application Module App View View View
  • 89. Building Web Applications • Just Like C# Applications • Release • Debug • The Web Needs a Compiler • 2 Great Options • Grunt • Gulp
  • 90. Building Web Applications • Grunt & Gulp Are Node Modules • http://gruntjs.com • http://gulpjs.com • Both have great eco-systems • Add To package.json • Run npm install • Create gruntfile.js • Grunt.cmd
  • 92. Going Offline • Leverage the AppCache • Create a Manifest File • Don’t Let it be a Handicap • http://bit.ly/117q27A • Makes Sure Your App Will Work Without Connectivity • Good for Caching Images and Resources • Makes the Browser look Local Before Going to the Server
  • 93. Developing with AppCache is a PITA @{if (HttpContext.Current.IsDebuggingEnabled) { @:<html lang="en"> } else { @:<html lang="en" manifest="app.cache"> } }
  • 94. Manifest File • CACHE • lists all resources that should be downloaded for offline use • NETWORK • identifies any URLs that require the device be connected to the network • FALLBACK • lists replacement URLs for network URLs to be used when the device is offline
  • 95. How AppCache Works • When the browser reads the manifest file it downloads the specified resources locally • Those resources are referred too instead of making a request to the server • Resources are refreshed if the manifest file has been updated
  • 97. High Performance Single Page Web Applications • Responsive Design • Touch • Mobile First • SPA • Extensible, Scalable Architecture • Web Build and Workflow • Goes Really Fast! • ~395 Pages • 20 Chapters • $9.99 http://amzn.to/1a55L89