Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Source Maps for CoffeeScript

DZone's Guide to

Source Maps for CoffeeScript

· Web Dev Zone
Free Resource

Learn how to build modern digital experience apps with Crafter CMS. Download this eBook now. Brought to you in partnership with Crafter Software

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!

Crafter is a modern CMS platform for building modern websites and content-rich digital experiences. Download this eBook now. Brought to you in partnership with Crafter Software.

Topics:

Published at DZone with permission of Chris Smith, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}