Stop generating sectional sourcemaps#24917
Conversation
…ce tools dislike sectional ones
|
Incidentally, this means we also wouldn't need to update our sourcemap decoding service to handle index maps just to support project references sourcemaps. 🤷♀️ |
| resetSectionalData(); | ||
| } | ||
| } | ||
| function isReasonablySourceMap(x: {}): x is SourceMapSection { |
| encodeLastRecordedSourceMapSpan(); | ||
|
|
||
| return JSON.stringify(generateMap()); | ||
| return JSON.stringify(captureSection()); |
There was a problem hiding this comment.
Since we aren't doing indexed maps any more, we should probably remove references to names like "Section", etc.
rbuckton
left a comment
There was a problem hiding this comment.
The source map paths look correct now.
| } | ||
|
|
||
| export function createUnparsedSourceFile(text: string, map?: string): UnparsedSource { | ||
| export function createUnparsedSourceFile(text: string, mapPath?: string, map?: string): UnparsedSource { |
There was a problem hiding this comment.
To avoid possible issues with existing calls, and since these aren't actually optional, we should have the types be string | undefined just to make sure we didn't miss any calls.
| } | ||
|
|
||
| export function createInputFiles(javascript: string, declaration: string, javascriptMapText?: string, declarationMapText?: string): InputFiles { | ||
| export function createInputFiles( |
There was a problem hiding this comment.
To avoid possible issues with existing calls, and since these aren't actually optional, we should have the types be string | undefined just to make sure we didn't miss any calls.
@rbuckton started working with the index maps we generated in our tooling and found that while many tools profess to handle index maps, they don't handle them particularly well (ie, the mozilla source map library crashes). This change causes us to process the incoming sourcemaps and add the offsets and updated paths required to emit a traditional single section sourcemap, thereby improving compatibility with those tools (at the cost of more work performed during sourcemap emit).