It’s a fun thing to be at the forefront of a language/technology revolution. I’m always a little amazed at how the JavaScript I began coding ten years ago has turned in to one of the cornerstones of my career. MBAs and years on consensus building are one thing, but it’s this language that truly brings my design work to life, from its prototyping stages to its full production deployment. And while I’ve forged deeper and deeper under its hood, JavaScript has implicated itself further and further in modern development practices. JSConf 2011 brought most of the thought leaders responsible for this implication together for two days in Portland, OR, inducted others in to the circle, and hummed throughout with young, fresh, energy and ideas devoted to the standards language making today’s web hop. Notes on the summit:
David Flanagan, @__DavidFlanagan
BLOB (Binary Large OBjects) APIs
Use case: file system, BLOB, DOM. User selects image from hard drive, runs it through the API, then sees image displayed in a web page; All files are BLOBs but not all BLOBs are files; Get files the same way we always have: with input tag (and onchange)… or with drag and drop; XHR2; new URL object; blob://; FileReader object can be used to examine and manipulate contents of BLOBs; Text files can now be read; readAsText, readAsArrayBuffer, typed arrays, ArrayBufferView; “endianness”; BlobBuilder; Web apps can implement their own sandboxed file systems.
John Hann, @unscriptable and Brian Cavalier, @briancavalier
Modules > Frameworks
Framework vs library vs module; Switching cost of moving from a library or framework like jQuery is HUGE; “coding dysentary” – get yer shit outta my code; coding utopia – standalone, small, fast, interchangeable, no globals; loaders and namespacing; JavaScript standard APIs/interfaces – ecma, json…; html5/css3 – querySelectorAll…; CommonJS proposed standards; AMD – Asynchronous Module Definition; Modules today – require.js, curl.js, pinf, bdload, mLAB; promises; inversion control.
Paul Irish, @paul_irish
Chrome Dev Tools
Tab autocompletion; click color box to iterate through different color format definitions; new groups by type AND revision history; …and freeform stylesheet editing under resources; see console api doc for all available console methods; console.dir = DOM view; ESA to hide/show console on all tabs; $0; ‘copy’ in console view => clipboard; ‘?’ in console = help on keyboard shortcuts; –remote-debugging = for example, debugging tablet apps via desktop; right-click pretty print of minified js.
Dave Balmer, @balmer
Jo, Lightweight Mobile Framework
Web is the SDK; He’s looking for code contributors; See ‘JavaScript, The Good Parts’ extend method; lesscss, sass; css3 for animations and transformations to save the mobile JS engine (and give better results); joapp.com; lighter weight than enyo.
Fabian Jakobs, @fjakobs
Cloud9IDE
Brian Cavalier
wire.js
Inversion control; “bootstrapper”; Aspect Oriented Programming (AOP) – augmentation of existing components (whether or not source code is available/controllable); Dependencies – integral, configurable, required, optional; Complements AMD by providing further flexibility; Ordering and promises; Connectors.
David Kaneda, @DavidKaneda
Sencha Touch
“Details Matter”; sass and compass.
Boris Bokowski, @bokowski
Orion Dev Environment
Use the web itself as a platform for tool aggregation; jsbeautifer.org, etc; eclipse.org/orion
Anton Kovalyo, @antonkovalyo
Code Quality Tools
Gofmt, pylint…; Linters and doc tools (MDC, Better JS); JSHint, a politer fork of JSLint;
Gaurav Seth, Microsfot
Chakra JS Engine
Better use of dual cores for JS processing/compiling; See IE9 dev guide; ecmascript.org – ecmascripttest262; IE10 now available.
Testing
FuncUnit; qunit;
Ray Morgan, @raycmorgan
App vs Web
Zappos; App = native, web = html5; “Native apps aren’t that hard to write”; “Native Apps are easy to get performant”; “Should mobile web really be trying to emulate native apps..?”; Beware broken expectations; Android vs iphone vs Windows; back to basics – semantic html; progressive enhancement – test on the older technologies; Usability and simplicity; Flickr does it right and captures what the web is about; Hashbang (and Google’s spec on); keep the web the web; flex box.
Dave Herman, @littlecalculist
Modules for JS.Next
Libraries are a language’s lifeblood; NPM; JavaScript basically hands you a chunk of clay and leaves it up to you; Module pattern – (function(global){…global.var=var={};}(window)); CommonJS on server side is taking off; for(i=0;…) = WRONG b/c of the leaked global; underscore.js; I/O; Next.Js lets you declare requires and pull them without blocking the main thread; harmony.js, next.js…; eval is NOT evil (though irresponsible/uneducated use of it may be); coffescript, scheme, examples of declaratively extending html with other languages.
Toby Ho, @airportyh
Tutti, Multiple Browser JS Testing
Adam Baldwin, @adam_baldwin
Security in Web Apps
CORS headers now allow for cross-domain scripting and this can screw you if you’re working with hash bang nav techniques; evilpacket.net; OWASP/ESAPI encoder; output encoding != validation; FF has new content security policy.
Dan Webb, @danwrong
Designing Non-Shit JS APIs
jQuery today is pretty much the defacto standard because, even though it’s cobbled together under the hood; its interface is amazing; A good API = predictability, simplicity, flexibility; Don’t buck language conventions or standards.
Thomas Fuchs, @thomasfuchs
Zepto Mobile Framework
All major JS frameworks we know/use today came out before phones had real browsers, so in developing for a single platform (essentially, what mobile is today with Webkit) get rid of the x-browser bloat/polyfills; proprietary features can be killer – WK’s document.querySelectorAll, for example, replaces a huge JS footprint and is faster; native JSON support; array iteration gets rid of loops FTW; Some functionality (window.resize, for example) is not meaningful/relevant in the mobile context; SO, don’t download a whold bunch of code that isn’t needed (though let’s have a fallback plan for if code is run on a non-WK browser) – Zepto provides easy mechanism for replacing itself with jQuery, for example; querySelectorAll returns a node list that Fuchs turns into an arracy with slice.call; ajax, events, css, polyfills, modular, and webkit only; basecamp mobile = zepto and backbone; Small is beautiful, easier to understand, and comes with less bugs; mustache.js, lawnchair.js, backbone.js; microjs.com.