RESS: An Evolution of Responsive Web Design

73
RESS: An Evolution of Responsive Web Design Dave Olsen, @dmolsen WVU University Relations - Web Refresh Pittsburgh, May 15 2012

description

Responsive web design has become an important tool for front-end developers as they develop mobile-optimized solutions for clients. Browser-detection has been an important tool for server-side developers for the same task for much longer. Unfortunately, both techniques have certain limitations. I’ll show how both front-end and server-side developers can take advantage of the new technique called RESS (Responsive Web Design with Server Side Components) that aims to be combine the best of both worlds for delivering mobile-optimized content.

Transcript of RESS: An Evolution of Responsive Web Design

Page 1: RESS: An Evolution of Responsive Web Design

RESS:An Evolution of Responsive Web Design

Dave Olsen, @dmolsenWVU University Relations - WebRefresh Pittsburgh, May 15 2012

Page 2: RESS: An Evolution of Responsive Web Design

slideshare.net/dmolsenwvu

Page 3: RESS: An Evolution of Responsive Web Design

programmer9 years at wvuwvu has 30,000 students

Page 4: RESS: An Evolution of Responsive Web Design

What I’ll Talk About

•The Responsive Age

•What is RESS

•Two Server-side Solutions

Page 5: RESS: An Evolution of Responsive Web Design

The Responsive Age We’ve entered...

Page 7: RESS: An Evolution of Responsive Web Design

http://flic.kr/p/9UmsCJ

Page 8: RESS: An Evolution of Responsive Web Design

DES

KTO

P W

EBTA

BLET

WEB

MO

BILE WEB

It’s All One Web

Page 10: RESS: An Evolution of Responsive Web Design

http://flic.kr/p/9Qp3A

Page 11: RESS: An Evolution of Responsive Web Design

The client is now in charge

Page 12: RESS: An Evolution of Responsive Web Design

One...

http://flic.kr/p/5pGcyx

Why Be Responsive

Page 13: RESS: An Evolution of Responsive Web Design

One...

URL.

Why Be Responsive

Page 14: RESS: An Evolution of Responsive Web Design

One...

Set of Mark-up.

Why Be Responsive

Page 15: RESS: An Evolution of Responsive Web Design

One...

Deployment.

Why Be Responsive

Page 16: RESS: An Evolution of Responsive Web Design

futurefriend.ly

Page 17: RESS: An Evolution of Responsive Web Design

balloons

Time to Party...

http://flic.kr/p/h6McT

Page 18: RESS: An Evolution of Responsive Web Design

http://flic.kr/p/8x6b8X

“Not so fast, my friends...”

Page 19: RESS: An Evolution of Responsive Web Design

Media...

Images & Video

RWD Challenges

Page 20: RESS: An Evolution of Responsive Web Design

3rd Party Content...Ads & Social Widgets

RWD Challenges

Page 21: RESS: An Evolution of Responsive Web Design

One Set of Mark-up...Double-edged Sword

RWD Challenges

Page 22: RESS: An Evolution of Responsive Web Design

Learned the hard way...

http://happyholidays.wvu.edu

Page 23: RESS: An Evolution of Responsive Web Design

Standards Process

Standards Process is Evolving

http://www.w3.org/community/respimg/

Page 24: RESS: An Evolution of Responsive Web Design

Mind the Gap

http://flic.kr/p/638wPy

Bridging the Gap

Page 25: RESS: An Evolution of Responsive Web Design

adaptive images website

http://adaptive-images.com/

Existing Solutions

Page 26: RESS: An Evolution of Responsive Web Design

image of a path for showing RESS as a way forward

Take a New Path

http://flic.kr/p/7cGN8g

Page 27: RESS: An Evolution of Responsive Web Design

What is RESS?

Page 28: RESS: An Evolution of Responsive Web Design

Responsive Web Design +Server Side Components

(I have no idea what becomes of the W, D, or C)

Page 29: RESS: An Evolution of Responsive Web Design

“In a nutshell, RESS combines adaptive layouts with server side component (not full page) optimization. So a single set of page templates define an entire Web site for all devices but key components within that site have device-class specific implementations that are rendered server side.

- Luke Wroblewski @lukew

http://www.lukew.com/ff/entry.asp?1392

Page 30: RESS: An Evolution of Responsive Web Design

“...browser-detection can be used to help inform an overall responsive design as opposed to being the be-all-end-all for templating.

- Dave Olsen @dmolsen

http://bit.ly/wW91Ie

Page 31: RESS: An Evolution of Responsive Web Design

•If you want layout adjustments across devices.

•And optimization at the component level to increase performance or tune user experience.

•You trust server-side device detection with sensible defaults.

http://www.lukew.com/ff/entry.asp?1509

RESS is Good if...

“ - Luke Wroblewski @lukew

Page 32: RESS: An Evolution of Responsive Web Design

Simple Example: Swapping a Header & Footer

Mobile View Desktop View

http://www.lukew.com/ff/entry.asp?1392

Page 33: RESS: An Evolution of Responsive Web Design

Simple Example: Swapping a Header & Footer

http://www.lukew.com/ff/entry.asp?1392

<body> {{>header}}

[...document content...]

{{>footer}}</body>

Page 34: RESS: An Evolution of Responsive Web Design

Simple Example: Swapping a Header & Footer

http://www.lukew.com/ff/entry.asp?1392

<body> {{>header}}

[...document content...]

{{>footer}}</body>

Page 35: RESS: An Evolution of Responsive Web Design

Simple Example: Swapping a Header & Footer

http://www.lukew.com/ff/entry.asp?1392

index.htmlheader.htmlmobile_header.htmlfooter.htmlmobile_footer.html

Page 36: RESS: An Evolution of Responsive Web Design

Simple Example: Swapping a Header & Footer

http://www.lukew.com/ff/entry.asp?1392

index.htmlheader.htmlmobile_header.htmlfooter.htmlmobile_footer.html

Page 37: RESS: An Evolution of Responsive Web Design

DES

KTO

P W

EBM

-AD

VAN

CED

ress.dmolsen.com

MO

BILE BA

SIC

Page 38: RESS: An Evolution of Responsive Web Design

Infancy

RESS is in Its Infancy...

http://flic.kr/p/7B7uyp

Page 39: RESS: An Evolution of Responsive Web Design

Untested

...and untested.

http://flic.kr/p/nNZRV

Page 40: RESS: An Evolution of Responsive Web Design

ND data

http://weedygarden.net/2012/05/a-case-for-ress/

U. of Notre Dame Example

Page 41: RESS: An Evolution of Responsive Web Design

ND data

http://weedygarden.net/2012/05/a-case-for-ress/

Large Screen: 136 requests @ 2.7MB

Small Screen: 23 requests @ 291K

Page 42: RESS: An Evolution of Responsive Web Design

bridge

We Still Need to Bridge the Gaphttp://flic.kr/p/7FyCB2

Page 43: RESS: An Evolution of Responsive Web Design

developers and designers

Designers + Developers?

http://flic.kr/p/7Ma9n

Page 44: RESS: An Evolution of Responsive Web Design

So how would we implement?

http://flic.kr/p/5ATc7g

How Do We Implement RESS?

Page 45: RESS: An Evolution of Responsive Web Design

Responsive Web Design is “easy”

Skipping RWD

http://flic.kr/p/4YM8

Page 46: RESS: An Evolution of Responsive Web Design

Two Possible Solutions

Server-sideSolutions

http://flic.kr/p/9jatna

Page 47: RESS: An Evolution of Responsive Web Design

Browser Detection#1

Page 48: RESS: An Evolution of Responsive Web Design

Old dog

http://flic.kr/p/bWQicm

Been Around a While

Page 49: RESS: An Evolution of Responsive Web Design

82% of the Alexa 100 top sites use some form of server-side mobile device detection to serve content on their main website entry point.“

- Ronan Cremin @xbs

http://www.circleid.com/posts/20120111_analysis_of_server_side_mobile_web_detection/

Used Quite a Bit

Page 50: RESS: An Evolution of Responsive Web Design

WURFL

DeviceAtlasOpenDDR

51Degrees.mobi

Lots of Solutions

Page 51: RESS: An Evolution of Responsive Web Design

Personal Fav*: ua-parser

node.js, Python, PHP, & Ruby libraries built upon a standard YAML file

https://github.com/tobie/ua-parser/* - I help maintain the project ;)

Page 52: RESS: An Evolution of Responsive Web Design

Arms Race?

http://flic.kr/p/6RVLY2

Page 53: RESS: An Evolution of Responsive Web Design

Server-side Feature Detection#2

Page 54: RESS: An Evolution of Responsive Web Design

Infancy

Also in Its Infancy...

http://flic.kr/p/7B7uyp

Page 55: RESS: An Evolution of Responsive Web Design

Untested

...and untested.

http://flic.kr/p/nNZRV

Page 56: RESS: An Evolution of Responsive Web Design

Can be Simple or Complex

Taking a Cue from Front-End Dev

Page 57: RESS: An Evolution of Responsive Web Design

Server-side Future Friendly?

Page 58: RESS: An Evolution of Responsive Web Design

Server-side Breakpoints

320px

640px

960px

Page 59: RESS: An Evolution of Responsive Web Design

Simple Example: Setting a file path based on window.innerWidth<script type="text/javascript">

function writeCookie(name, value) { //cookie code }

// store the innerWidth of the window in a cookie writeCookie("RESS", window.innerWidth);

</script>

http://www.netmagazine.com/tutorials/getting-started-ress

Server-side Breakpoints

Page 60: RESS: An Evolution of Responsive Web Design

<?php

// grab the cookie value $screenWidth = $_COOKIE[‘RESS’];

// set the img path var if ($screenWidth <= 320) { $imgPath = “320”; } else if ($screenWidth < 960) { $imgPath = “640”; } else { $imgPath = “960”; }

// print out our image link print “<img src=‘/rwd/images/”.$imgPath.”/car.jpg’ alt=‘Car’ />”;

?>

Simple Example: Setting a file path based on window.innerWidth

http://www.netmagazine.com/tutorials/getting-started-ress

Page 61: RESS: An Evolution of Responsive Web Design

Robust Feature Detection

http://detector.dmolsen.com

Page 62: RESS: An Evolution of Responsive Web Design

<?php

// require Detector to identify browser & populate $ua require("lib/Detector/Detector.php");

$html5Embed = "<iframe {...} ></iframe>"; $simpleLink = "Your browser doesn't appear to support HTML5. {...}";

// use the $ua properties to switch if ($ua->video->h264 || $ua->video->webm) { ! print $html5Embed; } else {! print $simpleLink;! }

?>

Simple Example: Inserting a video link

http://detector.dmolsen.com/demo/ytembed/

Robust Feature Detection

Page 63: RESS: An Evolution of Responsive Web Design

Complicated Example: Templates Using Detector & Mustache

http://ress.dmolsen.com & click “Learn more...”

Robust Feature Detection

Page 64: RESS: An Evolution of Responsive Web Design

RESS isn’t a silver bullet.(anymore than RWD is)

RESS Challenges

Page 65: RESS: An Evolution of Responsive Web Design

Server-side feature detection can be spoofed.

RESS Challenges

Page 66: RESS: An Evolution of Responsive Web Design

Requires server-side languages.

RESS Challenges

Page 67: RESS: An Evolution of Responsive Web Design

Data needs to be separated from layout.

RESS Challenges

Page 68: RESS: An Evolution of Responsive Web Design

It is not only the design of the web site and the layout of content that needs to be adapted or enhanced; the idea of being responsive, adaptive and enhancing, must be implemented in the whole value chain.

RESS Challenges

“ - Jon Arnes Sæterås @jonarnes

http://mpulp.mobi/2011/05/next-steps-of-responsive-web-design/

Page 69: RESS: An Evolution of Responsive Web Design

The evolution of web development continues...

The

of Web DevelopmentContinues

http://flic.kr/p/3Q4To4

Page 70: RESS: An Evolution of Responsive Web Design

Questions or comments?

Page 71: RESS: An Evolution of Responsive Web Design

On Twitter @dmolsen...

Page 72: RESS: An Evolution of Responsive Web Design

Or at dmolsen.com...

Page 73: RESS: An Evolution of Responsive Web Design

Thank You