While I was at the first annual ng-conf last week (excellent conf, btw), Brian Ford of the Angular team gave a great talk about a new library he released called Zone.js.

What is a Zone, you ask? It’s an execution context that persists across async tasks. Brian says:

you can think of it as thread-local storage for JavaScript VMs.

Having execution contexts that span asynchronous operations allow you to do all sorts of neat things. Most notably: provide long stack traces.

If you’ve worked with JavaScript in the browser for awhile, you’ve probably felt the pain of insufficient error reporting. You can usually see where an error was thrown, but that rarely tells you where the error actually originated.

With Zones you can trace back all the way to where the error originated.

Zone.js will be built right in to AngularJS in the future, and by making it a standalone library, the Angular team has allowed other framework and library authors to use it as well.

Want to learn more? Get it straight from the horse’s mouth: