typescript 4.9.0-dev.20220922 → 4.9.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cs/diagnosticMessages.generated.json +4 -2
- package/lib/de/diagnosticMessages.generated.json +3 -0
- package/lib/es/diagnosticMessages.generated.json +3 -0
- package/lib/fr/diagnosticMessages.generated.json +4 -2
- package/lib/it/diagnosticMessages.generated.json +4 -2
- package/lib/ja/diagnosticMessages.generated.json +3 -0
- package/lib/ko/diagnosticMessages.generated.json +3 -0
- package/lib/pl/diagnosticMessages.generated.json +4 -2
- package/lib/pt-br/diagnosticMessages.generated.json +3 -0
- package/lib/ru/diagnosticMessages.generated.json +3 -0
- package/lib/tsc.js +18 -18
- package/lib/tsserver.js +24 -25
- package/lib/tsserverlibrary.d.ts +4 -0
- package/lib/tsserverlibrary.js +24 -25
- package/lib/typescript.d.ts +4 -0
- package/lib/typescript.js +23 -24
- package/lib/typescriptServices.d.ts +4 -0
- package/lib/typescriptServices.js +23 -24
- package/lib/typingsInstaller.js +19 -20
- package/lib/zh-cn/diagnosticMessages.generated.json +4 -2
- package/lib/zh-tw/diagnosticMessages.generated.json +3 -0
- package/package.json +8 -8
package/lib/tsserver.js
CHANGED
|
@@ -109,7 +109,7 @@ var ts;
|
|
|
109
109
|
// The following is baselined as a literal template type without intervention
|
|
110
110
|
/** The version of the TypeScript compiler release */
|
|
111
111
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
112
|
-
ts.version = "".concat(ts.versionMajorMinor, ".
|
|
112
|
+
ts.version = "".concat(ts.versionMajorMinor, ".1-beta");
|
|
113
113
|
/* @internal */
|
|
114
114
|
var Comparison;
|
|
115
115
|
(function (Comparison) {
|
|
@@ -118840,7 +118840,7 @@ var ts;
|
|
|
118840
118840
|
* Determines if program structure is upto date or needs to be recreated
|
|
118841
118841
|
*/
|
|
118842
118842
|
/* @internal */
|
|
118843
|
-
function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists,
|
|
118843
|
+
function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) {
|
|
118844
118844
|
// If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date
|
|
118845
118845
|
if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames()))
|
|
118846
118846
|
return false;
|
|
@@ -118868,7 +118868,7 @@ var ts;
|
|
|
118868
118868
|
return true;
|
|
118869
118869
|
function sourceFileNotUptoDate(sourceFile) {
|
|
118870
118870
|
return !sourceFileVersionUptoDate(sourceFile) ||
|
|
118871
|
-
|
|
118871
|
+
hasInvalidatedResolutions(sourceFile.path);
|
|
118872
118872
|
}
|
|
118873
118873
|
function sourceFileVersionUptoDate(sourceFile) {
|
|
118874
118874
|
return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName);
|
|
@@ -119114,7 +119114,7 @@ var ts;
|
|
|
119114
119114
|
var moduleResolutionCache;
|
|
119115
119115
|
var typeReferenceDirectiveResolutionCache;
|
|
119116
119116
|
var actualResolveModuleNamesWorker;
|
|
119117
|
-
var
|
|
119117
|
+
var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts.returnFalse;
|
|
119118
119118
|
if (host.resolveModuleNames) {
|
|
119119
119119
|
actualResolveModuleNamesWorker = function (moduleNames, containingFile, containingFileName, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames), containingFileName, reusedNames, redirectedReference, options, containingFile).map(function (resolved) {
|
|
119120
119120
|
// An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName.
|
|
@@ -119561,7 +119561,7 @@ var ts;
|
|
|
119561
119561
|
for (var i = 0; i < moduleNames.length; i++) {
|
|
119562
119562
|
var moduleName = moduleNames[i];
|
|
119563
119563
|
// If the source file is unchanged and doesnt have invalidated resolution, reuse the module resolutions
|
|
119564
|
-
if (file === oldSourceFile && !
|
|
119564
|
+
if (file === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path)) {
|
|
119565
119565
|
var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName, getModeForResolutionAtIndex(oldSourceFile, i));
|
|
119566
119566
|
if (oldResolvedModule) {
|
|
119567
119567
|
if (ts.isTraceEnabled(options, host)) {
|
|
@@ -119797,7 +119797,7 @@ var ts;
|
|
|
119797
119797
|
// tentatively approve the file
|
|
119798
119798
|
modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
|
|
119799
119799
|
}
|
|
119800
|
-
else if (
|
|
119800
|
+
else if (hasInvalidatedResolutions(oldSourceFile.path)) {
|
|
119801
119801
|
// 'module/types' references could have changed
|
|
119802
119802
|
structureIsReused = 1 /* StructureIsReused.SafeModules */;
|
|
119803
119803
|
// add file to the modified list so that we will resolve it later
|
|
@@ -123843,7 +123843,7 @@ var ts;
|
|
|
123843
123843
|
invalidateResolutionOfFile: invalidateResolutionOfFile,
|
|
123844
123844
|
invalidateResolutionsOfFailedLookupLocations: invalidateResolutionsOfFailedLookupLocations,
|
|
123845
123845
|
setFilesWithInvalidatedNonRelativeUnresolvedImports: setFilesWithInvalidatedNonRelativeUnresolvedImports,
|
|
123846
|
-
|
|
123846
|
+
createHasInvalidatedResolutions: createHasInvalidatedResolutions,
|
|
123847
123847
|
isFileWithInvalidatedNonRelativeUnresolvedImports: isFileWithInvalidatedNonRelativeUnresolvedImports,
|
|
123848
123848
|
updateTypeRootsWatch: updateTypeRootsWatch,
|
|
123849
123849
|
closeTypeRootsWatch: closeTypeRootsWatch,
|
|
@@ -123898,17 +123898,13 @@ var ts;
|
|
|
123898
123898
|
var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
|
|
123899
123899
|
return !!value && !!value.length;
|
|
123900
123900
|
}
|
|
123901
|
-
function
|
|
123901
|
+
function createHasInvalidatedResolutions(customHasInvalidatedResolutions) {
|
|
123902
123902
|
// Ensure pending resolutions are applied
|
|
123903
123903
|
invalidateResolutionsOfFailedLookupLocations();
|
|
123904
|
-
if (forceAllFilesAsInvalidated) {
|
|
123905
|
-
// Any file asked would have invalidated resolution
|
|
123906
|
-
filesWithInvalidatedResolutions = undefined;
|
|
123907
|
-
return ts.returnTrue;
|
|
123908
|
-
}
|
|
123909
123904
|
var collected = filesWithInvalidatedResolutions;
|
|
123910
123905
|
filesWithInvalidatedResolutions = undefined;
|
|
123911
|
-
return function (path) { return (
|
|
123906
|
+
return function (path) { return customHasInvalidatedResolutions(path) ||
|
|
123907
|
+
!!(collected === null || collected === void 0 ? void 0 : collected.has(path)) ||
|
|
123912
123908
|
isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
|
|
123913
123909
|
}
|
|
123914
123910
|
function startCachingPerDirectoryResolution() {
|
|
@@ -126288,6 +126284,10 @@ var ts;
|
|
|
126288
126284
|
ts.maybeBind(host, host.getModuleResolutionCache) :
|
|
126289
126285
|
(function () { return resolutionCache.getModuleResolutionCache(); });
|
|
126290
126286
|
var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
126287
|
+
// All resolutions are invalid if user provided resolutions and didnt supply hasInvalidatedResolutions
|
|
126288
|
+
var customHasInvalidatedResolutions = userProvidedResolution ?
|
|
126289
|
+
ts.maybeBind(host, host.hasInvalidatedResolutions) || ts.returnTrue :
|
|
126290
|
+
ts.returnFalse;
|
|
126291
126291
|
builderProgram = readBuilderProgram(compilerOptions, compilerHost);
|
|
126292
126292
|
synchronizeProgram();
|
|
126293
126293
|
// Update the wild card directory watch
|
|
@@ -126353,10 +126353,9 @@ var ts;
|
|
|
126353
126353
|
resolutionCache.clear();
|
|
126354
126354
|
}
|
|
126355
126355
|
}
|
|
126356
|
-
|
|
126357
|
-
var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);
|
|
126356
|
+
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126358
126357
|
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126359
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); },
|
|
126358
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126360
126359
|
if (hasChangedConfigFileParsingErrors) {
|
|
126361
126360
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126362
126361
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126369,7 +126368,7 @@ var ts;
|
|
|
126369
126368
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126370
126369
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
126371
126370
|
}
|
|
126372
|
-
createNewProgram(
|
|
126371
|
+
createNewProgram(hasInvalidatedResolutions);
|
|
126373
126372
|
}
|
|
126374
126373
|
reportFileChangeDetectedOnCreateProgram = false;
|
|
126375
126374
|
if (host.afterProgramCreate && program !== builderProgram) {
|
|
@@ -126382,7 +126381,7 @@ var ts;
|
|
|
126382
126381
|
compilerHost.writeFile = originalWriteFile;
|
|
126383
126382
|
return builderProgram;
|
|
126384
126383
|
}
|
|
126385
|
-
function createNewProgram(
|
|
126384
|
+
function createNewProgram(hasInvalidatedResolutions) {
|
|
126386
126385
|
// Compile the program
|
|
126387
126386
|
writeLog("CreatingProgramWith::");
|
|
126388
126387
|
writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
|
|
@@ -126393,7 +126392,7 @@ var ts;
|
|
|
126393
126392
|
hasChangedCompilerOptions = false;
|
|
126394
126393
|
hasChangedConfigFileParsingErrors = false;
|
|
126395
126394
|
resolutionCache.startCachingPerDirectoryResolution();
|
|
126396
|
-
compilerHost.
|
|
126395
|
+
compilerHost.hasInvalidatedResolutions = hasInvalidatedResolutions;
|
|
126397
126396
|
compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames;
|
|
126398
126397
|
var oldProgram = getCurrentProgram();
|
|
126399
126398
|
builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
|
|
@@ -139177,7 +139176,7 @@ var ts;
|
|
|
139177
139176
|
break;
|
|
139178
139177
|
case 202 /* SyntaxKind.ImportType */:
|
|
139179
139178
|
// Only check for typeof import('xyz')
|
|
139180
|
-
if (direct.isTypeOf && !direct.qualifier && isExported(direct)) {
|
|
139179
|
+
if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported(direct)) {
|
|
139181
139180
|
addIndirectUser(direct.getSourceFile(), /** addTransitiveDependencies */ true);
|
|
139182
139181
|
}
|
|
139183
139182
|
directImports.push(direct);
|
|
@@ -168339,7 +168338,7 @@ var ts;
|
|
|
168339
168338
|
var rootFileNames = host.getScriptFileNames().slice();
|
|
168340
168339
|
// Get a fresh cache of the host information
|
|
168341
168340
|
var newSettings = host.getCompilationSettings() || getDefaultCompilerOptions();
|
|
168342
|
-
var
|
|
168341
|
+
var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts.returnFalse;
|
|
168343
168342
|
var hasChangedAutomaticTypeDirectiveNames = ts.maybeBind(host, host.hasChangedAutomaticTypeDirectiveNames);
|
|
168344
168343
|
var projectReferences = (_b = host.getProjectReferences) === null || _b === void 0 ? void 0 : _b.call(host);
|
|
168345
168344
|
var parsedCommandLines;
|
|
@@ -168370,7 +168369,7 @@ var ts;
|
|
|
168370
168369
|
},
|
|
168371
168370
|
onReleaseOldSourceFile: onReleaseOldSourceFile,
|
|
168372
168371
|
onReleaseParsedCommandLine: onReleaseParsedCommandLine,
|
|
168373
|
-
|
|
168372
|
+
hasInvalidatedResolutions: hasInvalidatedResolutions,
|
|
168374
168373
|
hasChangedAutomaticTypeDirectiveNames: hasChangedAutomaticTypeDirectiveNames,
|
|
168375
168374
|
trace: ts.maybeBind(host, host.trace),
|
|
168376
168375
|
resolveModuleNames: ts.maybeBind(host, host.resolveModuleNames),
|
|
@@ -168410,7 +168409,7 @@ var ts;
|
|
|
168410
168409
|
// as a const variable without downleveling, doesn't crash).
|
|
168411
168410
|
var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
|
|
168412
168411
|
// If the program is already up-to-date, we can reuse it
|
|
168413
|
-
if (ts.isProgramUptoDate(program, rootFileNames, newSettings, function (_path, fileName) { return host.getScriptVersion(fileName); }, function (fileName) { return compilerHost.fileExists(fileName); },
|
|
168412
|
+
if (ts.isProgramUptoDate(program, rootFileNames, newSettings, function (_path, fileName) { return host.getScriptVersion(fileName); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
168414
168413
|
return;
|
|
168415
168414
|
}
|
|
168416
168415
|
// IMPORTANT - It is critical from this moment onward that we do not check
|
|
@@ -173704,7 +173703,7 @@ var ts;
|
|
|
173704
173703
|
ts.Debug.assert(!this.isClosed(), "Called update graph worker of closed project");
|
|
173705
173704
|
this.writeLog("Starting updateGraphWorker: Project: ".concat(this.getProjectName()));
|
|
173706
173705
|
var start = ts.timestamp();
|
|
173707
|
-
this.
|
|
173706
|
+
this.hasInvalidatedResolutions = this.resolutionCache.createHasInvalidatedResolutions(ts.returnFalse);
|
|
173708
173707
|
this.resolutionCache.startCachingPerDirectoryResolution();
|
|
173709
173708
|
this.program = this.languageService.getProgram(); // TODO: GH#18217
|
|
173710
173709
|
this.dirty = false;
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -3320,6 +3320,8 @@ declare namespace ts {
|
|
|
3320
3320
|
*/
|
|
3321
3321
|
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
|
|
3322
3322
|
getEnvironmentVariable?(name: string): string | undefined;
|
|
3323
|
+
/** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
|
|
3324
|
+
hasInvalidatedResolutions?(filePath: Path): boolean;
|
|
3323
3325
|
createHash?(data: string): string;
|
|
3324
3326
|
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
|
3325
3327
|
}
|
|
@@ -5442,6 +5444,8 @@ declare namespace ts {
|
|
|
5442
5444
|
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
|
|
5443
5445
|
/** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
|
|
5444
5446
|
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
|
|
5447
|
+
/** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
|
|
5448
|
+
hasInvalidatedResolutions?(filePath: Path): boolean;
|
|
5445
5449
|
/**
|
|
5446
5450
|
* Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
|
|
5447
5451
|
*/
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -108,7 +108,7 @@ var ts;
|
|
|
108
108
|
// The following is baselined as a literal template type without intervention
|
|
109
109
|
/** The version of the TypeScript compiler release */
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
111
|
-
ts.version = "".concat(ts.versionMajorMinor, ".
|
|
111
|
+
ts.version = "".concat(ts.versionMajorMinor, ".1-beta");
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -118839,7 +118839,7 @@ var ts;
|
|
|
118839
118839
|
* Determines if program structure is upto date or needs to be recreated
|
|
118840
118840
|
*/
|
|
118841
118841
|
/* @internal */
|
|
118842
|
-
function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists,
|
|
118842
|
+
function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) {
|
|
118843
118843
|
// If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date
|
|
118844
118844
|
if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames()))
|
|
118845
118845
|
return false;
|
|
@@ -118867,7 +118867,7 @@ var ts;
|
|
|
118867
118867
|
return true;
|
|
118868
118868
|
function sourceFileNotUptoDate(sourceFile) {
|
|
118869
118869
|
return !sourceFileVersionUptoDate(sourceFile) ||
|
|
118870
|
-
|
|
118870
|
+
hasInvalidatedResolutions(sourceFile.path);
|
|
118871
118871
|
}
|
|
118872
118872
|
function sourceFileVersionUptoDate(sourceFile) {
|
|
118873
118873
|
return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName);
|
|
@@ -119113,7 +119113,7 @@ var ts;
|
|
|
119113
119113
|
var moduleResolutionCache;
|
|
119114
119114
|
var typeReferenceDirectiveResolutionCache;
|
|
119115
119115
|
var actualResolveModuleNamesWorker;
|
|
119116
|
-
var
|
|
119116
|
+
var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts.returnFalse;
|
|
119117
119117
|
if (host.resolveModuleNames) {
|
|
119118
119118
|
actualResolveModuleNamesWorker = function (moduleNames, containingFile, containingFileName, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames), containingFileName, reusedNames, redirectedReference, options, containingFile).map(function (resolved) {
|
|
119119
119119
|
// An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName.
|
|
@@ -119560,7 +119560,7 @@ var ts;
|
|
|
119560
119560
|
for (var i = 0; i < moduleNames.length; i++) {
|
|
119561
119561
|
var moduleName = moduleNames[i];
|
|
119562
119562
|
// If the source file is unchanged and doesnt have invalidated resolution, reuse the module resolutions
|
|
119563
|
-
if (file === oldSourceFile && !
|
|
119563
|
+
if (file === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path)) {
|
|
119564
119564
|
var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName, getModeForResolutionAtIndex(oldSourceFile, i));
|
|
119565
119565
|
if (oldResolvedModule) {
|
|
119566
119566
|
if (ts.isTraceEnabled(options, host)) {
|
|
@@ -119796,7 +119796,7 @@ var ts;
|
|
|
119796
119796
|
// tentatively approve the file
|
|
119797
119797
|
modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
|
|
119798
119798
|
}
|
|
119799
|
-
else if (
|
|
119799
|
+
else if (hasInvalidatedResolutions(oldSourceFile.path)) {
|
|
119800
119800
|
// 'module/types' references could have changed
|
|
119801
119801
|
structureIsReused = 1 /* StructureIsReused.SafeModules */;
|
|
119802
119802
|
// add file to the modified list so that we will resolve it later
|
|
@@ -123842,7 +123842,7 @@ var ts;
|
|
|
123842
123842
|
invalidateResolutionOfFile: invalidateResolutionOfFile,
|
|
123843
123843
|
invalidateResolutionsOfFailedLookupLocations: invalidateResolutionsOfFailedLookupLocations,
|
|
123844
123844
|
setFilesWithInvalidatedNonRelativeUnresolvedImports: setFilesWithInvalidatedNonRelativeUnresolvedImports,
|
|
123845
|
-
|
|
123845
|
+
createHasInvalidatedResolutions: createHasInvalidatedResolutions,
|
|
123846
123846
|
isFileWithInvalidatedNonRelativeUnresolvedImports: isFileWithInvalidatedNonRelativeUnresolvedImports,
|
|
123847
123847
|
updateTypeRootsWatch: updateTypeRootsWatch,
|
|
123848
123848
|
closeTypeRootsWatch: closeTypeRootsWatch,
|
|
@@ -123897,17 +123897,13 @@ var ts;
|
|
|
123897
123897
|
var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
|
|
123898
123898
|
return !!value && !!value.length;
|
|
123899
123899
|
}
|
|
123900
|
-
function
|
|
123900
|
+
function createHasInvalidatedResolutions(customHasInvalidatedResolutions) {
|
|
123901
123901
|
// Ensure pending resolutions are applied
|
|
123902
123902
|
invalidateResolutionsOfFailedLookupLocations();
|
|
123903
|
-
if (forceAllFilesAsInvalidated) {
|
|
123904
|
-
// Any file asked would have invalidated resolution
|
|
123905
|
-
filesWithInvalidatedResolutions = undefined;
|
|
123906
|
-
return ts.returnTrue;
|
|
123907
|
-
}
|
|
123908
123903
|
var collected = filesWithInvalidatedResolutions;
|
|
123909
123904
|
filesWithInvalidatedResolutions = undefined;
|
|
123910
|
-
return function (path) { return (
|
|
123905
|
+
return function (path) { return customHasInvalidatedResolutions(path) ||
|
|
123906
|
+
!!(collected === null || collected === void 0 ? void 0 : collected.has(path)) ||
|
|
123911
123907
|
isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
|
|
123912
123908
|
}
|
|
123913
123909
|
function startCachingPerDirectoryResolution() {
|
|
@@ -126287,6 +126283,10 @@ var ts;
|
|
|
126287
126283
|
ts.maybeBind(host, host.getModuleResolutionCache) :
|
|
126288
126284
|
(function () { return resolutionCache.getModuleResolutionCache(); });
|
|
126289
126285
|
var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
126286
|
+
// All resolutions are invalid if user provided resolutions and didnt supply hasInvalidatedResolutions
|
|
126287
|
+
var customHasInvalidatedResolutions = userProvidedResolution ?
|
|
126288
|
+
ts.maybeBind(host, host.hasInvalidatedResolutions) || ts.returnTrue :
|
|
126289
|
+
ts.returnFalse;
|
|
126290
126290
|
builderProgram = readBuilderProgram(compilerOptions, compilerHost);
|
|
126291
126291
|
synchronizeProgram();
|
|
126292
126292
|
// Update the wild card directory watch
|
|
@@ -126352,10 +126352,9 @@ var ts;
|
|
|
126352
126352
|
resolutionCache.clear();
|
|
126353
126353
|
}
|
|
126354
126354
|
}
|
|
126355
|
-
|
|
126356
|
-
var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);
|
|
126355
|
+
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126357
126356
|
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126358
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); },
|
|
126357
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126359
126358
|
if (hasChangedConfigFileParsingErrors) {
|
|
126360
126359
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126361
126360
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126368,7 +126367,7 @@ var ts;
|
|
|
126368
126367
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126369
126368
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
126370
126369
|
}
|
|
126371
|
-
createNewProgram(
|
|
126370
|
+
createNewProgram(hasInvalidatedResolutions);
|
|
126372
126371
|
}
|
|
126373
126372
|
reportFileChangeDetectedOnCreateProgram = false;
|
|
126374
126373
|
if (host.afterProgramCreate && program !== builderProgram) {
|
|
@@ -126381,7 +126380,7 @@ var ts;
|
|
|
126381
126380
|
compilerHost.writeFile = originalWriteFile;
|
|
126382
126381
|
return builderProgram;
|
|
126383
126382
|
}
|
|
126384
|
-
function createNewProgram(
|
|
126383
|
+
function createNewProgram(hasInvalidatedResolutions) {
|
|
126385
126384
|
// Compile the program
|
|
126386
126385
|
writeLog("CreatingProgramWith::");
|
|
126387
126386
|
writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
|
|
@@ -126392,7 +126391,7 @@ var ts;
|
|
|
126392
126391
|
hasChangedCompilerOptions = false;
|
|
126393
126392
|
hasChangedConfigFileParsingErrors = false;
|
|
126394
126393
|
resolutionCache.startCachingPerDirectoryResolution();
|
|
126395
|
-
compilerHost.
|
|
126394
|
+
compilerHost.hasInvalidatedResolutions = hasInvalidatedResolutions;
|
|
126396
126395
|
compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames;
|
|
126397
126396
|
var oldProgram = getCurrentProgram();
|
|
126398
126397
|
builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
|
|
@@ -139595,7 +139594,7 @@ var ts;
|
|
|
139595
139594
|
break;
|
|
139596
139595
|
case 202 /* SyntaxKind.ImportType */:
|
|
139597
139596
|
// Only check for typeof import('xyz')
|
|
139598
|
-
if (direct.isTypeOf && !direct.qualifier && isExported(direct)) {
|
|
139597
|
+
if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported(direct)) {
|
|
139599
139598
|
addIndirectUser(direct.getSourceFile(), /** addTransitiveDependencies */ true);
|
|
139600
139599
|
}
|
|
139601
139600
|
directImports.push(direct);
|
|
@@ -168757,7 +168756,7 @@ var ts;
|
|
|
168757
168756
|
var rootFileNames = host.getScriptFileNames().slice();
|
|
168758
168757
|
// Get a fresh cache of the host information
|
|
168759
168758
|
var newSettings = host.getCompilationSettings() || getDefaultCompilerOptions();
|
|
168760
|
-
var
|
|
168759
|
+
var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts.returnFalse;
|
|
168761
168760
|
var hasChangedAutomaticTypeDirectiveNames = ts.maybeBind(host, host.hasChangedAutomaticTypeDirectiveNames);
|
|
168762
168761
|
var projectReferences = (_b = host.getProjectReferences) === null || _b === void 0 ? void 0 : _b.call(host);
|
|
168763
168762
|
var parsedCommandLines;
|
|
@@ -168788,7 +168787,7 @@ var ts;
|
|
|
168788
168787
|
},
|
|
168789
168788
|
onReleaseOldSourceFile: onReleaseOldSourceFile,
|
|
168790
168789
|
onReleaseParsedCommandLine: onReleaseParsedCommandLine,
|
|
168791
|
-
|
|
168790
|
+
hasInvalidatedResolutions: hasInvalidatedResolutions,
|
|
168792
168791
|
hasChangedAutomaticTypeDirectiveNames: hasChangedAutomaticTypeDirectiveNames,
|
|
168793
168792
|
trace: ts.maybeBind(host, host.trace),
|
|
168794
168793
|
resolveModuleNames: ts.maybeBind(host, host.resolveModuleNames),
|
|
@@ -168828,7 +168827,7 @@ var ts;
|
|
|
168828
168827
|
// as a const variable without downleveling, doesn't crash).
|
|
168829
168828
|
var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
|
|
168830
168829
|
// If the program is already up-to-date, we can reuse it
|
|
168831
|
-
if (ts.isProgramUptoDate(program, rootFileNames, newSettings, function (_path, fileName) { return host.getScriptVersion(fileName); }, function (fileName) { return compilerHost.fileExists(fileName); },
|
|
168830
|
+
if (ts.isProgramUptoDate(program, rootFileNames, newSettings, function (_path, fileName) { return host.getScriptVersion(fileName); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
168832
168831
|
return;
|
|
168833
168832
|
}
|
|
168834
168833
|
// IMPORTANT - It is critical from this moment onward that we do not check
|
|
@@ -173703,7 +173702,7 @@ var ts;
|
|
|
173703
173702
|
ts.Debug.assert(!this.isClosed(), "Called update graph worker of closed project");
|
|
173704
173703
|
this.writeLog("Starting updateGraphWorker: Project: ".concat(this.getProjectName()));
|
|
173705
173704
|
var start = ts.timestamp();
|
|
173706
|
-
this.
|
|
173705
|
+
this.hasInvalidatedResolutions = this.resolutionCache.createHasInvalidatedResolutions(ts.returnFalse);
|
|
173707
173706
|
this.resolutionCache.startCachingPerDirectoryResolution();
|
|
173708
173707
|
this.program = this.languageService.getProgram(); // TODO: GH#18217
|
|
173709
173708
|
this.dirty = false;
|
package/lib/typescript.d.ts
CHANGED
|
@@ -3320,6 +3320,8 @@ declare namespace ts {
|
|
|
3320
3320
|
*/
|
|
3321
3321
|
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
|
|
3322
3322
|
getEnvironmentVariable?(name: string): string | undefined;
|
|
3323
|
+
/** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
|
|
3324
|
+
hasInvalidatedResolutions?(filePath: Path): boolean;
|
|
3323
3325
|
createHash?(data: string): string;
|
|
3324
3326
|
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
|
3325
3327
|
}
|
|
@@ -5442,6 +5444,8 @@ declare namespace ts {
|
|
|
5442
5444
|
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
|
|
5443
5445
|
/** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
|
|
5444
5446
|
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
|
|
5447
|
+
/** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
|
|
5448
|
+
hasInvalidatedResolutions?(filePath: Path): boolean;
|
|
5445
5449
|
/**
|
|
5446
5450
|
* Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
|
|
5447
5451
|
*/
|
package/lib/typescript.js
CHANGED
|
@@ -99,7 +99,7 @@ var ts;
|
|
|
99
99
|
// The following is baselined as a literal template type without intervention
|
|
100
100
|
/** The version of the TypeScript compiler release */
|
|
101
101
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
102
|
-
ts.version = "".concat(ts.versionMajorMinor, ".
|
|
102
|
+
ts.version = "".concat(ts.versionMajorMinor, ".1-beta");
|
|
103
103
|
/* @internal */
|
|
104
104
|
var Comparison;
|
|
105
105
|
(function (Comparison) {
|
|
@@ -118830,7 +118830,7 @@ var ts;
|
|
|
118830
118830
|
* Determines if program structure is upto date or needs to be recreated
|
|
118831
118831
|
*/
|
|
118832
118832
|
/* @internal */
|
|
118833
|
-
function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists,
|
|
118833
|
+
function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) {
|
|
118834
118834
|
// If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date
|
|
118835
118835
|
if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames()))
|
|
118836
118836
|
return false;
|
|
@@ -118858,7 +118858,7 @@ var ts;
|
|
|
118858
118858
|
return true;
|
|
118859
118859
|
function sourceFileNotUptoDate(sourceFile) {
|
|
118860
118860
|
return !sourceFileVersionUptoDate(sourceFile) ||
|
|
118861
|
-
|
|
118861
|
+
hasInvalidatedResolutions(sourceFile.path);
|
|
118862
118862
|
}
|
|
118863
118863
|
function sourceFileVersionUptoDate(sourceFile) {
|
|
118864
118864
|
return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName);
|
|
@@ -119104,7 +119104,7 @@ var ts;
|
|
|
119104
119104
|
var moduleResolutionCache;
|
|
119105
119105
|
var typeReferenceDirectiveResolutionCache;
|
|
119106
119106
|
var actualResolveModuleNamesWorker;
|
|
119107
|
-
var
|
|
119107
|
+
var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts.returnFalse;
|
|
119108
119108
|
if (host.resolveModuleNames) {
|
|
119109
119109
|
actualResolveModuleNamesWorker = function (moduleNames, containingFile, containingFileName, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames), containingFileName, reusedNames, redirectedReference, options, containingFile).map(function (resolved) {
|
|
119110
119110
|
// An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName.
|
|
@@ -119551,7 +119551,7 @@ var ts;
|
|
|
119551
119551
|
for (var i = 0; i < moduleNames.length; i++) {
|
|
119552
119552
|
var moduleName = moduleNames[i];
|
|
119553
119553
|
// If the source file is unchanged and doesnt have invalidated resolution, reuse the module resolutions
|
|
119554
|
-
if (file === oldSourceFile && !
|
|
119554
|
+
if (file === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path)) {
|
|
119555
119555
|
var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName, getModeForResolutionAtIndex(oldSourceFile, i));
|
|
119556
119556
|
if (oldResolvedModule) {
|
|
119557
119557
|
if (ts.isTraceEnabled(options, host)) {
|
|
@@ -119787,7 +119787,7 @@ var ts;
|
|
|
119787
119787
|
// tentatively approve the file
|
|
119788
119788
|
modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
|
|
119789
119789
|
}
|
|
119790
|
-
else if (
|
|
119790
|
+
else if (hasInvalidatedResolutions(oldSourceFile.path)) {
|
|
119791
119791
|
// 'module/types' references could have changed
|
|
119792
119792
|
structureIsReused = 1 /* StructureIsReused.SafeModules */;
|
|
119793
119793
|
// add file to the modified list so that we will resolve it later
|
|
@@ -123833,7 +123833,7 @@ var ts;
|
|
|
123833
123833
|
invalidateResolutionOfFile: invalidateResolutionOfFile,
|
|
123834
123834
|
invalidateResolutionsOfFailedLookupLocations: invalidateResolutionsOfFailedLookupLocations,
|
|
123835
123835
|
setFilesWithInvalidatedNonRelativeUnresolvedImports: setFilesWithInvalidatedNonRelativeUnresolvedImports,
|
|
123836
|
-
|
|
123836
|
+
createHasInvalidatedResolutions: createHasInvalidatedResolutions,
|
|
123837
123837
|
isFileWithInvalidatedNonRelativeUnresolvedImports: isFileWithInvalidatedNonRelativeUnresolvedImports,
|
|
123838
123838
|
updateTypeRootsWatch: updateTypeRootsWatch,
|
|
123839
123839
|
closeTypeRootsWatch: closeTypeRootsWatch,
|
|
@@ -123888,17 +123888,13 @@ var ts;
|
|
|
123888
123888
|
var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
|
|
123889
123889
|
return !!value && !!value.length;
|
|
123890
123890
|
}
|
|
123891
|
-
function
|
|
123891
|
+
function createHasInvalidatedResolutions(customHasInvalidatedResolutions) {
|
|
123892
123892
|
// Ensure pending resolutions are applied
|
|
123893
123893
|
invalidateResolutionsOfFailedLookupLocations();
|
|
123894
|
-
if (forceAllFilesAsInvalidated) {
|
|
123895
|
-
// Any file asked would have invalidated resolution
|
|
123896
|
-
filesWithInvalidatedResolutions = undefined;
|
|
123897
|
-
return ts.returnTrue;
|
|
123898
|
-
}
|
|
123899
123894
|
var collected = filesWithInvalidatedResolutions;
|
|
123900
123895
|
filesWithInvalidatedResolutions = undefined;
|
|
123901
|
-
return function (path) { return (
|
|
123896
|
+
return function (path) { return customHasInvalidatedResolutions(path) ||
|
|
123897
|
+
!!(collected === null || collected === void 0 ? void 0 : collected.has(path)) ||
|
|
123902
123898
|
isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
|
|
123903
123899
|
}
|
|
123904
123900
|
function startCachingPerDirectoryResolution() {
|
|
@@ -126278,6 +126274,10 @@ var ts;
|
|
|
126278
126274
|
ts.maybeBind(host, host.getModuleResolutionCache) :
|
|
126279
126275
|
(function () { return resolutionCache.getModuleResolutionCache(); });
|
|
126280
126276
|
var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
126277
|
+
// All resolutions are invalid if user provided resolutions and didnt supply hasInvalidatedResolutions
|
|
126278
|
+
var customHasInvalidatedResolutions = userProvidedResolution ?
|
|
126279
|
+
ts.maybeBind(host, host.hasInvalidatedResolutions) || ts.returnTrue :
|
|
126280
|
+
ts.returnFalse;
|
|
126281
126281
|
builderProgram = readBuilderProgram(compilerOptions, compilerHost);
|
|
126282
126282
|
synchronizeProgram();
|
|
126283
126283
|
// Update the wild card directory watch
|
|
@@ -126343,10 +126343,9 @@ var ts;
|
|
|
126343
126343
|
resolutionCache.clear();
|
|
126344
126344
|
}
|
|
126345
126345
|
}
|
|
126346
|
-
|
|
126347
|
-
var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);
|
|
126346
|
+
var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
|
|
126348
126347
|
var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
|
|
126349
|
-
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); },
|
|
126348
|
+
if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
126350
126349
|
if (hasChangedConfigFileParsingErrors) {
|
|
126351
126350
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126352
126351
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
@@ -126359,7 +126358,7 @@ var ts;
|
|
|
126359
126358
|
if (reportFileChangeDetectedOnCreateProgram) {
|
|
126360
126359
|
reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
|
|
126361
126360
|
}
|
|
126362
|
-
createNewProgram(
|
|
126361
|
+
createNewProgram(hasInvalidatedResolutions);
|
|
126363
126362
|
}
|
|
126364
126363
|
reportFileChangeDetectedOnCreateProgram = false;
|
|
126365
126364
|
if (host.afterProgramCreate && program !== builderProgram) {
|
|
@@ -126372,7 +126371,7 @@ var ts;
|
|
|
126372
126371
|
compilerHost.writeFile = originalWriteFile;
|
|
126373
126372
|
return builderProgram;
|
|
126374
126373
|
}
|
|
126375
|
-
function createNewProgram(
|
|
126374
|
+
function createNewProgram(hasInvalidatedResolutions) {
|
|
126376
126375
|
// Compile the program
|
|
126377
126376
|
writeLog("CreatingProgramWith::");
|
|
126378
126377
|
writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
|
|
@@ -126383,7 +126382,7 @@ var ts;
|
|
|
126383
126382
|
hasChangedCompilerOptions = false;
|
|
126384
126383
|
hasChangedConfigFileParsingErrors = false;
|
|
126385
126384
|
resolutionCache.startCachingPerDirectoryResolution();
|
|
126386
|
-
compilerHost.
|
|
126385
|
+
compilerHost.hasInvalidatedResolutions = hasInvalidatedResolutions;
|
|
126387
126386
|
compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames;
|
|
126388
126387
|
var oldProgram = getCurrentProgram();
|
|
126389
126388
|
builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
|
|
@@ -139586,7 +139585,7 @@ var ts;
|
|
|
139586
139585
|
break;
|
|
139587
139586
|
case 202 /* SyntaxKind.ImportType */:
|
|
139588
139587
|
// Only check for typeof import('xyz')
|
|
139589
|
-
if (direct.isTypeOf && !direct.qualifier && isExported(direct)) {
|
|
139588
|
+
if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported(direct)) {
|
|
139590
139589
|
addIndirectUser(direct.getSourceFile(), /** addTransitiveDependencies */ true);
|
|
139591
139590
|
}
|
|
139592
139591
|
directImports.push(direct);
|
|
@@ -168748,7 +168747,7 @@ var ts;
|
|
|
168748
168747
|
var rootFileNames = host.getScriptFileNames().slice();
|
|
168749
168748
|
// Get a fresh cache of the host information
|
|
168750
168749
|
var newSettings = host.getCompilationSettings() || getDefaultCompilerOptions();
|
|
168751
|
-
var
|
|
168750
|
+
var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts.returnFalse;
|
|
168752
168751
|
var hasChangedAutomaticTypeDirectiveNames = ts.maybeBind(host, host.hasChangedAutomaticTypeDirectiveNames);
|
|
168753
168752
|
var projectReferences = (_b = host.getProjectReferences) === null || _b === void 0 ? void 0 : _b.call(host);
|
|
168754
168753
|
var parsedCommandLines;
|
|
@@ -168779,7 +168778,7 @@ var ts;
|
|
|
168779
168778
|
},
|
|
168780
168779
|
onReleaseOldSourceFile: onReleaseOldSourceFile,
|
|
168781
168780
|
onReleaseParsedCommandLine: onReleaseParsedCommandLine,
|
|
168782
|
-
|
|
168781
|
+
hasInvalidatedResolutions: hasInvalidatedResolutions,
|
|
168783
168782
|
hasChangedAutomaticTypeDirectiveNames: hasChangedAutomaticTypeDirectiveNames,
|
|
168784
168783
|
trace: ts.maybeBind(host, host.trace),
|
|
168785
168784
|
resolveModuleNames: ts.maybeBind(host, host.resolveModuleNames),
|
|
@@ -168819,7 +168818,7 @@ var ts;
|
|
|
168819
168818
|
// as a const variable without downleveling, doesn't crash).
|
|
168820
168819
|
var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
|
|
168821
168820
|
// If the program is already up-to-date, we can reuse it
|
|
168822
|
-
if (ts.isProgramUptoDate(program, rootFileNames, newSettings, function (_path, fileName) { return host.getScriptVersion(fileName); }, function (fileName) { return compilerHost.fileExists(fileName); },
|
|
168821
|
+
if (ts.isProgramUptoDate(program, rootFileNames, newSettings, function (_path, fileName) { return host.getScriptVersion(fileName); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
|
168823
168822
|
return;
|
|
168824
168823
|
}
|
|
168825
168824
|
// IMPORTANT - It is critical from this moment onward that we do not check
|
|
@@ -3320,6 +3320,8 @@ declare namespace ts {
|
|
|
3320
3320
|
*/
|
|
3321
3321
|
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
|
|
3322
3322
|
getEnvironmentVariable?(name: string): string | undefined;
|
|
3323
|
+
/** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
|
|
3324
|
+
hasInvalidatedResolutions?(filePath: Path): boolean;
|
|
3323
3325
|
createHash?(data: string): string;
|
|
3324
3326
|
getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
|
|
3325
3327
|
}
|
|
@@ -5442,6 +5444,8 @@ declare namespace ts {
|
|
|
5442
5444
|
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
|
|
5443
5445
|
/** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
|
|
5444
5446
|
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
|
|
5447
|
+
/** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
|
|
5448
|
+
hasInvalidatedResolutions?(filePath: Path): boolean;
|
|
5445
5449
|
/**
|
|
5446
5450
|
* Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
|
|
5447
5451
|
*/
|