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
Based on personal/subjective experience, source maps occasionally lack termination segments that cause purely generated code (like TypeScript helpers) to be incorrectly attributed to the preceding source mapping. This is nothing wrong in the spec, but more of an easy pitfall because source map generators/tools might forget explicitly terminating mappings.
Here is an example issue where Terser (a popular JavaScript minifier incorrectly did not terminate mappings): terser/terser#1106 (comment).
Possible ideas?
The current spec is not super clear about "purely generated code": https://sourcemaps.info/spec.html. Potentially this can be made more clear, noted on the 1-length segments.
Mappings may be terminated differently, e.g. making the end-range of a mapping explicit. This obviously has other significant consequences but I'm just listing possibilities here... not saying this is the right thing :)
What are examples of purely generated code?
TypeScript for example may generate helpers to support JS syntax not supported in e.g. the latest Chromium version. Arguably, this code may be attributed to certain original source file spots, but for shared helpers (that may be used X times)- this is wrong.
Code transformers may insert additional code into generated files. This code should not be accidentally attributed to source files from a preceding mapping.
Possible issues?
Stack traces might show errors attributed to user code, while the error originates from generated code..
Size measurements, trying to measure how much each source file contributes, can be significantly flawed.
The text was updated successfully, but these errors were encountered:
Based on personal/subjective experience, source maps occasionally lack termination segments that cause purely generated code (like TypeScript helpers) to be incorrectly attributed to the preceding source mapping. This is nothing wrong in the spec, but more of an easy pitfall because source map generators/tools might forget explicitly terminating mappings.
Here is an example issue where Terser (a popular JavaScript minifier incorrectly did not terminate mappings): terser/terser#1106 (comment).
Possible ideas?
What are examples of purely generated code?
Possible issues?
The text was updated successfully, but these errors were encountered: