Security/Reviews/Firefox9/ReviewNotes/SourceMap: Difference between revisions

(Created page with "Items to be reviewed: SourceMap - https://wiki.mozilla.org/DevTools/Features/SourceMap Agenda: == Introduce Feature (5-10 minutes) == The premise of the project is that most ...")
 
Line 2: Line 2:
SourceMap - https://wiki.mozilla.org/DevTools/Features/SourceMap  
SourceMap - https://wiki.mozilla.org/DevTools/Features/SourceMap  
Agenda:  
Agenda:  
== Introduce Feature (5-10 minutes) ==
== Introduce Feature ==
The  premise of the project is that most JavaScript goes through some  type  of compilation step before being deployed. Generally, that compilation  step is minification, but increasingly it is also cross  language  compilation steps like CoffeeScript, ParenScript, or Google Web Toolkit. In both both cases, you have your original source(s) that you wrote, and then the generated source which is produced in an automated fashion by some compilation step. When there is a bug or uncaught exception in the generated source, it is a pain to debug because you  are  not familiar with that code because you didn't write it yourself. Source  maps come in to save the day by mapping a generated line and  column  information back to the original source(s), original line, and original column. It is a JSON file, with the actual mappings encoded in  a base 64  variant. Developer tools can then take advantage of the  presence of  these source map files by displaying the original position of things like logged messages and uncaught errors, or by allowing  developers to  set break points in their original sources rather than  the generated ones as they step through a script's execution in the  debugger.  
The  premise of the project is that most JavaScript goes through some  type  of compilation step before being deployed. Generally, that compilation  step is minification, but increasingly it is also cross  language  compilation steps like CoffeeScript, ParenScript, or Google Web Toolkit. In both both cases, you have your original source(s) that you wrote, and then the generated source which is produced in an automated fashion by some compilation step. When there is a bug or uncaught exception in the generated source, it is a pain to debug because you  are  not familiar with that code because you didn't write it yourself. Source  maps come in to save the day by mapping a generated line and  column  information back to the original source(s), original line, and original column. It is a JSON file, with the actual mappings encoded in  a base 64  variant. Developer tools can then take advantage of the  presence of  these source map files by displaying the original position of things like logged messages and uncaught errors, or by allowing  developers to  set break points in their original sources rather than  the generated ones as they step through a script's execution in the  debugger.  
There  is a core library which will be shared across developer tools in Firefox, compiler tools generating source maps, and even non-Firefox developer tools. It only deals with the source maps directly, and knows nothing about where they came from, how to get them, where to put them,  etc. This work is pretty much complete, although there are some minor licensing issues that need to be dealt with before it can land.  
There  is a core library which will be shared across developer tools in Firefox, compiler tools generating source maps, and even non-Firefox developer tools. It only deals with the source maps directly, and knows nothing about where they came from, how to get them, where to put them,  etc. This work is pretty much complete, although there are some minor licensing issues that need to be dealt with before it can land.  
Line 12: Line 12:
* Bug tracking adding the core lib to Firefox as a jsm:  https://bugzilla.mozilla.org/show_bug.cgi?id=669999
* Bug tracking adding the core lib to Firefox as a jsm:  https://bugzilla.mozilla.org/show_bug.cgi?id=669999
* Bug tracking the integration of source maps with the webconsole:  https://bugzilla.mozilla.org/show_bug.cgi?id=670002
* Bug tracking the integration of source maps with the webconsole:  https://bugzilla.mozilla.org/show_bug.cgi?id=670002
= Goal of Feature, what is trying to be achieved (problem solved, use cases, etc) =
= Goal of Feature, what is trying to be achieved (problem solved, use cases, etc) =
= What solutions/approaches were considered other than the proposed solution? =
= What solutions/approaches were considered other than the proposed solution? =
canmove, Confirmed users, Bureaucrats and Sysops emeriti
2,776

edits