Skip to content

Port --traceResolutions #1537

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 14 commits into from
Aug 12, 2025
Merged

Port --traceResolutions #1537

merged 14 commits into from
Aug 12, 2025

Conversation

sheetalkamat
Copy link
Member

No description provided.

@Copilot Copilot AI review requested due to automatic review settings August 7, 2025 21:07
Copilot

This comment was marked as outdated.

@jakebailey
Copy link
Member

I suspect diffing the resolutions won't be useful due to the things noted above; we don't have classic/node10 resolution and we removed all deduplication from the resolver because it was far faster to just let the FS cache things.

@sheetalkamat
Copy link
Member Author

tion from the resolver because it was far faster to just let the FS cache things.

So do we not want to diff with old but baseline trace.json

@jakebailey
Copy link
Member

I am not sure; I think we had been concerned about the output even being consistent given it's now happening concurrently. It implies that the resolutions can't be streamed to an output without being interleaved.

@sheetalkamat
Copy link
Member Author

I am not sure; I think we had been concerned about the output even being consistent given it's now happening concurrently. It implies that the resolutions can't be streamed to an output without being interleaved.

The way this is implemented it guaranetees the order of the trace
The output is always after the trace so shouldnt not interfere with that.

i am not sure if diffing with old is useful or not and who is looking at it so may be i will just skip that part but baseline the trace so we can detect the changes

@jakebailey jakebailey requested a review from Copilot August 12, 2025 16:29
Copy link
Contributor

@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 implements support for the --traceResolutions flag by adding detailed module resolution tracing to the compiler. The feature enables developers to see the step-by-step process of how TypeScript resolves modules, similar to the TypeScript compiler's trace resolution functionality.

  • Adds comprehensive module resolution tracing with detailed logging of each resolution step
  • Includes trace output for both successful and failed module resolutions
  • Shows detailed information about package.json lookups, exports matching, file existence checks, and resolution strategies

Reviewed Changes

Copilot reviewed 195 out of 195 changed files in this pull request and generated no comments.

File Description
testdata/baselines/reference/tsc/extends/configDir-template.js Adds trace resolution output for module resolution attempts
testdata/baselines/reference/tsc/extends/configDir-template-with-commandline.js Adds trace resolution output for module resolution with command line options
testdata/baselines/reference/submodule/conformance/*.trace.json Multiple test files showing comprehensive module resolution traces for various scenarios including type lookups, package exports, imports, and different module resolution strategies

@sheetalkamat
Copy link
Member Author

there is one more race with the caching log, let me fix that

@sheetalkamat sheetalkamat added this pull request to the merge queue Aug 12, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Aug 12, 2025
@jakebailey
Copy link
Member

Ah, right, merge conflict with that other PR 😄

@jakebailey jakebailey enabled auto-merge August 12, 2025 19:17
@jakebailey jakebailey added this pull request to the merge queue Aug 12, 2025
Merged via the queue into main with commit f6a78d6 Aug 12, 2025
22 checks passed
@jakebailey jakebailey deleted the traceResolutions branch August 12, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants