DevTools/Features/SourceMap

From MozillaWiki
< DevTools‎ | Features
Revision as of 01:57, 13 May 2011 by Kdangoor (talk | contribs) (Created page with "{| class="fullwidth-table" |- | style="font-weight: bold; background: #DDD;" | Feature | style="font-weight: bold; background: #DDD;" | Status | style="font-weight: bold; backgro...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Feature Status ETA Owner
Source Map planning 2011-06-01 Kevin Dangoor

Summary

Nearly every web developer starts with JavaScript in one form during development and then produces JavaScript in another form for production use. Most often, this is a case of joining files together and minifying the output to reduce the number of requests the browser needs to make and how much data the browser needs to transfer.

For a long time, there have been languages that have compiled to JavaScript, and recently there has been a surge in support for these languages led by CoffeeScript.

When developing an application in CoffeeScript, any time an error is hit the browser tells the user the location of the problem in the JavaScript file, not the source file that the user is working with. One new language even went so far as to ensure that the lines numbers in the generated JS match up with the lines numbers in the original source file, which is an unfortunate thing to optimize for.

The solution to this problem is a mapping from the generated JS to the original source files.

Team

  • Feature Manager: Kevin Dangoor (irc: kdangoor)
  • Lead Developer: TBD


Release Requirements

  • When a sourcemap is available, error messages in console will link to the original source, not the generated JS
  • Likewise, console log output will link back to the original source
  • Patches for CoffeeScript and UglifyJS will be used to produce examples
  • A specification for generated scripts to refer to their mappings and a mapping format

Next Steps & Open Issues

  • Someone is needed to work on this

Related Bugs & Dependencies

TBD (status page link)

Risks

  • We could end up with two competing formats if other browsers pursue this at the same time and we're not aware of it.

Designs

TBD: link to mapping spec

Test Plans

TBD

Other Stuff

Brendan and Jim Blandy have suggested that using a separate mapping file will work better than including the mapping in the generated source.