From 651708cba3ee85470240103c06f304f200499c53 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 19 Apr 2024 18:14:01 +0100 Subject: [PATCH 1/6] Fix "This version" URL pointing to former source-map org The old URL serves 404 Error now. --- source-map.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source-map.bs b/source-map.bs index 79017c8..465b102 100644 --- a/source-map.bs +++ b/source-map.bs @@ -4,7 +4,7 @@ H1: Source Map Shortname: source-map Level: 1 Status: STAGE0 -URL: https://source-map.github.io/source-map-spec/ +URL: https://tc39.github.io/source-map-spec/ Editor: Armin Ronacher, Sentry Former Editor: Victor Porof, Google Former Editor: John Lenz, Google From aff8d641dcaf9f15826cf2d9239c749fa45bcc22 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 8 May 2024 18:28:05 +0300 Subject: [PATCH 2/6] Update source-map.bs --- source-map.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source-map.bs b/source-map.bs index 465b102..e856407 100644 --- a/source-map.bs +++ b/source-map.bs @@ -4,7 +4,7 @@ H1: Source Map Shortname: source-map Level: 1 Status: STAGE0 -URL: https://tc39.github.io/source-map-spec/ +URL: https://tc39.es/source-map/ Editor: Armin Ronacher, Sentry Former Editor: Victor Porof, Google Former Editor: John Lenz, Google From 4677323777be7872f3dbee298b0a192be9a1742a Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Mon, 24 Jun 2024 11:10:39 +0200 Subject: [PATCH 3/6] Add language clarifying the 32-bit limit for VLQs Addresses issue #80 --- source-map.bs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source-map.bs b/source-map.bs index 975a67c..d760de9 100644 --- a/source-map.bs +++ b/source-map.bs @@ -126,7 +126,9 @@ into the string least significant first, and where the least significant bit of the first digit is used as the sign bit. Note: The values that can be represented by the VLQ Base64 encoded are limited to -32-bit quantities until some use case for larger values is presented. +32-bit quantities until some use case for larger values is presented. This +means that values exceeding 32-bits are invalid and implementations may reject +them. The sign bit is counted towards the limit, but the continuation bits are not. Source Mapping URL refers to the URL referencing the location of a source map from the [=Generated code=]. From c3ec11c76b93db2e84df5cad1f60451f09296f7a Mon Sep 17 00:00:00 2001 From: Jon Kuperman Date: Tue, 25 Jun 2024 13:45:32 +0200 Subject: [PATCH 4/6] Change our process to group stack trace rewriters and debuggers --- CONTRIBUTING.md | 6 ++---- PROCESS.md | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24723b6..a43ea98 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,8 +27,7 @@ Thanks for helping out in the [source map effort](https://ecma-international.org We've been thinking about _source map constituencies_ in the following terms. Please feel free to suggest better titles or categorization methods! 1. Generators. Bundlers, transpilers, compilers. Tools that have access to the source code and emit (among other things) source maps. -2. Debuggers. Browsers and [standalone debuggers](https://www.replay.io/). These are tools that have access to the source map and the generated code. -3. Error monitoring tools. Tools like Sentry and New Relic. These tools have access to an error stack trace and a source map. +2. Debuggers. Browsers, [standalone debuggers](https://www.replay.io/) and stack trace rewriters like [Node](https://nodejs.org/en) and [Sentry](https://sentry.io/). When considering changes, this list of tools might be useful: https://github.com/jkup/source-map-users @@ -37,5 +36,4 @@ When considering changes, this list of tools might be useful: https://github.com We've been categorizing our testing efforts into three groups, each matching with a [constituency](#constituencies). 1. Validators. For testing generator tools, we'd like to have the ability to validate a source map on its own as well as a source map being a valid map between a source and a generated file. We did a mini hackathon day on what this might look like: https://github.com/jkup/source-map-validator -2. Debuggers. For browsers, we'd like a suite of tests that can run wherever browsers apply source maps to their debug tools like Chrome DevTools. We'd like generic tests that browsers can use showing they apply source maps correctly. My assumption is they each already have their own suite of tests ([Chrome tests](https://github.com/ChromeDevTools/devtools-frontend/blob/main/test/e2e/sources/sourcemap_test.ts), [Firefox tests](https://github.com/mozilla/source-map/tree/master/test)) for this and we'll need to figure out how to integrate with their test harness and extract a shared base of tests we all could use. -3. Stack trace validators. For tools like Sentry and New Relic, we'd like tests that ensure source maps are correctly applied to the stack trace and that new features like [Debug ID](https://github.com/tc39/source-map-rfc/blob/main/proposals/debug-id.md) are working correctly. +2. Debuggers. For browsers, we'd like a suite of tests that can run wherever browsers apply source maps to their debug tools like Chrome DevTools. We'd like generic tests that browsers can use showing they apply source maps correctly. My assumption is they each already have their own suite of tests ([Chrome tests](https://github.com/ChromeDevTools/devtools-frontend/blob/main/test/e2e/sources/sourcemap_test.ts), [Firefox tests](https://github.com/mozilla/source-map/tree/master/test)) for this and we'll need to figure out how to integrate with their test harness and extract a shared base of tests we all could use. For stack trace rewriters, we'd like tests that can show source maps being correctly applied to error stacks. diff --git a/PROCESS.md b/PROCESS.md index b02192f..6208ba0 100644 --- a/PROCESS.md +++ b/PROCESS.md @@ -20,9 +20,9 @@ When a proposal reaches Stage 3, no further improvements are possible without im ## Stage 4 (complete) -- 2 source map generators ready -- 2 interactive debuggers -- 2 stack trace decoder implementations +- 2 generators +- 2 debuggers +- 1 complete end to end workflow - Test suite is complete When a proposal reaches Stage 4, it is ready to land in the editor draft. There might still be editorial changes, but all the semantics are final. From c8bcfd91ef41c53e8f867dd682f5db4fca5d6171 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Tue, 25 Jun 2024 16:39:15 +0200 Subject: [PATCH 5/6] Update `binding` expression parsing This changes the order of binding expressions to use encode `M` first. If `M` is >= -1, then `M` is treated as an offset into `names` for the entirety of the generated range. If it's negative, then there are `-M` sub-ranges for this variable within the generated range, and the next VLQ is the offset into `names` to use for the start of the generated range. --- proposals/scopes.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/proposals/scopes.md b/proposals/scopes.md index ecf4372..63c6aa7 100644 --- a/proposals/scopes.md +++ b/proposals/scopes.md @@ -244,17 +244,24 @@ Note: Each DATA represents one VLQ number. * bindings: * Note: the number of bindings must match the number of variables in the definition scope * for each binding: - * Let M be the number of sub-ranges for the current variable in this generated range (where the expression differs on how to obtain the current variable’s value) - * DATA offset into `names` field or -1 - * Note: The value expression for the current variable either for the whole generated range (if M == 1), or for the sub-range that starts at the beginning of this generated range. - * Note: Use -1 to indicate that the current variable is unavailable (e.g. due to shadowing) in this range. - * If M > 1, then - * DATA negative number of sub-ranges (-M) + * Note: The value expression for the current variable either for the whole generated range (if M == 1), or for the sub-range that starts at the beginning of this generated range. + * Note: Use -1 to indicate that the current variable is unavailable (e.g. due to shadowing) in this range. + * DATA M either an index into `names` field (if M is >= -1), or the number of sub-ranges for the current variable in this generated range (where the expression differs on how to obtain the current variable’s value) + * If M == -1, then + * Do nothing. + * Note: The variable is not accessible within this generated range. + * Else if M > 0, then + * M is used as an index into `names` field + * Note: The variable is accessible by evaluating the value expression for the entirety of this generated range. + * Else, + * Note: there are at least 2 sub-ranges. + * DATA offset into `names` field or -1 + * Note: The variable is accessible using this value expression starting from the beginning of the generated range until the start of the next sub-range. + * Note: Use -1 to indicate that the current variable is unavailable (e.g. due to shadowing) in this sub-range. * (M - 1) times * DATA line in the generated code + * Note: The line is relative to the previous sub-range line or the start of the current generated range item if it’s the first for this loop. * DATA column in the generated code - * Note: This is the point (exclusive) in the generated code until the previous expression must be used to obtain the current variable’s value. - * Note: The line is relative to the previous sub-range line or the start of the current generated range item if it’s the first. * Note: The column is relative to the column of the previous sub-range if it’s on the same line or absolute if it’s on a new line. * DATA offset into `names` field or -1 * Note: The expression to obtain the current variable’s value in the sub-range that starts at line/column and ends at either the next sub-range start or this generated range’s end. From 38132c1b7a32e27b4c89ae4d1b065e80365eceae Mon Sep 17 00:00:00 2001 From: Holger Benl Date: Tue, 25 Jun 2024 16:49:55 +0200 Subject: [PATCH 6/6] Update proposals/scopes.md --- proposals/scopes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/scopes.md b/proposals/scopes.md index 63c6aa7..795e5bf 100644 --- a/proposals/scopes.md +++ b/proposals/scopes.md @@ -250,7 +250,7 @@ Note: Each DATA represents one VLQ number. * If M == -1, then * Do nothing. * Note: The variable is not accessible within this generated range. - * Else if M > 0, then + * Else if M >= 0, then * M is used as an index into `names` field * Note: The variable is accessible by evaluating the value expression for the entirety of this generated range. * Else,