33
ONE PAGE ONE CODEBASE How to Write a Crawlable Single Page Web App -OR- Thursday, August 1, 13

One Page, One App -or- How to Write a Crawlable Single Page Web App

  • View
    794

  • Download
    0

Embed Size (px)

DESCRIPTION

talk from Dvlpdnver2013

Citation preview

Page 1: One Page, One App -or- How to Write a Crawlable Single Page Web App

ONE PAGEONE CODEBASE

How to Write a CrawlableSingle Page Web App

-OR-

Thursday, August 1, 13

Page 2: One Page, One App -or- How to Write a Crawlable Single Page Web App

@technicolorenvy

Thursday, August 1, 13

Page 3: One Page, One App -or- How to Write a Crawlable Single Page Web App

noun1. any application that uses

a web browser as a client.{ }web ap·pli·ca·tion

Thursday, August 1, 13

Page 4: One Page, One App -or- How to Write a Crawlable Single Page Web App

“Web 2.0 app”

Routing

View Rendering

Models,Collections

Persistence

l18n

Currency formatting, etc.

localStorage cache

Handling user events

Logging Static Assets

Client

Server

inspired by http://nerds.airbnb.com/slides-and-video-from-spike-brehms-tech-talk/

Thursday, August 1, 13

Page 5: One Page, One App -or- How to Write a Crawlable Single Page Web App

Good SEO, Crawlable

Initial load

App logic is DRY

Native-app-like

Thursday, August 1, 13

Page 6: One Page, One App -or- How to Write a Crawlable Single Page Web App

SPA ALL THE THINGS!

Thursday, August 1, 13

Page 7: One Page, One App -or- How to Write a Crawlable Single Page Web App

Client-sideMV*

Routing

View Rendering

Models,Collections

Persistence

l18n

Currency formatting, etc.

localStorage cache

Handling user events

Logging Static Assets

API

Client

ServerTHE SINGLE PAGE APP

http://nerds.airbnb.com/slides-and-video-from-spike-brehms-tech-talk/

Thursday, August 1, 13

Page 8: One Page, One App -or- How to Write a Crawlable Single Page Web App

Thursday, August 1, 13

Page 9: One Page, One App -or- How to Write a Crawlable Single Page Web App

WTF?

Thursday, August 1, 13

Page 10: One Page, One App -or- How to Write a Crawlable Single Page Web App

Good SEO, Crawlable

Initial load

App logic is DRY

Native-app-like

Thursday, August 1, 13

Page 11: One Page, One App -or- How to Write a Crawlable Single Page Web App

SH%T... HOW DO I MAKE THIS THING CRAWLABLE?

Thursday, August 1, 13

Page 12: One Page, One App -or- How to Write a Crawlable Single Page Web App

YOU CAN USE THE DOM...

Thursday, August 1, 13

Page 13: One Page, One App -or- How to Write a Crawlable Single Page Web App

THESE ARE HACKSBUT, LETS BE HONEST

Thursday, August 1, 13

Page 14: One Page, One App -or- How to Write a Crawlable Single Page Web App

OR

Thursday, August 1, 13

Page 15: One Page, One App -or- How to Write a Crawlable Single Page Web App

Client-sideMV*+ serversupport

Routing

View Rendering

Models,Collections

Persistence

l18n

Currency formatting, etc.

localStorage cache

Handling user events

API

Client

Server

Routing

View Rendering

Models,Collections

Persistence

l18n

Currency formatting, etc.

Logging Static Assets

inspired by http://nerds.airbnb.com/slides-and-video-from-spike-brehms-tech-talk/

Thursday, August 1, 13

Page 16: One Page, One App -or- How to Write a Crawlable Single Page Web App

Good SEO, Crawlable

Initial load

App logic is DRY

Native-app-like

Thursday, August 1, 13

Page 17: One Page, One App -or- How to Write a Crawlable Single Page Web App

“But I still haven’t foundwhat I’m looking for”Paul ‘Bono’ Hewson

Thursday, August 1, 13

Page 18: One Page, One App -or- How to Write a Crawlable Single Page Web App

Client +serverMV*

Routing

View Rendering

Models,Collections

Persistence

l18n

Currency formatting, etc.

localStorage cache

Handling user events

Logging Static Assets

API

Client

Server

http://nerds.airbnb.com/slides-and-video-from-spike-brehms-tech-talk/

Thursday, August 1, 13

Page 19: One Page, One App -or- How to Write a Crawlable Single Page Web App

Good SEO, Crawlable

Initial load

App logic is DRY

Native-app-like

Thursday, August 1, 13

Page 20: One Page, One App -or- How to Write a Crawlable Single Page Web App

SWEET...

OPTIONS, WHAT ARE THEY?

Thursday, August 1, 13

Page 21: One Page, One App -or- How to Write a Crawlable Single Page Web App

DERBY - very alpha, has zero IE support <10, owns data layer, but on the upside has really rad OT logic built in.

Thursday, August 1, 13

Page 22: One Page, One App -or- How to Write a Crawlable Single Page Web App

DERBY - very alpha, has zero IE support <10, owns data layer, but on the upside has really rad OT logic built in.

METEOR - renders server-side w/ phantom.js but only for select userAgents, owns data layer, but hot code pushes are pretty sweet .

Thursday, August 1, 13

Page 23: One Page, One App -or- How to Write a Crawlable Single Page Web App

DERBY - very alpha, has zero IE support <10, owns data layer, but on the upside has really rad OT logic built in.

METEOR - renders server-side w/ phantom.js but only for select userAgents, owns data layer, but hot code pushes are pretty sweet .

RENDR - uses Backbone + Express, can use any API(s) you choose, however there are no deep api docs yet.

Thursday, August 1, 13

Page 24: One Page, One App -or- How to Write a Crawlable Single Page Web App

DERBY - very alpha, has zero IE support <10, owns data layer, but on the upside has really rad OT logic built in.

METEOR - renders server-side w/ phantom.js but only for select userAgents, owns data layer, but hot code pushes are pretty sweet .

RENDR - uses Backbone + Express, can use any API(s) you choose, however there are no deep api docs yet.

Thursday, August 1, 13

Page 25: One Page, One App -or- How to Write a Crawlable Single Page Web App

+

Thursday, August 1, 13

Page 26: One Page, One App -or- How to Write a Crawlable Single Page Web App

“Rendr is intended to be a building block along the way to this envisionsed future of web apps that can be run on either side of the wire according to the needs of your application.”

Thursday, August 1, 13

Page 27: One Page, One App -or- How to Write a Crawlable Single Page Web App

•A collection of classes - BaseView, BaseModel, BaseCollection, BaseApp, ClientRouter, ServerRouter, so on...

• Express Middleware

What comes with Rendr?

Thursday, August 1, 13

Page 28: One Page, One App -or- How to Write a Crawlable Single Page Web App

•An asset pipeline•many features that would ship with a

Framework, not a library

What’s Rendr missing?

Thursday, August 1, 13

Page 29: One Page, One App -or- How to Write a Crawlable Single Page Web App

rendr-cliA (mostly) shameless plug

Thursday, August 1, 13

Page 30: One Page, One App -or- How to Write a Crawlable Single Page Web App

<CODE LOOKING>

Thursday, August 1, 13

Page 31: One Page, One App -or- How to Write a Crawlable Single Page Web App

•Break down into smaller modules•Lazy load views & templates, etc•Share routing logic between client & server•Remove BB dependency?

Direction

Thursday, August 1, 13

Page 33: One Page, One App -or- How to Write a Crawlable Single Page Web App

THANKS!

Thursday, August 1, 13