You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5b6a6b9
Browse filesBrowse the repository at this point in the historyBrowse files
* Docs: update URLs for source-map-format
* Point spec links at the extensions and index map sections
Repoint the vendor-specific fields and `sections` links to their own ECMA-426 sections, and link the original Anatomy of source maps article via the Wayback Machine.
---------
Co-authored-by: Rob Hogan <rob@expo.dev>
Copy file name to clipboardExpand all lines: docs/SourceMapFormat.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,19 @@ id: source-map-format
3
3
title: Source Map Format
4
4
---
5
5
6
-
Metro produces standard [source maps](https://sourcemaps.info/spec.html) along with its JavaScript bundle output. In addition to the standard information, Metro encodes extra information in [vendor-specific fields](https://sourcemaps.info/spec.html#h.ghqpj1ytqjbm) within the source map. This page serves as a specification for this encoding.
6
+
Metro produces standard [source maps](https://tc39.es/ecma426/#sec-source-map-format) along with its JavaScript bundle output. In addition to the standard information, Metro encodes extra information in [vendor-specific fields](https://tc39.es/ecma426/#sec-extensions) within the source map. This page serves as a specification for this encoding.
7
7
8
8
:::note
9
-
The content on this page assumes familiarity with the [source map specification](https://sourcemaps.info/spec.html). Check out [Anatomy of source maps](https://www.bugsnag.com/blog/source-maps) for a general introduction to source maps and how they work.
9
+
The content on this page assumes familiarity with the [source map specification](https://tc39.es/ecma426/#sec-source-map-format). Check out [Anatomy of source maps](https://web.archive.org/web/2023/https://www.bugsnag.com/blog/source-maps) for a general introduction to source maps and how they work.
10
10
:::
11
11
12
12
## `x_facebook_sources`
13
13
14
14
The `x_facebook_sources` field encodes metadata about source files in a source map. Each piece of metadata represents some attribute intrinsic to the source code of that particular file - for example, the result of running some analysis over the AST. This allows tools such as debuggers and JS engines to access such analyses efficiently, without needing to parse or even have access to the source code.
15
15
16
-
In the same way that the standard [`sources`](https://sourcemaps.info/spec.html#h.ghqpj1ytqjbm:~:text=sourceRoot%22%3A%20%22%22%2C-,%22sources%22%3A,-%5B%22foo.js%22%2C%20%22bar) field is a list of source URLs and [`sourcesContent`](https://sourcemaps.info/spec.html#h.ghqpj1ytqjbm:~:text=js%22%2C%20%22bar.js%22%5D%2C-,%22sourcesContent%22%3A,-%5Bnull%2C%20null%5D%2C) is a list of (optional) source code strings, `x_facebook_sources` is a list of optional **metadata tuples**. The _i_-th metadata tuple (`x_facebook_sources[i]`) corresponds to the source file whose URL is `sources[i]`.
16
+
In the same way that the standard [`sources`](https://tc39.es/ecma426/#sec-source-map-format:~:text=The%20sources%20field%20is%20a%20list%20of%20original%20sources%20used%20by%20the%20mappings%20field%2E) field is a list of source URLs and [`sourcesContent`](https://tc39.es/ecma426/#sec-source-map-format:~:text=The%20sourcesContent%20field%20is%20an%20optional%20list%20of%20source%20content) is a list of (optional) source code strings, `x_facebook_sources` is a list of optional **metadata tuples**. The _i_-th metadata tuple (`x_facebook_sources[i]`) corresponds to the source file whose URL is `sources[i]`.
17
17
18
-
In nested (indexed) source maps, `x_facebook_sources` may appear as part of any nested source map in [`sections`](https://sourcemaps.info/spec.html#h.535es3xeprgt) that itself has a `sources` field.
18
+
In nested (indexed) source maps, `x_facebook_sources` may appear as part of any nested source map in [`sections`](https://tc39.es/ecma426/#sec-index-source-map) that itself has a `sources` field.
19
19
20
20
If present, `x_facebook_sources` may be a different length than `sources` (but usually shouldn't be). In particular, if it's shorter than `sources`, `x_facebook_sources` interpreted as if it were padded with `null` values to match the length of `sources`.
21
21
@@ -54,7 +54,7 @@ The value of the `mappings` field is described by the _Mappings_ production of t
5.`VLQ =`_A single Base64-encoded variable-length quantity, as defined in the [source map specification](https://sourcemaps.info/spec.html#h.crcf4lqeivt8)_.
57
+
5.`VLQ =`_A single Base64-encoded variable-length quantity, as defined in the [source map specification](https://tc39.es/ecma426/#sec-base64-vlq)_.
58
58
59
59
:::note
60
60
The above grammar uses the following BNF-like notation:
0 commit comments