Initialize the map for dts to reference and source to reference when parsing project reference as its always needed#61746
Merged
sheetalkamat merged 1 commit intomainfrom Jun 4, 2025
Merged
Conversation
d817e52 to
7d2de4c
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the project reference redirection logic to improve load performance for projects with many references by renaming and consolidating the redirection APIs. Key changes include:
- Renaming functions from getProjectReferenceRedirect/getResolvedProjectReferenceToRedirect to getRedirectFromSourceFile (and introducing getRedirectFromOutput).
- Updating types, mapping variables, and function calls across multiple modules (compiler, server, services) to support the new redirection mechanism.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/utilities.ts | Renames function call to use getRedirectFromSourceFile instead of the legacy API. |
| src/server/project.ts | Updates class methods to use the new redirection API. |
| src/compiler/utilities.ts | Adjusts function calls and callback signatures to align with the new API. |
| src/compiler/types.ts | Updates type declarations to match the new redirection functions. |
| src/compiler/resolutionCache.ts | Replaces old redirect function calls with getRedirectFromSourceFile. |
| src/compiler/program.ts | Refactors multiple redirection-related operations, mapping setups, and error handling to use the new API. |
| src/compiler/moduleSpecifiers.ts | Updates module specifier redirection calls to use outputDts from getRedirectFromSourceFile. |
| src/compiler/checker.ts | Adjusts redirection logic in error messaging to reference outputDts through the new API. |
| src/compiler/builderState.ts | Replaces legacy project reference redirect usage with getRedirectFromSourceFile for file path resolution. |
7d2de4c to
88a3ff3
Compare
Member
Author
|
@typescript-bot pack this |
88a3ff3 to
b3cb7db
Compare
Member
Author
|
@typescript-bot pack this |
Collaborator
Collaborator
|
Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
|
:( |
|
' |
…parsing project reference as its always needed
b3cb7db to
a0d28b9
Compare
andrewbranch
approved these changes
Jun 4, 2025
jakebailey
approved these changes
Jun 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The time to update project graph went from
268881.891msto36340.1192msto