Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit c0dc49a

Browse files
concavelenzfitzgen
authored andcommitted
Source Map Revision 3 Proposal as of 2013-05-16
Co-authored-by: John Lenz <[email protected]> Co-authored-by: Nick Fitzgerald <[email protected]>
1 parent 3682cc1 commit c0dc49a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

source-map-rev3.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ July 30, 2012 | John Lenz | Modified recommended HTTP header name.
2121
August 20, 2012 | John Lenz | Add CSS linkage recommendation
2222
October 24, 2012 | John Lenz | Add clarifying section on source locations.
2323
February 19, 2013 | John Lenz | Add “sourcesContent” line to support self contained source maps.<p>Added note regarding using data uri to load source maps.
24+
May 16, 2013 | John Lenz | Updated linking convention to use # instead of @. @ conflicts with internet explorer’s conditional code
2425

2526
## License
2627

2728
This work is licensed under a [Creative Commons Attribution-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-sa/3.0/).
2829

2930

31+
## Discussion
32+
33+
To discuss or propose changes to this specification, please use the dev-js-sourcemap mailing list: [https://lists.mozilla.org/listinfo/dev-js-sourcemap](https://lists.mozilla.org/listinfo/dev-js-sourcemap)
34+
35+
3036
## Background
3137

3238
The original source map format (v1) was created by Joseph Schorr for use by Closure Inspector to enable source level debugging of optimized JavaScript code (although the format itself is language agnostic). However, as the size of the projects using the source maps expanded the verbosity of the format started to be become a problem. The v2 was created trading some simplicity and flexibility to reduce to overall size of the source map. Even with the changes made with the v2 version of the format, the source map file size was limiting its usefulness. The v3 format is based on suggestions made by podivilov.
@@ -208,18 +214,20 @@ The generated code may include a line at the end of the source, with the followi
208214

209215

210216
```
211-
//@ sourceMappingURL=<url>
217+
//# sourceMappingURL=<url>
212218
```
213219

214220

221+
Note: The prefix for this annotation was initially “//@” however this conflicts with Internet Explorer’s conditional comments and was changed to “//#”. It is reasonable for tools to also accept “//@” but “//#” is preferred.
222+
215223
This recommendation works well for JavaScript, it is expected that other source files will have other conventions:
216224

217225

218226
<table>
219227
<tr>
220228
<td>CSS
221229
</td>
222-
<td>/*@ sourceMappingURL=&lt;url> */
230+
<td>/*# sourceMappingURL=&lt;url> */
223231
</td>
224232
</tr>
225233
</table>

0 commit comments

Comments
 (0)