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
docs: reframe ECMA-426 support as core + draft proposals
The previous copy claimed "full ECMA-426 compliance", which overstated
what's actually in the published core versus what lives in draft
proposals (scopes, debugId, rangeMappings, sourcesFunctionMappings).
Update README, ROADMAP, crate/package READMEs, and badge text to
separate stable core support from explicitly-labelled draft proposal
support, and fix ROADMAP links to point at the canonical tc39/ecma426
proposal files.
> The source map SDK for Rust tooling. Parse, generate, remap, and compose — with full[ECMA-426](https://tc39.es/ecma426/)compliance.
10
+
> The source map SDK for Rust tooling. Parse, generate, remap, and compose — with stable[ECMA-426](https://tc39.es/ecma426/)core support plus selected draft proposals.
11
11
12
12
A standalone source map library that any Rust tool can embed. If you're building a bundler, compiler, minifier, linter, or symbolication service — srcmap gives you the complete source map stack so you don't have to build it yourself.
13
13
@@ -44,7 +44,7 @@ srcmap-remapping = "0.3" # if you compose/concatenate source maps
44
44
| Composition/remapping |**yes**| limited | no | yes |
45
45
| Concatenation |**yes**| no | yes | yes |
46
46
| Indexed source maps |**yes**| yes | no | no |
47
-
|ECMA-426 scopes|**yes**| no | no | no |
47
+
|Scopes proposal|**yes**| no | no | no |
48
48
| Stack trace symbolication |**yes**| yes | no | no |
- Required extension tolerance for unrecognized properties
150
148
- Robust error handling for malformed input
151
149
150
+
Draft proposal support:
151
+
152
+
-`debugId` (ECMA-426 draft proposal, not part of the published core standard)
153
+
- Scopes & variables via [`srcmap-scopes`](https://crates.io/crates/srcmap-scopes) (first Rust implementation of the [ECMA-426 scopes proposal](https://github.com/tc39/ecma426/blob/main/proposals/scopes.md))
154
+
-`rangeMappings` (ECMA-426 Stage 2 proposal)
155
+
152
156
## Performance
153
157
154
158
For Rust consumers there is no FFI overhead. Benchmarked with Criterion:
**Interop work, not part of published ECMA-426 core today** — [bloomberg.github.io/js-blog/post/standardizing-source-maps](https://bloomberg.github.io/js-blog/post/standardizing-source-maps/)
8
8
9
-
A `"sourcesFunctionMappings"` array parallel to `"sources"`, where each entry is a VLQ-encoded string mapping generated positions to original function names. Previously the `x_com_bloomberg_sourcesFunctionMappings` extension, now standardized in ECMA-426.
9
+
A `"sourcesFunctionMappings"` array parallel to `"sources"`, where each entry is a VLQ-encoded string mapping generated positions to original function names. Previously the `x_com_bloomberg_sourcesFunctionMappings` extension, and worth tracking for ecosystem interoperability.
10
+
11
+
Note: this repository tracks it as forward-looking ecosystem interoperability work. It is not currently in the published ECMA-426 core standard or the official `tc39/ecma426` proposal set.
10
12
11
13
This is a simpler alternative to the full scopes proposal for resolving minified function names in stack traces. Tools that don't need full scope/binding information can use this field alone. For tools that support scopes, `FindOriginalFunctionName` from the scopes proposal supersedes this — but both should be supported for interop, since most source maps in the wild won't have scopes data.
12
14
@@ -29,7 +31,7 @@ This is a simpler alternative to the full scopes proposal for resolving minified
29
31
30
32
### Open issues to track
31
33
32
-
**Boundary rules for generated ranges** ([tc39/ecma426#249](https://github.com/nicolo-ribaudo/ecma-426/blob/main/proposals/range-mappings.md)): Defines where generated ranges must start and end relative to JavaScript syntax. Key rules:
34
+
**Boundary rules for generated ranges** ([tc39/ecma426#249](https://github.com/tc39/ecma426/blob/main/proposals/scopes.md)): Defines where generated ranges must start and end relative to JavaScript syntax. Key rules:
33
35
34
36
- Generated ranges must be strictly well-nested with syntactic scopes (no partial overlap)
35
37
- For callable scopes (functions, arrows, methods), the range starts inside the opening boundary (before default parameter evaluation)
@@ -39,31 +41,31 @@ This is a simpler alternative to the full scopes proposal for resolving minified
39
41
-`BlockStatement`: opening = `{`, closing = `}`, not callable
40
42
-`ClassDeclaration`: opening = `class` to `{`, closing = `}`, not callable
41
43
42
-
**Stack frame reconstruction algorithm** ([tc39/ecma426#219](https://github.com/nicolo-ribaudo/ecma-426/blob/main/proposals/range-mappings.md)): Three operations being standardized:
44
+
**Stack frame reconstruction algorithm** ([tc39/ecma426#219](https://github.com/tc39/ecma426/blob/main/proposals/scopes.md)): Three operations being standardized:
43
45
44
46
1.`FindOriginalFunctionName(position)` — find innermost generated range, walk scope chain outward to find `isStackFrame = true` scope
45
47
2.`SymbolizeStackTrace(rawFrames)` — translate generated stack traces to original, expand inlined frames and collapse outlined frames across different bundles
46
48
3.`BuildScopeChain(position)` — return `OriginalScopeWithValues[]` mapping original variables to concrete JS values
47
49
48
-
**Hidden scopes** ([tc39/ecma426#113](https://github.com/nicolo-ribaudo/ecma-426/blob/main/proposals/range-mappings.md)): A generated range without an `originalScope` reference signals compiler-generated code. Combined with `isFunctionScope`: if `range.isFunctionScope && !range.hasDefinition`, the function frame should be omitted from stack traces.
50
+
**Hidden scopes** ([tc39/ecma426#113](https://github.com/tc39/ecma426/blob/main/proposals/scopes.md)): A generated range without an `originalScope` reference signals compiler-generated code. Combined with `isFunctionScope`: if `range.isFunctionScope && !range.hasDefinition`, the function frame should be omitted from stack traces.
49
51
50
-
**Null variable names** ([tc39/ecma426#244](https://github.com/nicolo-ribaudo/ecma-426/blob/main/proposals/range-mappings.md)): When a `names` index is invalid, the variable entry becomes `null` (or empty string) instead of causing a parse error. Variables array type becomes `(string | null)[]`.
52
+
**Null variable names** ([tc39/ecma426#244](https://github.com/tc39/ecma426/blob/main/proposals/scopes.md)): When a `names` index is invalid, the variable entry becomes `null` (or empty string) instead of causing a parse error. Variables array type becomes `(string | null)[]`.
51
53
52
54
### What to implement
53
55
54
56
-[ ] Validate generated range boundaries against JavaScript syntax rules (#249)
55
-
-[]`FindOriginalFunctionName` in the symbolicate crate
57
+
-[x]`FindOriginalFunctionName` in the symbolicate crate
56
58
-[ ]`SymbolizeStackTrace` with inlining expansion and outlining collapse (#219)
srcmap already parses `debugId` from source map JSON. What's missing is extracting it from generated JavaScript/CSS files via the `//# debugId=<UUID>` comment.
100
102
@@ -119,7 +121,7 @@ srcmap already parses `debugId` from source map JSON. What's missing is extracti
119
121
120
122
## Mappings v2 Encoding `[Discussion — not implementing yet]`
0 commit comments