Skip to content

Initialize the map for dts to reference and source to reference when parsing project reference as its always needed #61746

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

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

sheetalkamat
Copy link
Member

@sheetalkamat sheetalkamat commented May 21, 2025

The time to update project graph went from 268881.891ms to 36340.1192ms

Info 18842[12:58:41.728] Finishing updateGraphWorker: Project: tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed: 268881.891ms

to


Info 18842[13:05:04.939] Finishing updateGraphWorker: Project: tsconfig.json projectStateVersion: 1 projectProgramVersion: 0 structureChanged: true structureIsReused:: Not Elapsed: 36340.1192ms

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels May 21, 2025
@sheetalkamat sheetalkamat marked this pull request as ready for review May 21, 2025 20:29
@Copilot Copilot AI review requested due to automatic review settings May 21, 2025 20:29
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sheetalkamat sheetalkamat changed the title Another attempt at faster load of project with lots of project references @sheetalkamat Initialize the map for dts to reference and source to reference when parsing project reference as its always needed May 21, 2025
@sheetalkamat sheetalkamat changed the title @sheetalkamat Initialize the map for dts to reference and source to reference when parsing project reference as its always needed Initialize the map for dts to reference and source to reference when parsing project reference as its always needed May 21, 2025
@microsoft microsoft deleted a comment from typescript-bot May 21, 2025
@microsoft microsoft deleted a comment from typescript-bot May 21, 2025
@sheetalkamat
Copy link
Member Author

@typescript-bot pack this

@sheetalkamat
Copy link
Member Author

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 21, 2025

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
pack this ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 21, 2025

Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/165151/artifacts?artifactName=tgz&fileId=DF340D1472915DF7920DD384A08B1F4BC26FD0D62A650DC2E82FFBE5BF205C7E02&fileName=/typescript-5.9.0-insiders.20250521.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/[email protected]".;

@microsoft microsoft deleted a comment from typescript-bot May 21, 2025
@microsoft microsoft deleted a comment from typescript-bot May 21, 2025
@KirkNoJerk
Copy link

:(

@KirkNoJerk
Copy link

'

…parsing project reference as its always needed
@sheetalkamat sheetalkamat merged commit 3dd0a35 into main Jun 4, 2025
32 checks passed
@sheetalkamat sheetalkamat deleted the refactorReferences branch June 4, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants