|
7 | 7 | BuilderProgramHost,
|
8 | 8 | BuilderState,
|
9 | 9 | BuildInfo,
|
10 |
| - BundleBuildInfo, |
11 | 10 | CancellationToken,
|
12 | 11 | CommandLineOption,
|
13 | 12 | compareStringsCaseSensitive,
|
@@ -76,7 +75,6 @@ import {
|
76 | 75 | sameMap,
|
77 | 76 | SemanticDiagnosticsBuilderProgram,
|
78 | 77 | skipTypeChecking,
|
79 |
| - some, |
80 | 78 | SourceFile,
|
81 | 79 | sourceFileMayBeEmitted,
|
82 | 80 | SourceMapEmitResult,
|
@@ -171,11 +169,6 @@ export interface ReusableBuilderProgramState extends BuilderState {
|
171 | 169 | * Name of the file whose dts was the latest to change
|
172 | 170 | */
|
173 | 171 | 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; |
179 | 172 | }
|
180 | 173 |
|
181 | 174 | // dprint-ignore
|
@@ -462,12 +455,6 @@ function createBuilderProgramState(newProgram: Program, oldState: Readonly<Reusa
|
462 | 455 | }
|
463 | 456 | }
|
464 | 457 | }
|
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 |
| - } |
471 | 458 | return state;
|
472 | 459 | }
|
473 | 460 |
|
@@ -1070,7 +1057,7 @@ export function isProgramBundleEmitBuildInfo(info: ProgramBuildInfo): info is Pr
|
1070 | 1057 | /**
|
1071 | 1058 | * Gets the program information to be emitted in buildInfo so that we can use it to create new program
|
1072 | 1059 | */
|
1073 |
| -function getBuildInfo(state: BuilderProgramState, bundle: BundleBuildInfo | undefined): BuildInfo { |
| 1060 | +function getBuildInfo(state: BuilderProgramState): BuildInfo { |
1074 | 1061 | const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
|
1075 | 1062 | const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions)!, currentDirectory));
|
1076 | 1063 | // 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
|
1102 | 1089 | false : // Pending emit is same as deteremined by compilerOptions
|
1103 | 1090 | state.programEmitPending, // Actual value
|
1104 | 1091 | };
|
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); |
1114 | 1093 | }
|
1115 | 1094 |
|
1116 | 1095 | let fileIdsList: (readonly ProgramBuildInfoFileId[])[] | undefined;
|
@@ -1215,7 +1194,7 @@ function getBuildInfo(state: BuilderProgramState, bundle: BundleBuildInfo | unde
|
1215 | 1194 | emitSignatures,
|
1216 | 1195 | latestChangedDtsFile,
|
1217 | 1196 | };
|
1218 |
| - return createBuildInfo(program, bundle); |
| 1197 | + return createBuildInfo(program); |
1219 | 1198 |
|
1220 | 1199 | function relativeToBuildInfoEnsuringAbsolutePath(path: string) {
|
1221 | 1200 | return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
@@ -1478,7 +1457,7 @@ export function createBuilderProgram(kind: BuilderProgramKind, { newProgram, hos
|
1478 | 1457 | }
|
1479 | 1458 |
|
1480 | 1459 | const state = createBuilderProgramState(newProgram, oldState);
|
1481 |
| - newProgram.getBuildInfo = bundle => getBuildInfo(state, bundle); |
| 1460 | + newProgram.getBuildInfo = () => getBuildInfo(state); |
1482 | 1461 |
|
1483 | 1462 | // To ensure that we arent storing any references to old program or new program without state
|
1484 | 1463 | newProgram = undefined!; // TODO: GH#18217
|
@@ -1854,7 +1833,6 @@ export function createBuilderProgramUsingProgramBuildInfo(buildInfo: BuildInfo,
|
1854 | 1833 | latestChangedDtsFile,
|
1855 | 1834 | outSignature: program.outSignature,
|
1856 | 1835 | programEmitPending: program.pendingEmit === undefined ? undefined : toProgramEmitPending(program.pendingEmit, program.options),
|
1857 |
| - bundle: buildInfo.bundle, |
1858 | 1836 | };
|
1859 | 1837 | }
|
1860 | 1838 | else {
|
|
0 commit comments