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

Commit 8b3e5f0

Browse files
concavelenzjkrems
authored andcommitted
Source Map Revision 3 Proposal as of 2021-09-09
Co-authored-by: John Lenz <[email protected]>
1 parent c75342c commit 8b3e5f0

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

source-map-rev3.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ To discuss or propose changes to this specification, please use the dev-js-sourc
3636

3737
## Background
3838

39-
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.
39+
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@.
4040

4141
Related documents:
4242

@@ -45,6 +45,7 @@ Related documents:
4545

4646
## Terminology
4747

48+
4849
Term | Definition
4950
--- | ---
5051
Generated Code | The code which is generated by the compiler.
@@ -137,7 +138,7 @@ Additional fields may be added to the top level source map provided the fields b
137138

138139
##### Known Extensions
139140

140-
“x_google_linecount” - the number of line represented by this source map.
141+
“x_google_linecount” - the number of lines represented by this source map.
141142

142143

143144
#### Notes
@@ -152,17 +153,17 @@ To support concatenating generated code and other common post processing, an alt
152153

153154

154155
1. `{`
155-
2. `version : 3,`
156-
3. `file: "app.js",`
157-
4. `sections: [`
158-
5. ` { offset: {line:0, column:0}, url: "url_for_part1.map" }`
159-
6. ` { offset: {line:100, column:10}, map: `
156+
2. `"version" : 3,`
157+
3. `"file": "app.js",`
158+
4. `"sections": [`
159+
5. ` { "offset": {"line":0, "column":0}, "url": "url_for_part1.map" }`
160+
6. ` { "offset": {"line":100, "column":10}, "map": `
160161
7. ` {`
161-
8. ` version : 3,`
162-
9. ` file: "section.js",`
163-
10. ` sources: ["foo.js", "bar.js"],`
164-
11. ` names: ["src", "maps", "are", "fun"],`
165-
12. ` mappings: "AAAA,E;;ABCDE;"`
162+
8. ` "version" : 3,`
163+
9. ` "file": "section.js",`
164+
10. ` "sources": ["foo.js", "bar.js"],`
165+
11. ` "names": ["src", "maps", "are", "fun"],`
166+
12. ` "mappings": "AAAA,E;;ABCDE;"`
166167
13. ` }`
167168
14. ` }`
168169
15. `],`
@@ -256,13 +257,13 @@ There is an existing convention that should be supported for the use of source m
256257

257258

258259
```
259-
//@ sourceURL=foo.js
260+
//# sourceURL=foo.js
260261
```
261262

262263

263264
It is described here:
264265

265-
[http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/](http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/)
266+
[https://web.archive.org/web/20120814122523/http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/](https://web.archive.org/web/20120814122523/http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/)
266267

267268

268269
### Language Neutral Stack Mapping Notes

0 commit comments

Comments
 (0)