12
Model, View, Whatever. *Document Object Model - not me! or how I learned to stop worrying and love the DOM*

Model, View, Whatever

Embed Size (px)

Citation preview

Page 1: Model, View, Whatever

Model, View, Whatever.

*Document Object Model - not me!

or how I learned to stop worrying and love the DOM*

Page 2: Model, View, Whatever

We ♥

Single PageApplications

Page 3: Model, View, Whatever

• Complex UI

• Feel really fast

• Comparable to native mobile apps

• Can work offline

• Cool MVC MVW frameworks galore

Page 4: Model, View, Whatever

But…

Page 5: Model, View, Whatever
Page 6: Model, View, Whatever

• Javascript :(

• Initial page load

• Duplicated code

• < noscript />

• IE <9 Internet Explorer

• Deep linking

• Error handling

• SEO

Page 7: Model, View, Whatever

Another way is possible.

Page 8: Model, View, Whatever
Page 9: Model, View, Whatever

• Render a full working web page on the server

• For all routes, not just the first hit of index page

• Bind SPA afterwards

• SPA uses the same markup

• Client and server use same templates

Page 10: Model, View, Whatever

• Real forms!

• Real links!

• No duplicated templates!

• No white screen of death!

• Error recovery for free!

• Cheap integration tests!

• Maximum dev gibberish: Isomorphic Application

Page 11: Model, View, Whatever
Page 12: Model, View, Whatever

Dom Barker Software Engineer @ Quill Content

@mostlyharmlessd www.dombarker.co.uk

www.github.com/dakuan www.npmjs.com/~dakuan