29
Amplify your stack (suggestions on how to enhance your development setup)

Amplify your stack - Jsfoo pune 2012

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Amplify your stack - Jsfoo pune 2012

Amplify your stack(suggestions on how to enhance your development setup)

Page 2: Amplify your stack - Jsfoo pune 2012

My name’s Pi.

Page 3: Amplify your stack - Jsfoo pune 2012

I love setups.(let’s talk about yours)

Page 4: Amplify your stack - Jsfoo pune 2012

bad foundation

Page 5: Amplify your stack - Jsfoo pune 2012

Let’s make this betterOwn the browser.

Page 6: Amplify your stack - Jsfoo pune 2012

Organize your code

Page 7: Amplify your stack - Jsfoo pune 2012

Fixtures are greatA unified way to mock all your backend data.

Page 8: Amplify your stack - Jsfoo pune 2012

$.fixture( /* magic */ )or

$.ajax({ url:‘your/fancy/url/’,

fixture:magic});

Page 9: Amplify your stack - Jsfoo pune 2012
Page 10: Amplify your stack - Jsfoo pune 2012
Page 11: Amplify your stack - Jsfoo pune 2012

protip: great for backbone, spine, et al

AND the backend team has a neat reference point

Page 12: Amplify your stack - Jsfoo pune 2012

write your model tests on this data

Page 13: Amplify your stack - Jsfoo pune 2012

write your model tests on this data

speaking of which...

Page 14: Amplify your stack - Jsfoo pune 2012

write your model tests on this data

speaking of which...

you do write unit tests, yes?

Page 15: Amplify your stack - Jsfoo pune 2012

fixtures + unit tests = photoshop for code

formalized code outline is teh awesome.

Page 16: Amplify your stack - Jsfoo pune 2012

essentially test(function(done){

var v = you.do.something(); make.sure(v).equals(expected)

});

Page 17: Amplify your stack - Jsfoo pune 2012

every new bug/ feature/ issue

gets a new test

measure twice, cut once.

Page 18: Amplify your stack - Jsfoo pune 2012

qunit, mocha/expresso, jtestdriver, yuitest/yeti/jute, jasmine... go crazy!

Page 19: Amplify your stack - Jsfoo pune 2012

I promise you, this saves time.

but don’t overdo it.

Page 20: Amplify your stack - Jsfoo pune 2012

embrace templating.stop constructing html inside your scripts. it’s irritating.

Page 21: Amplify your stack - Jsfoo pune 2012
Page 22: Amplify your stack - Jsfoo pune 2012

Backbone.Routerhtml5! page transitions! save state on client side! offline

cache! localStorage! ponies!

point is, you can save and do a lot more client side now.

Page 23: Amplify your stack - Jsfoo pune 2012

37signals, linkedin mobile,

etc

Page 24: Amplify your stack - Jsfoo pune 2012

a note on deployment

Page 25: Amplify your stack - Jsfoo pune 2012

[development]

Page 26: Amplify your stack - Jsfoo pune 2012

(staging)

Page 27: Amplify your stack - Jsfoo pune 2012

{production}

Page 28: Amplify your stack - Jsfoo pune 2012

tips.

• automate as much as you can.

• stub generators, builds, perf tests, fixtures, configurations, pages(?).

• DEVELOP BOLDLY.

• refactor slowly. refactor smartly.

• EVERY site becomes a single page app.

Page 29: Amplify your stack - Jsfoo pune 2012

Sangam[ shameless plug - https://github.com/threepointone/Sangam ]