Skip to content

Feature implementation from commits b86ab7d..5a3271b #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: feature-base-branch-1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
81c9518
Fix getResolvePackageJsonImports utility (#61707)
andrewbranch May 16, 2025
b504a1e
Handle lock file 3 version when caching the typings ensuring we can r…
sheetalkamat May 21, 2025
44d4671
Update pr_owners.txt (#61798)
jakebailey Jun 3, 2025
3dd0a35
Initialize the map for dts to reference and source to reference when …
sheetalkamat Jun 4, 2025
2b88aeb
LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_…
csigs Jun 4, 2025
a591ca3
fix(61747): for (using of = is incorrectly parsed (#61764)
a-tarasyuk Jun 5, 2025
ac03ba4
fix(checker): report error when using bigint as enum key (#61777)
magic-akari Jun 5, 2025
cd34199
tsc --init update (#61813)
RyanCavanaugh Jun 6, 2025
a69c6d0
Add support for `import defer` proposal (#60757)
nicolo-ribaudo Jun 6, 2025
ffd98c1
feat: add Error.isError() to ESNext lib (#60788)
dirkluijk Jun 6, 2025
51dcd90
Cache mapper instantiations (#61505)
Andarist Jun 6, 2025
652ed7f
Add lib.esnext.sharedmemory (#61646)
Renegade334 Jun 6, 2025
1e24945
explicitly disallow `using` in ambient contexts (#61781)
Renegade334 Jun 6, 2025
fa2a0fc
Issue "'{0}' declarations can only be declared inside a block." for b…
Andarist Jun 6, 2025
7715955
Fix helpers emit for .cjs files in ESM module mode (#61814)
andrewbranch Jun 6, 2025
355b9e0
Avoid resolving source prop type when the target is `unknown`/`any` (…
Andarist Jun 6, 2025
97cfa26
optimization, reduce memory usage (#61822)
VincentBailly Jun 9, 2025
cb38d99
Add `--module node20` (#61805)
andrewbranch Jun 9, 2025
34d1ea6
Fix type variable leaks and cache inconsistencies (#61668)
ahejlsberg Jun 9, 2025
0dfd0c2
Restore `import defer =` parsing (#61837)
nicolo-ribaudo Jun 9, 2025
12e09f4
Port "Improve type discrimination algorithm" from tsgo (#61828)
jakebailey Jun 9, 2025
529ed09
fix link to "Help Wanted" issues (#61843)
AllenSH12 Jun 11, 2025
dd1e258
LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_…
csigs Jun 11, 2025
f1d2494
LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_…
csigs Jun 17, 2025
5a3271b
LEGO: Pull request from lego/hb_5378966c-b857-470a-8675-daebef4a6da1_…
csigs Jun 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Initialize the map for dts to reference and source to reference when …
…parsing project reference as its always needed (microsoft#61746)
  • Loading branch information
sheetalkamat authored Jun 4, 2025
commit 3dd0a35032ca78d8b220177362398b03457fb2d8
2 changes: 1 addition & 1 deletion src/compiler/builderState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export namespace BuilderState {
* Gets the path to reference file from file name, it could be resolvedPath if present otherwise path
*/
function getReferencedFileFromFileName(program: Program, fileName: string, sourceFileDirectory: Path, getCanonicalFileName: GetCanonicalFileName): Path {
return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
return toPath(program.getRedirectFromSourceFile(fileName)?.outputDts || fileName, sourceFileDirectory, getCanonicalFileName);
}

/**
Expand Down
14 changes: 7 additions & 7 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4719,7 +4719,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
);
}
else if (resolvedModule.resolvedUsingTsExtension && shouldRewrite) {
const redirect = host.getResolvedProjectReferenceToRedirect(sourceFile.path);
const redirect = host.getRedirectFromSourceFile(sourceFile.path)?.resolvedRef;
if (redirect) {
const ignoreCase = !host.useCaseSensitiveFileNames();
const ownRootDir = host.getCommonSourceDirectory();
Expand Down Expand Up @@ -4814,9 +4814,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
if (moduleNotFoundError) {
// See if this was possibly a projectReference redirect
if (resolvedModule) {
const redirect = host.getProjectReferenceRedirect(resolvedModule.resolvedFileName);
if (redirect) {
error(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect, resolvedModule.resolvedFileName);
const redirect = host.getRedirectFromSourceFile(resolvedModule.resolvedFileName);
if (redirect?.outputDts) {
error(errorNode, Diagnostics.Output_file_0_has_not_been_built_from_source_file_1, redirect.outputDts, resolvedModule.resolvedFileName);
return undefined;
}
}
Expand Down Expand Up @@ -41530,7 +41530,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
) {
Debug.assert(!!(type.symbol.flags & SymbolFlags.ConstEnum));
const constEnumDeclaration = type.symbol.valueDeclaration as EnumDeclaration;
const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(constEnumDeclaration).resolvedPath);
const redirect = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)?.resolvedRef;
if (constEnumDeclaration.flags & NodeFlags.Ambient && !isValidTypeOnlyAliasUseSite(node) && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
}
Expand Down Expand Up @@ -48184,7 +48184,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
targetFlags & SymbolFlags.ConstEnum
) {
const constEnumDeclaration = target.valueDeclaration as EnumDeclaration;
const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(constEnumDeclaration).resolvedPath);
const redirect = host.getRedirectFromOutput(getSourceFileOfNode(constEnumDeclaration).resolvedPath)?.resolvedRef;
if (constEnumDeclaration.flags & NodeFlags.Ambient && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
error(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
}
Expand Down Expand Up @@ -53374,7 +53374,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host: TypeCheckerHo
getPackageJsonInfoCache: () => host.getPackageJsonInfoCache?.(),
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
redirectTargetsMap: host.redirectTargetsMap,
getProjectReferenceRedirect: fileName => host.getProjectReferenceRedirect(fileName),
getRedirectFromSourceFile: fileName => host.getRedirectFromSourceFile(fileName),
isSourceOfProjectReferenceRedirect: fileName => host.isSourceOfProjectReferenceRedirect(fileName),
fileExists: fileName => host.fileExists(fileName),
getFileIncludeReasons: () => host.getFileIncludeReasons(),
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/moduleSpecifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ export function forEachFileNameOfModule<T>(
): T | undefined {
const getCanonicalFileName = hostGetCanonicalFileName(host);
const cwd = host.getCurrentDirectory();
const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.getProjectReferenceRedirect(importedFileName) : undefined;
const referenceRedirect = host.isSourceOfProjectReferenceRedirect(importedFileName) ? host.getRedirectFromSourceFile(importedFileName)?.outputDts : undefined;
const importedPath = toPath(importedFileName, cwd, getCanonicalFileName);
const redirects = host.redirectTargetsMap.get(importedPath) || emptyArray;
const importedFileNames = [...(referenceRedirect ? [referenceRedirect] : emptyArray), importedFileName, ...redirects];
Expand Down
Loading