Changes

Jump to: navigation, search

DevTools/Features/SourceMap

1,111 bytes added, 16:49, 17 May 2011
no edit summary
== 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. 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.
When JavaScript gets an error, being able to help the web developer out by showing them where the error occurred in the original source file (PHP script or unminified, still-separate JavaScript for example) would save the developer time every single time they hit an error. The Web Console log messages also include links to the line that generated the log message, so these messages could link back to the original source lines as well. For a long time, there have been [http://altjs.org/ languages that have compiled] to JavaScript, and recently there has been a surge in support for these languages led by [http://coffeescript.com/ CoffeeScript]. CoffeeScript may seem like a fringe language today, but it will soon be shipping with Ruby on Rails 3.1, giving thousands of programmers a reason for developing with something other than JS.
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. [http://weepy.github.com/kaffeine/ 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.
== Release Requirements ==
* SpiderMonkey needs to output offset column in addition to source/line.
* 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
== Next Steps & Open Issues ==
* Someone Decide if starting off without columns from SpiderMonkey is needed enough of a win to work on pursue thisat this time
== Related Bugs & Dependencies ==
TBD: link to mapping spec
 
This feature is related to the [[Script_Origin_Tracking|Script Origin Tracking proposal]], because the mapping should be able to accommodate the many ways in which JavaScript can come into existence on a page.
== Test Plans ==
Canmove, confirm, emeritus
1,093
edits

Navigation menu