Changes

Jump to: navigation, search

DevTools/Features/SourceMap

968 bytes removed, 13:38, 20 July 2011
no edit summary
{{FeatureStatus
|Feature name=SourceMap
|Feature stage=PlanningDevelopment
|Feature status=In progress
|Feature version=Firefox 9
|Feature health=OK
|Feature status note=Web Console work is next.
}}
{{FeatureTeam
}}
{{FeaturePageBody
|Feature open issues and risks=A security review should be conducted before we have too much technical debt.
 
Now that there is an evolving spec for the source map file format, the first
step is to write the core libraries to generate and consume/query source
maps. These core libraries should be very general and reusable, so the plan
right is to use the Common JS AMD format.
 
Next, a patch should be written for the web console to support mapping logged
messages and uncaught errors back to their original source. It is still
undecided, from an API/architecure point of view, who will check whether a given
script has an associated source map, and how they will notify the potential
consumer of the source map that it exists or mark the script as having an
associated source map. This issue will rise to the surface at this stage.
 
As time progresses, and dependencies are met (or not), the order of the
following still needs to be decided:
 
* Integration with the debugger.
 
* Integration with UglifyJS.
 
* Integration with CoffeeScript.
|Feature overview=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. Another example of JavaScript starting in one form and ending up in the final form used by the browser is in PHP scripts which will sometimes generate bits of JavaScript as they generate their pages.
You can start with a .coffee file. Any log output or errors generated will refer back to the original .coffee file, rather than the generated .js file.
 
 
|Feature 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
* A specification for generated scripts to refer to their mappings and a mapping format
* SpiderMonkey needs to output column in addition to source/line.
 
|Feature non-goals=* Ideally, the source mapping file will also work for mapping LESS and similar to CSS. However, implementing the user interface for style source mapping is out of scope for this particular feature.
* It is possible to have a chain of source maps. Consider the case of a .coffee file that is compiled to .js and run through Closure Compiler. The final source map would refer to lines in the compiled JS, which would have a separate source map referring to lines in the .coffee file. For the first crack at this feature, we will not bother with that case.
Canmove, confirm, emeritus
1,093
edits

Navigation menu