From ecd6ef8a2d13f922ad88749e25454abfe4c2c942 Mon Sep 17 00:00:00 2001 From: Hubert B Manilla Date: Mon, 13 Nov 2023 02:40:53 +0000 Subject: [PATCH 1/2] Updated the spec to clearly deine usage of the sourcemap comment formats --- source-map.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source-map.bs b/source-map.bs index 6184c83..46d3a4e 100644 --- a/source-map.bs +++ b/source-map.bs @@ -363,8 +363,8 @@ The generated code should include a line at the end of the source, with the foll ``` Note: The prefix for this annotation was initially `//@` however this conflicts with Internet -Explorer's Conditional Compilation and was changed to `//#`. It is reasonable for tools to -also accept `//@` but `//#` is preferred. +Explorer's Conditional Compilation and was changed to `//#`. Source map generators should only support `//#` +while source map consumers should support both `//@` and `//#` for legacy compatibility. This recommendation works well for JavaScript, it is expected that other source files will have different conventions. For instance, for CSS `/*# sourceMappingURL= */` is proposed. From e2fe1b3e02c32642731e06408a890d65b4fd3eb1 Mon Sep 17 00:00:00 2001 From: Hubert B Manilla Date: Mon, 13 Nov 2023 23:04:04 +0000 Subject: [PATCH 2/2] Fix based on review comments --- source-map.bs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source-map.bs b/source-map.bs index 46d3a4e..eb22176 100644 --- a/source-map.bs +++ b/source-map.bs @@ -363,8 +363,11 @@ The generated code should include a line at the end of the source, with the foll ``` Note: The prefix for this annotation was initially `//@` however this conflicts with Internet -Explorer's Conditional Compilation and was changed to `//#`. Source map generators should only support `//#` -while source map consumers should support both `//@` and `//#` for legacy compatibility. +Explorer's Conditional Compilation and was changed to `//#`. Source map generators must only emit `//#` +while source map consumers must accept both `//@` and `//#`. + +Note: `//@` is needed for compatibility with some existing legacy source maps. + This recommendation works well for JavaScript, it is expected that other source files will have different conventions. For instance, for CSS `/*# sourceMappingURL= */` is proposed.