Over a million developers have joined DZone.
Platinum Partner

Source Maps for CoffeeScript

· Web Dev Zone

The Web Dev Zone is brought to you in partnership with Mendix.  Discover how IT departments looking for ways to keep up with demand for business apps has caused a new breed of developers to surface - the Rapid Application Developer.

One of the more serious concerns about CoffeeScript is that it lacks a first-class debugging environment. The code that you see in a browser debugger is the compiled JavaScript, not the CoffeeScript source. Thanks to JavaScript Source Maps, however, this long-running issue will likely be solved in the very near future.

JavaScript Source Maps is a system of references from JavaScript executing in the browser to original source files that have been minified, concatenated, compiled, or otherwise transformed. Chrome dev tools evangelist Paul Irish called Source Maps "the biggest thing to happen to JavaScript debugging in years." The Google Chrome team is pushing aggressively toward the release of Source Maps support (you can preview the feature in Chrome Canary).

You can read more about Source Maps in MozillaWiki feature page, in this tutorial, and in the formal proposal co-authored by Mozilla and Google. There is a Source map support plan discussion on the CoffeeScript Google Group.

Finally, Mozilla intern Nick Fitzgerald has produced a great what-I-did-this-summer video explaining the importance of Source Maps and of languages such as CoffeeScript. I recommend watching all 15 minutes of it, but for the TL;DR crowd, start around minute 11 for the sequence in which he demos an actual JavaScript console error with a link back to CoffeeScript source. Woo Hoo!

The Web Dev Zone is brought to you in partnership with Mendix.  Learn more about The Essentials of Digital Innovation and how it needs to be at the heart of every organization.


Published at DZone with permission of Chris Smith , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}