Skip to content

Commit f23927a

Browse files
authored
Remove code related to prepend and fix baselines (microsoft#57472)
1 parent e0ae9be commit f23927a

File tree

146 files changed

+3219
-86415
lines changed

Some content is hidden

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

146 files changed

+3219
-86415
lines changed

src/compiler/builder.ts

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
BuilderProgramHost,
88
BuilderState,
99
BuildInfo,
10-
BundleBuildInfo,
1110
CancellationToken,
1211
CommandLineOption,
1312
compareStringsCaseSensitive,
@@ -76,7 +75,6 @@ import {
7675
sameMap,
7776
SemanticDiagnosticsBuilderProgram,
7877
skipTypeChecking,
79-
some,
8078
SourceFile,
8179
sourceFileMayBeEmitted,
8280
SourceMapEmitResult,
@@ -171,11 +169,6 @@ export interface ReusableBuilderProgramState extends BuilderState {
171169
* Name of the file whose dts was the latest to change
172170
*/
173171
latestChangedDtsFile: string | undefined;
174-
/**
175-
* @deprecated
176-
* Bundle information either from oldState or current one so it can be used to complete the information in buildInfo when emitting only js or dts files
177-
*/
178-
bundle?: BundleBuildInfo;
179172
}
180173

181174
// dprint-ignore
@@ -462,12 +455,6 @@ function createBuilderProgramState(newProgram: Program, oldState: Readonly<Reusa
462455
}
463456
}
464457
}
465-
if (outFilePath && !state.changedFilesSet.size) {
466-
// Copy the bundle information from old state so we can patch it later if we are doing partial emit
467-
if (useOldState) state.bundle = oldState!.bundle;
468-
// If this program has prepend references, always emit since we wont know if files on disk are correct unless we check file hash for correctness
469-
if (some(newProgram.getProjectReferences(), ref => !!ref.prepend)) state.programEmitPending = getBuilderFileEmit(compilerOptions);
470-
}
471458
return state;
472459
}
473460

@@ -1070,7 +1057,7 @@ export function isProgramBundleEmitBuildInfo(info: ProgramBuildInfo): info is Pr
10701057
/**
10711058
* Gets the program information to be emitted in buildInfo so that we can use it to create new program
10721059
*/
1073-
function getBuildInfo(state: BuilderProgramState, bundle: BundleBuildInfo | undefined): BuildInfo {
1060+
function getBuildInfo(state: BuilderProgramState): BuildInfo {
10741061
const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
10751062
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions)!, currentDirectory));
10761063
// Convert the file name to Path here if we set the fileName instead to optimize multiple d.ts file emits and having to compute Canonical path
@@ -1102,15 +1089,7 @@ function getBuildInfo(state: BuilderProgramState, bundle: BundleBuildInfo | unde
11021089
false : // Pending emit is same as deteremined by compilerOptions
11031090
state.programEmitPending, // Actual value
11041091
};
1105-
// Complete the bundle information if we are doing partial emit (only js or only dts)
1106-
const { js, dts, commonSourceDirectory, sourceFiles } = bundle!;
1107-
state.bundle = bundle = {
1108-
commonSourceDirectory,
1109-
sourceFiles,
1110-
js: js || (!state.compilerOptions.emitDeclarationOnly ? state.bundle?.js : undefined),
1111-
dts: dts || (getEmitDeclarations(state.compilerOptions) ? state.bundle?.dts : undefined),
1112-
};
1113-
return createBuildInfo(program, bundle);
1092+
return createBuildInfo(program);
11141093
}
11151094

11161095
let fileIdsList: (readonly ProgramBuildInfoFileId[])[] | undefined;
@@ -1215,7 +1194,7 @@ function getBuildInfo(state: BuilderProgramState, bundle: BundleBuildInfo | unde
12151194
emitSignatures,
12161195
latestChangedDtsFile,
12171196
};
1218-
return createBuildInfo(program, bundle);
1197+
return createBuildInfo(program);
12191198

12201199
function relativeToBuildInfoEnsuringAbsolutePath(path: string) {
12211200
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
@@ -1478,7 +1457,7 @@ export function createBuilderProgram(kind: BuilderProgramKind, { newProgram, hos
14781457
}
14791458

14801459
const state = createBuilderProgramState(newProgram, oldState);
1481-
newProgram.getBuildInfo = bundle => getBuildInfo(state, bundle);
1460+
newProgram.getBuildInfo = () => getBuildInfo(state);
14821461

14831462
// To ensure that we arent storing any references to old program or new program without state
14841463
newProgram = undefined!; // TODO: GH#18217
@@ -1854,7 +1833,6 @@ export function createBuilderProgramUsingProgramBuildInfo(buildInfo: BuildInfo,
18541833
latestChangedDtsFile,
18551834
outSignature: program.outSignature,
18561835
programEmitPending: program.pendingEmit === undefined ? undefined : toProgramEmitPending(program.pendingEmit, program.options),
1857-
bundle: buildInfo.bundle,
18581836
};
18591837
}
18601838
else {

src/compiler/commandLineParser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,9 @@ const commandOptionsWithoutBuild: CommandLineOption[] = [
813813
{
814814
name: "verbatimModuleSyntax",
815815
type: "boolean",
816+
affectsEmit: true,
817+
affectsSemanticDiagnostics: true,
818+
affectsBuildInfo: true,
816819
category: Diagnostics.Interop_Constraints,
817820
description: Diagnostics.Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting,
818821
defaultValueDescription: false,

src/compiler/diagnosticMessages.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5468,14 +5468,6 @@
54685468
"category": "Error",
54695469
"code": 6307
54705470
},
5471-
"Cannot prepend project '{0}' because it does not have 'outFile' set": {
5472-
"category": "Error",
5473-
"code": 6308
5474-
},
5475-
"Output file '{0}' from project '{1}' does not exist": {
5476-
"category": "Error",
5477-
"code": 6309
5478-
},
54795471
"Referenced project '{0}' may not disable emit.": {
54805472
"category": "Error",
54815473
"code": 6310
@@ -5556,26 +5548,10 @@
55565548
"category": "Message",
55575549
"code": 6371
55585550
},
5559-
"Project '{0}' is out of date because output of its dependency '{1}' has changed": {
5560-
"category": "Message",
5561-
"code": 6372
5562-
},
5563-
"Updating output of project '{0}'...": {
5564-
"category": "Message",
5565-
"code": 6373
5566-
},
55675551
"A non-dry build would update timestamps for output of project '{0}'": {
55685552
"category": "Message",
55695553
"code": 6374
55705554
},
5571-
"A non-dry build would update output of project '{0}'": {
5572-
"category": "Message",
5573-
"code": 6375
5574-
},
5575-
"Cannot update output of project '{0}' because there was error reading file '{1}'": {
5576-
"category": "Message",
5577-
"code": 6376
5578-
},
55795555
"Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'": {
55805556
"category": "Error",
55815557
"code": 6377

0 commit comments

Comments
 (0)