Amplify your stack - Jsfoo pune 2012

Preview:

DESCRIPTION

 

Citation preview

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

My name’s Pi.

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

bad foundation

Let’s make this betterOwn the browser.

Organize your code

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

$.fixture( /* magic */ )or

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

fixture:magic});

protip: great for backbone, spine, et al

AND the backend team has a neat reference point

write your model tests on this data

write your model tests on this data

speaking of which...

write your model tests on this data

speaking of which...

you do write unit tests, yes?

fixtures + unit tests = photoshop for code

formalized code outline is teh awesome.

essentially test(function(done){

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

});

every new bug/ feature/ issue

gets a new test

measure twice, cut once.

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

I promise you, this saves time.

but don’t overdo it.

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

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.

37signals, linkedin mobile,

etc

a note on deployment

[development]

(staging)

{production}

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.

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