Zakas’s delayed script execution proposal

His proposal is motivated by the lack of any built-in attributes that allow this same behavior. The defer attribute simply defers the execution of code after the DOMContentLoaded event and before the load event, and the async attribute simply tells the script not to be blocking (its default behavior) while downloading and executing, allowing other resources to download.

However, we lack a built-in way of deferring the actual execution of scripts, which would tell them to download but hold off on execution until instructed to do so. This is something the Gmail mobile team first implemented by way of a hack (load the script in a comment block, then strip the comment tags and eval on demand) and something which was incorporated into ControlJS.

Especially with the increased focus on mobile these days, it only makes sense that there would be nothing but support for this proposal, and hopefully we can see it start to creep into browsers in the near future.

Jdrop

Jdrop is a new tool by Steve Souders that allows users of the Mobile Perf bookmarklet to save their on-screen test results to a server, which can be viewed on a nice big desktop monitor.

It was motivated by the fact that it’s no fun to read these test results on a mobile device’s tiny screen. You simply click on the provided “Save to Jdrop” button and away your tests go!

There is one caveat however: you need to authenticate via Oauth, which means you need to login through Twitter or Google or any other account. This might be a bit annoying, but I suppose it’s necessary to prevent abuse.

$script.js

scriptjs is a minimalist attempt at a script loader by Dustin Diaz. Lightweight meaning only 643 bytes!

A very simple test case is loading two scripts, the second of which runs a callback when the script is ready:

Diaz ends the post with a comparison with other script loaders, particularly LAB.js:

In particular I wanted to call out the great work done on LAB.js – $script.js is not better or worse. And it is most certainly different. LAB attempts to do some nice cross-browser speed improvements (like downloading via xhr and other crazy browser forks). Hell, we use it here at Twitter, and we love it. The point of $script.js is to get back to the basics of loading script’s w/o blocking other resources, which is where you’ll find the most win.

Amplify

Amplify (on GitHub) is a library to help jQuery components play well together, providing an abstraction layer for data requests, client-side storage, and loose coupling provided by a pub/sub system.

Tidbits

JSHint is a open-sourced, gentler version of JSLint.BeerCamp 2011 – scroll the page to see this very cool and different page interaction. If you’re running Chrome, go to about:flags and enable GPU Accelerated Compositing to get more performance (albeit slightly buggy) out of this page (hat tip to @nathansmith).

dotjs is a Greasemonkey-like Chrome extension that allows you to run custom JavaScript based on the filename of the site visited

History.js is a browser history manager that uses newer technologies when available (pushState, etc.) and falls back to a hash-based history when necessary