Top Banner
128

There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Apr 16, 2017

Download

Design

Aaron Gustafson
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 2: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Hi!I’m @AaronGustafson

Page 3: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

What is PROGRESSIVE ENHANCEMENT?

Page 4: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

TECHNOLOGICAL RESTRICTIONS

Page 5: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

USER

EXP

ERIE

NCE

BROWSER CAPABILITIESBASIC ADVANCED

Page 6: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Content

Semantics

Design

Interactivity

Page 7: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 8: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

reddit.com

Page 9: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 10: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 11: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 12: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Make your mobile site strategy simply your website strategy

Page 13: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

bbc.com/news

Page 14: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 15: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

“We have developed a new version of the News website which implements a

responsive design so that we can offer all our users the best experience possible no

matter what device they are using.”

NIKO VIJAYARATNAM SENIOR PROJECT MANAGER - BBC

Page 16: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

RESULTS 1

code base

30 different languages

EFFORT 4 years

50 contributors

5000 pull requests

Page 17: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

BEFORE AFTER

Page 18: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 19: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

“Looking back, using Mobile First was genius. We were able to strip everything back to the core content, the stuff that

mattered to users. No JavaScript. No cruft. Just the good

stuff. Journalism at its best.”

JOHN CLEVELY @JCLEVELEY

Page 20: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

cnn.com

Page 21: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 22: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 23: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 24: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 25: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 26: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

bcbst.com

Page 27: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

What you’d expect

Page 28: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

What you might get

Page 29: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

So what’s the PROBLEM?

Page 30: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Assuming JAVASCRIPT

is always available

Page 31: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

How many people are missing out on JavaScript-based enhancement?

Page 32: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

1.1% according to the UK’s GDS

Page 33: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

+0.2% JavaScript disabled or

unavailable

0.9% JavaScript enabled but never received

Page 34: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

That’s 1 in 93 people

Page 35: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 36: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

LOGIN IS AN EASY FIX1. Include the Login Form in your markup and give it a

unique id: <form id="login">

2. Hide it by default: form#login { display: none; }

3. Make the activation link target it: <a href="#login">Login…</a>

4. Show the form when someone clicks the link:form#login:target { display: block; }

5. Use CSS to transition the opacity to make it look friggin’ sweet!

Page 37: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

OR EVEN EASIER…1. Make the link point to a login page

Page 38: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 39: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

NAVIGATION

thebostoncalendar.com/system/events/photos/000/023/300/original/tumblr_n9wbg5xUuK1qbycdbo1_1280.jpg?1421977741

Large screen Small screen Touch devices Mouse users Mouse and touch enabled devices Keyboard users Color blind users Screen readers Users without JavaScript

Page 40: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

nichols.edu

Page 41: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 42: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Hamburger menu acts as jump link to navigation at bottom of the page; main and sub nav are shown

SCENARIOSIF NO JS; SMALL SCREEN WIDTH

Show main navigation; hide sub nav on default under drop down menus nested within main; use CSS to show sub navigation on hover

IF NO JS or JS; LARGE SCREEN WIDTH

Hamburger menu toggles off-screen navigation pattern; two levels of nested navigation - expand/collapse functionality for sub-nav

IF JS; SMALL SCREEN WIDTH

Make top level navigation items link to landing pages with sub-nav accessible

FOR TOUCH DEVICES; LARGE SCREEN WIDTH

Page 43: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 44: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 45: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 46: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 47: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 48: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 49: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 50: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Would you believe you CAN DO THAT

without JavaScript?

Page 51: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

<form id="get-a-quote" action="…"> <p> <label for="stock-symbol">Stock Lookup</label> <input id="stock-symbol" type="text" name="SID_VALUE_ID" required="required" list="search-options"> <button type="submit"><b>Get a Quote</b></button> </p> </form>

<!-- … -->

<datalist id="search-options"> <option value="A">A: AGILENT TECHNOLOGIES INC</option> <option value="ANF">ANF: ABERCROMBIE &amp; FITCH -CL A</option> <!-- continued --> </datalist>

Page 52: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

<form id="get-a-quote" action="…"> <p> <label for="stock-symbol">Stock Lookup</label> <input id="stock-symbol" type="text" name="SID_VALUE_ID" required="required" list="search-options"> <button type="submit"><b>Get a Quote</b></button> </p> </form>

<!-- … -->

<datalist id="search-options"> <option value="A">A: AGILENT TECHNOLOGIES INC</option> <option value="ANF">ANF: ABERCROMBIE &amp; FITCH -CL A</option> <!-- continued --> </datalist>

Page 53: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 54: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Surely that REQUIRES JavaScript!?

Page 55: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

<details> <summary> <h1>YHOO Snapshot</h1> <div class="tabular"> <dl class="symbol"> <dt>Symbol</dt> <dd><a href="#" title="Yahoo">YHOO</a></dd> </dl> <dl class="price"> <dt>Last Price</dt> <dd>62.95</dd> </dl> <!-- more --> </div> </summary> <div class="additional"> <figure> … </figure> <ul class="headlines"> … </ul> </div> </details>

Page 56: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

<details> <summary> <h1>YHOO Snapshot</h1> <div class="tabular"> <dl class="symbol"> <dt>Symbol</dt> <dd><a href="#" title="Yahoo">YHOO</a></dd> </dl> <dl class="price"> <dt>Last Price</dt> <dd>62.95</dd> </dl> <!-- more --> </div> </summary> <div class="additional"> <figure> … </figure> <ul class="headlines"> … </ul> </div> </details>

Page 57: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 58: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 59: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 60: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

100 MILLISECONDS is how long you have for the user to feel like the task was instantaneous.

1 SECOND is how long you have for the user’s state of flow to remain uninterrupted (though the delay will still be noticeable)

10 SECONDS is how long you have before the user loses interest entirely and will want to multitask while the task is completing.

http://www.nngroup.com/articles/response-times-3-important-limits/

Page 61: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

To keep an uninterrupted flow, we want to aim for a first

render time of 1 SECOND

Page 62: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

40% of people abandon a website that takes more than 3 second to load

blog.kissmetrics.com/loading-time/

Page 63: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

WALMART.COM found that for every second of load time improvement, conversions increased by up to 2% STAPLES.COM found that for every one second of improvement conversions increased by 10%

radware.com/fall-sotu2014/

Page 64: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Over the last few years, the average web page size has grown:

Nov 20

11

May 20

12

Nov 20

12

May 20

13

Nov 20

13

May 20

14

Nov 20

14

May 20

15

2099Kb

1907Kb1775Kb

1653Kb

1448Kb1269Kb

1059Kb929Kb

soasta.com/blog/page-bloat-average-web-page-2-mb/

Page 65: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

The top 100 Ecommerce home pages take 6.5 SECONDS

to render and 11.4 SECONDS

to fully load

Page 66: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

IMAGE STRATEGY needs to be a top priority for enhancing our websites

Page 67: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

llbean.com forever21.com ae.com zappos.com abercrombie.com gap.com modcloth.com

0.67MB 0.88MB 1.21MB 1.36MB 2.37MB 2.84MB

12.28MB

Page 68: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

bananarepublic.com 3.505MB

(2.67MB in images)

Page 69: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 70: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 71: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

HTML TEXT WEB FONTS SVG CSS GRADIENTS PICTURE/SRCSET & SIZES

Page 72: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

NASTYGAL.COM

Page 73: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 74: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 75: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

landsend.com

Page 76: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 77: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 78: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

<picture> <source media="(min-width: 767px)" srcset="20150402-feature_bb.jpg"> <img src="20150402-mobile.jpg" alt="Buttons and beyond: save 30%"> </picture>

Page 79: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

codepen.io/Jenn/pen/ef916555aa228574247599d7948b578c

Page 80: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

caniuse.com/#feat=picture

Page 81: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 82: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Enhance images with SVG

Page 83: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

FOREVER21.COM

Page 84: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

<h1> <a href="/"> <!--[if IE 8]><div class="logo-ie"></div><![endif]--> <svg id="logo" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 244 41" style="enable-background:new 0 0 244 41;" xml:space="preserve"> <path fill="#FFFFFF" d="M0,40.66h5.73V23.45h9.89v-5.44H5.73V5.78h11.35V0.34H0V40.66z M34.72,0c-4.67,0-9.61,3.28-9.61,9.85v21.29 c0,6.57,4.95,9.85,9.61,9.85c4.67,0,9.61-3.28,9.61-9.85V9.85C44.33,3.28,39.39,0,34.72,0z M38.6,31.15 c0,2.78-1.8, 4.08-3.88,.14c-4.78,0-8.6,3.96-8.6,8.78v3.17h5.73V8.66 c0-1.87,1.12-2.89,2.81-2.89c2.81,0,2.81,2.43,2.81,4.47c0,2.21,0,3.34-1.01,5.32l-10.34,19.65v5.44h17.09v-5.78h-10.34 l8.43-16.37C225.32,15.06,225.43,14.04,225.43,10.14z M238.27,0.34l-5.73-0.02v6.16l5.73-0.03v34.21H244V0.34H238.27z"></path> </svg> </a> </h1>

Page 85: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

caniuse.com/#search=svg

Page 86: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

sarasoueidan.com/blog/svg-picture

Page 87: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Content strategy should be a part of your

image strategy

Page 88: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

ralphlauren.com 3.21MB

Page 89: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 90: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 91: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 92: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 93: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 94: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 95: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 96: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

WEB 1.0

PAGE 1 PAGE 2

CART

CONFIRMATION

LINK CLICK

ADD TO CART

CHECKOUT

SERVER

Page 97: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

GETTING TO PAGE 11. Browser requests web page

2. Server delivers web page

3. Browser displays web page

Page 98: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

“SINGLE PAGE APP”PAGE 1 PAGE 2

CART

CONFIRMATION

LINK CLICK

ADD TO CART

CHECKOUT

JAVASCRIPT

Page 99: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

GETTING TO PAGE 11. Browser requests web page

2. Server delivers HTML shell (<body></body>)and JavaScript framework (e.g. Ember, Angular, etc.)

3. Browser downloads, parses & executes JavaScript framework to get it into memory

4. Framework begins requesting the actual web page content

5. Server delivers web page bits

6. Browser displays web page

Page 100: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

“At some point recently, the browser transformed from being an awesome interactive

document viewer into being the world’s most advanced, widely-distributed application

runtime.”

TOM DALE PROGRESSIVE ENHANCEMENT: ZED’S DEAD, BABY

http://tomdale.net/2013/09/progressive-enhancement-is-dead/

Page 101: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 102: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

UPSIDE

• More “native app”-like feel

• Less reliance on “the server”

• More JavaScript!

Page 103: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

DOWNSIDE

• More JavaScript!

•Slower to get to page load

•Executing in an unknown environment

Page 105: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 106: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 107: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 108: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 109: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Let’s look at my HEALTHCARE DASHBOARD

Page 110: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 111: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

WHAT’S HAPPENING HERE?

1. Load HTML shell (header, footer, etc.)

2. Download and display a nice animated loading icon

3. Use JavaScript to request the remaining dashboard content and load it in

Page 112: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

WHAT’S THE FALLBACK?

1. Load HTML shell (header, footer, etc.)

2. Download and display a nice animated loading icon

3. Use JavaScript to request the remaining dashboard content and load it in

Page 113: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 114: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

1. Assemble the content you need to display the page

2. Send the page.

3. There is no step 3.

AN ALTERNATIVE APPROACH

Page 115: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

AN ALTERNATIVE APPROACH

1. Assemble the content you need to display the page

2. Send the page.

3. There is no step 3.If you have a widget that needs to be dynamic, take it over with JS after load and make it update dynamically.

Page 116: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

nerds.airbnb.com/isomorphic-javascript-future-web-apps/

Page 117: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

ISOMORPHIC JAVASCRIPT

• Server sends a real page

• JavaScript takes over to create a single page app if possible

• If not possible, all links & functionality go through the server

Page 118: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

HOW ISOMORPHIC JS WORKS

PAGE 1 PAGE 2

CART

CONFIRMATION

LINK CLICK

ADD TO CART

CHECKOUT

JAVASCRIPT OR THE SERVER

Page 119: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

But you don’t need to use Isomorphic JavaScript

Page 120: There Are No “Buts” in Progressive Enhancement [Øredev 2015]
Page 121: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

“Say what you will about server-rendered apps, the performance of your server is much more

predictable, and more easily upgraded, than the many, many different device configurations of your users. Server-rendering is important to

ensure that users who are not on the latest-and-greatest can see your content immediately when

they click a link.”

TOM DALE YOU’RE MISSING THE POINT OF SERVER-SIDE RENDERED JAVASCRIPT APPS

tomdale.net/2015/02/youre-missing-the-point-of-server-side-rendered-javascript-apps/

Page 122: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Let me tell you a story…

Page 123: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

$X iPhone, iPad, Android,

Windows Phone

$X/3 1,400 more devices

Page 124: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

$X iPhone, iPad, Android,

Windows Phone

$X/3 1,400 more devices

$X/6

Page 125: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Progressive enhancement JUST WORKS

Page 126: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

We need to think in terms of EXPERIENCE AS A CONTINUUM

Page 127: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

Progressive enhancement embraces THE GRAIN OF THE WEB rather than going against it.

Page 128: There Are No “Buts” in Progressive Enhancement [Øredev 2015]

SLIDE DESIGN BY @JENNLUKAS ILLUSTRATIONS BY @MSUTTERS