Skip to content

Commit 26df0cb

Browse files
Remove 5.5 deprecated compiler options (microsoft#57527)
Co-authored-by: Andrew Branch <[email protected]>
1 parent cfbb15f commit 26df0cb

File tree

770 files changed

+1111
-5783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

770 files changed

+1111
-5783
lines changed

src/compiler/builder.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ import {
6262
maybeBind,
6363
noop,
6464
notImplemented,
65-
outFile,
6665
Path,
6766
Program,
6867
ProjectReference,
@@ -310,12 +309,12 @@ function createBuilderProgramState(newProgram: Program, oldState: Readonly<Reusa
310309
state.program = newProgram;
311310
const compilerOptions = newProgram.getCompilerOptions();
312311
state.compilerOptions = compilerOptions;
313-
const outFilePath = outFile(compilerOptions);
312+
const outFilePath = compilerOptions.outFile;
314313
// With --out or --outFile, any change affects all semantic diagnostics so no need to cache them
315314
if (!outFilePath) {
316315
state.semanticDiagnosticsPerFile = new Map();
317316
}
318-
else if (compilerOptions.composite && oldState?.outSignature && outFilePath === outFile(oldState?.compilerOptions)) {
317+
else if (compilerOptions.composite && oldState?.outSignature && outFilePath === oldState.compilerOptions.outFile) {
319318
state.outSignature = oldState.outSignature && getEmitSignatureFromOldSignature(compilerOptions, oldState.compilerOptions, oldState.outSignature);
320319
}
321320
state.changedFilesSet = new Set();
@@ -559,7 +558,7 @@ function releaseCache(state: BuilderProgramState) {
559558
}
560559

561560
function backupBuilderProgramEmitState(state: Readonly<BuilderProgramState>): SavedBuildProgramEmitState {
562-
const outFilePath = outFile(state.compilerOptions);
561+
const outFilePath = state.compilerOptions.outFile;
563562
// Only in --out changeFileSet is kept around till emit
564563
Debug.assert(!state.changedFilesSet.size || outFilePath);
565564
return {
@@ -649,7 +648,7 @@ function getNextAffectedFile(
649648
// so operations are performed directly on program, return program
650649
const program = Debug.checkDefined(state.program);
651650
const compilerOptions = program.getCompilerOptions();
652-
if (outFile(compilerOptions)) {
651+
if (compilerOptions.outFile) {
653652
Debug.assert(!state.semanticDiagnosticsPerFile);
654653
return program;
655654
}
@@ -1051,7 +1050,7 @@ export type ProgramBuildInfo = ProgramMultiFileEmitBuildInfo | ProgramBundleEmit
10511050

10521051
/** @internal */
10531052
export function isProgramBundleEmitBuildInfo(info: ProgramBuildInfo): info is ProgramBundleEmitBuildInfo {
1054-
return !!outFile(info.options || {});
1053+
return !!info.options?.outFile;
10551054
}
10561055

10571056
/**
@@ -1065,7 +1064,7 @@ function getBuildInfo(state: BuilderProgramState): BuildInfo {
10651064
const fileNames: string[] = [];
10661065
const fileNameToFileId = new Map<string, ProgramBuildInfoFileId>();
10671066
const root: ProgramBuildInfoRoot[] = [];
1068-
if (outFile(state.compilerOptions)) {
1067+
if (state.compilerOptions.outFile) {
10691068
// Copy all fileInfo, version and impliedFormat
10701069
// Affects global scope and signature doesnt matter because with --out they arent calculated or needed to determine upto date ness
10711070
const fileInfos = arrayFrom(state.fileInfos.entries(), ([key, value]): ProgramBundleEmitBuildInfoFileInfo => {
@@ -1509,7 +1508,7 @@ export function createBuilderProgram(kind: BuilderProgramKind, { newProgram, hos
15091508
let emitKind: BuilderFileEmit = emitOnlyDtsFiles ?
15101509
programEmitKind & BuilderFileEmit.AllDts : programEmitKind;
15111510
if (!affected) {
1512-
if (!outFile(state.compilerOptions)) {
1511+
if (!state.compilerOptions.outFile) {
15131512
const pendingAffectedFile = getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles);
15141513
if (!pendingAffectedFile) {
15151514
const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile(state);
@@ -1586,7 +1585,7 @@ export function createBuilderProgram(kind: BuilderProgramKind, { newProgram, hos
15861585
if (!getEmitDeclarations(state.compilerOptions)) return writeFile || maybeBind(host, host.writeFile);
15871586
return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
15881587
if (isDeclarationFileName(fileName)) {
1589-
if (!outFile(state.compilerOptions)) {
1588+
if (!state.compilerOptions.outFile) {
15901589
Debug.assert(sourceFiles?.length === 1);
15911590
let emitSignature;
15921591
if (!customTransformers) {
@@ -1762,7 +1761,7 @@ export function createBuilderProgram(kind: BuilderProgramKind, { newProgram, hos
17621761
function getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[] {
17631762
assertSourceFileOkWithoutNextAffectedCall(state, sourceFile);
17641763
const compilerOptions = Debug.checkDefined(state.program).getCompilerOptions();
1765-
if (outFile(compilerOptions)) {
1764+
if (compilerOptions.outFile) {
17661765
Debug.assert(!state.semanticDiagnosticsPerFile);
17671766
// We dont need to cache the diagnostics just return them from program
17681767
return Debug.checkDefined(state.program).getSemanticDiagnostics(sourceFile, cancellationToken);
@@ -1838,7 +1837,7 @@ export function createBuilderProgramUsingProgramBuildInfo(buildInfo: BuildInfo,
18381837
else {
18391838
filePathsSetList = program.fileIdsList?.map(fileIds => new Set(fileIds.map(toFilePath)));
18401839
const fileInfos = new Map<Path, BuilderState.FileInfo>();
1841-
const emitSignatures = program.options?.composite && !outFile(program.options) ? new Map<Path, EmitSignature>() : undefined;
1840+
const emitSignatures = program.options?.composite && !program.options.outFile ? new Map<Path, EmitSignature>() : undefined;
18421841
program.fileInfos.forEach((fileInfo, index) => {
18431842
const path = toFilePath(index + 1 as ProgramBuildInfoFileId);
18441843
const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo);

src/compiler/builderState.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
mapDefinedIterator,
2323
ModuleDeclaration,
2424
ModuleKind,
25-
outFile,
2625
OutputFile,
2726
Path,
2827
Program,
@@ -304,7 +303,7 @@ export namespace BuilderState {
304303
export function create(newProgram: Program, oldState: Readonly<BuilderState> | undefined, disableUseFileVersionAsSignature: boolean): BuilderState {
305304
const fileInfos = new Map<Path, FileInfo>();
306305
const options = newProgram.getCompilerOptions();
307-
const isOutFile = outFile(options);
306+
const isOutFile = options.outFile;
308307
const referencedMap = options.module !== ModuleKind.None && !isOutFile ?
309308
createManyToManyPathMap() : undefined;
310309
const exportedModulesMap = referencedMap ? createManyToManyPathMap() : undefined;
@@ -514,7 +513,7 @@ export namespace BuilderState {
514513
export function getAllDependencies(state: BuilderState, programOfThisState: Program, sourceFile: SourceFile): readonly string[] {
515514
const compilerOptions = programOfThisState.getCompilerOptions();
516515
// With --out or --outFile all outputs go into single file, all files depend on each other
517-
if (outFile(compilerOptions)) {
516+
if (compilerOptions.outFile) {
518517
return getAllFileNames(state, programOfThisState);
519518
}
520519

@@ -625,7 +624,7 @@ export namespace BuilderState {
625624
const compilerOptions = programOfThisState.getCompilerOptions();
626625
// If `--out` or `--outFile` is specified, any new emit will result in re-emitting the entire project,
627626
// so returning the file itself is good enough.
628-
if (compilerOptions && outFile(compilerOptions)) {
627+
if (compilerOptions && compilerOptions.outFile) {
629628
return [sourceFileWithUpdatedShape];
630629
}
631630
return getAllFilesExcludingDefaultLibraryFile(state, programOfThisState, sourceFileWithUpdatedShape);
@@ -646,7 +645,7 @@ export namespace BuilderState {
646645
}
647646

648647
const compilerOptions = programOfThisState.getCompilerOptions();
649-
if (compilerOptions && (getIsolatedModules(compilerOptions) || outFile(compilerOptions))) {
648+
if (compilerOptions && (getIsolatedModules(compilerOptions) || compilerOptions.outFile)) {
650649
return [sourceFileWithUpdatedShape];
651650
}
652651

0 commit comments

Comments
 (0)