Changes

Jump to: navigation, search

DevTools/Features/SourceMap

2,250 bytes added, 23:58, 29 June 2011
Next Steps & Open Issues
* Decide if starting off without columns from SpiderMonkey is enough of a win to pursue this at this time
 
* How is the browser notified that a source map exists for a given script?
** Should it be a comment at the top of the source? Something like //@sourceMap=http://example.com/path/to/source/map
*** This could work with "eval" and script tag injection.
** Should it be an attribute on the script's tag? Something like <script src='/path/to/foo.js' data-source-map='path/to/foo.smap'>
*** This would not work with eval, but would work with script tag injection.
** Should it just be implicit that the source map file is a replacement of the suffix of the script's file? For example, if a script's URL is "foo.js", the source map is implied to be at "foo.smap"?
*** This would not work with eval, but would work with script tag injection.
*** This would result in unnecessary HTTP requests when the source map does not exist.
** What is th URL pointing to the source map relative to?
*** The script itself, or the page loading the script?
 
* What requirements must be satisfied before the browser fetches a source map?
** Should the JavaScript engine be in debug-mode?
** Should a flag or preference be set?
** Should the console/firebug/debugger/etc have to flip a switch explicitly when they are started and flip it back off again when they exit?
 
* When should the browser fetch the source map?
** As soon as it knows of the existence of the source map?
** By the time a message is logged, or an exception is thrown, it is already too late to fetch the source map because we do not want to block while we go fetch the source map.
 
* When (if at all) should the browser fetch the original source file[s] referenced from a source map?
** As soon as it has retrieved the source map?
 
* From an API standpoint, how should the browser tell the JS engine that a source map has been fetched and is available?
 
* Where are the original source files referenced from the source map?
** Presumably, they are URLs; what are they relative to?
*** The origin of the script?
*** The origin of the page?
 
* Where can source maps be located? Do we want to let script's say they come from any arbitrary place?
** Should they be restricted to the same origin as their script?
** Should they be restricted to the same origin as the webpage?
** From either of the above?
== Related Bugs & Dependencies ==
Confirm
125
edits

Navigation menu