+ All Categories
Home > Technology > Full stack JavaScript - the folly of choice

Full stack JavaScript - the folly of choice

Date post: 13-Jan-2015
Category:
Upload: fdconf
View: 2,953 times
Download: 2 times
Share this document with a friend
Description:
by Oleg Podsechin on Frontend DEV Conf'13 http://bit.ly/Oleg_Podsechin
Popular Tags:
53
Full stack JavaScript the folly of choice
Transcript
Page 1: Full stack JavaScript - the folly of choice

Full stack JavaScriptthe folly of choice

Page 2: Full stack JavaScript - the folly of choice

helsinkijs.org

communityjs.org

Page 3: Full stack JavaScript - the folly of choice
Page 4: Full stack JavaScript - the folly of choice

starthq.com

Page 5: Full stack JavaScript - the folly of choice
Page 6: Full stack JavaScript - the folly of choice

Toolkits vs. Frameworks

Page 7: Full stack JavaScript - the folly of choice
Page 8: Full stack JavaScript - the folly of choice
Page 9: Full stack JavaScript - the folly of choice

Toolkits vs. Frameworks

● Toolkit: collection of libraries– some assembly required

● Libraries should “do one thing and do it well”● Inversion of control

– You call a library, but a framework calls you

Page 10: Full stack JavaScript - the folly of choice

Language

Page 11: Full stack JavaScript - the folly of choice
Page 12: Full stack JavaScript - the folly of choice

Language

● JavaScript● CoffeeScript● altjs.org

● Traceur● es5-shim

Page 13: Full stack JavaScript - the folly of choice

Server

Page 14: Full stack JavaScript - the folly of choice
Page 15: Full stack JavaScript - the folly of choice

Server

● None– Direct use of API or e.g. parse.com

● Node.js with Express● Meteor● Derby● Vert.x● RingoJS with Stick● Common Node

Page 16: Full stack JavaScript - the folly of choice
Page 17: Full stack JavaScript - the folly of choice

Database

Page 18: Full stack JavaScript - the folly of choice
Page 19: Full stack JavaScript - the folly of choice

Database

● SQL, perhaps with JSON blobs– also: JSON data type in Postgres

● CouchDB● MongoDB

Page 20: Full stack JavaScript - the folly of choice

API

Page 21: Full stack JavaScript - the folly of choice
Page 22: Full stack JavaScript - the folly of choice

API

● RESTful JSON– CRUD, with versioning

● Bespoke JSON over HTTP– GWT

● Bespoke JSON over WebSockets– Meteor, Derby

Page 23: Full stack JavaScript - the folly of choice

CSS & images

Page 24: Full stack JavaScript - the folly of choice
Page 25: Full stack JavaScript - the folly of choice

“The flower-like structure of the SVG logo evokes creativity and growth, while the connected nodes indicate integration with other technologies.”

Page 26: Full stack JavaScript - the folly of choice

CSS & images

● Normalize.css● Twitter Bootstrap

– Responsive or not?● SVG● Font Awesome icons

Page 27: Full stack JavaScript - the folly of choice

MV* library(or client side framework)

Page 28: Full stack JavaScript - the folly of choice
Page 29: Full stack JavaScript - the folly of choice

MV* library

● None (jQuery)● Backbone.js● AngularJS, Ember.js, Knockout

Page 30: Full stack JavaScript - the folly of choice
Page 31: Full stack JavaScript - the folly of choice

Templating

Page 32: Full stack JavaScript - the folly of choice
Page 33: Full stack JavaScript - the folly of choice

Templating

● None (use JavaScript)

DIV({class:'main'}, H1('Title'), P('Text')) ● Underscore● Mustache, Handlebars - logicless

{{#items}} <li>{{name}}</li> {{/items}}● leonidas/transparency● AngularJS

<li ng-repeat=”item in items”>{{item.name}}</li>

Page 34: Full stack JavaScript - the folly of choice

AngularJS

Page 35: Full stack JavaScript - the folly of choice
Page 36: Full stack JavaScript - the folly of choice

AngularJS

● What HTML would have been, had it been designed for building web apps

● 80% of code deals with manipulating the DOM– AngularJS makes this go away

● Two way data binding● Definitely a standalone framework

– modules, templating, dependency injection, events, services, promises, testing, directives, http, interceptors, history

Page 37: Full stack JavaScript - the folly of choice
Page 38: Full stack JavaScript - the folly of choice
Page 39: Full stack JavaScript - the folly of choice

Modules

● CommonJS● RequireJS● Harmony● None● Some of the above

Page 40: Full stack JavaScript - the folly of choice

Build System

Page 41: Full stack JavaScript - the folly of choice
Page 42: Full stack JavaScript - the folly of choice

Build System

● Yeoman● Grunt● None

Page 43: Full stack JavaScript - the folly of choice

MinificationMinification

Page 44: Full stack JavaScript - the folly of choice
Page 45: Full stack JavaScript - the folly of choice

Minification

● Uglify for JS– use .min.js when available– also Closure Compiler, YUI compressor

● clean-css for CSS● html-minifier for HTML

– danger zone

Page 46: Full stack JavaScript - the folly of choice

Optimization & Caching

Page 47: Full stack JavaScript - the folly of choice
Page 48: Full stack JavaScript - the folly of choice

Optimization

● YSlow, Dev Tools, PageSpeed are your friends

● Split up libs and application JS/CSS● Gzip, SPDY● Caching

Page 49: Full stack JavaScript - the folly of choice

Caching

● Explicit “Cache-Control: no-cache” for API● Cache everything else

– Far off Expires header– Use Etags, include in URI

● Application Cache?● Use s Content Distribution Network

Page 50: Full stack JavaScript - the folly of choice

Conclusion

Page 51: Full stack JavaScript - the folly of choice
Page 52: Full stack JavaScript - the folly of choice

Conclusion

● Validate assumptions first– Fail fast

● Question your beliefs– Black box abstractions are OK

● Start with a clean slate, add when needed– Reinvent the wheel if it's small

● Optimize for development enjoyment– It's a never ending journey

Page 53: Full stack JavaScript - the folly of choice

Thank you!

@olegpodsechin

github.com/olegp

starthq.com


Recommended