Skip to content
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

Fix JSDoc @import resolution in --moduleResolution bundler #60011

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

andrewbranch
Copy link
Member

Fixes #60007

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Sep 19, 2024
@jakebailey
Copy link
Member

@typescript-bot test it

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 24, 2024

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

Command Status Results
test top400 ✅ Started ✅ Results
user test this ✅ Started ✅ Results
run dt ✅ Started ✅ Results
perf test this faster ✅ Started 👀 Results

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/60011/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 62,340 62,340 ~ ~ ~ p=1.000 n=6
Types 50,378 50,378 ~ ~ ~ p=1.000 n=6
Memory used 193,901k (± 0.97%) 193,905k (± 0.96%) ~ 192,691k 196,319k p=0.748 n=6
Parse Time 1.57s (± 0.48%) 1.57s (± 0.48%) ~ 1.56s 1.58s p=1.000 n=6
Bind Time 0.86s (± 0.95%) 0.86s (± 1.36%) ~ 0.85s 0.88s p=0.498 n=6
Check Time 11.32s (± 0.24%) 11.37s (± 0.33%) ~ 11.31s 11.42s p=0.053 n=6
Emit Time 3.25s (± 0.92%) 3.23s (± 1.85%) ~ 3.12s 3.29s p=0.747 n=6
Total Time 17.00s (± 0.13%) 17.04s (± 0.13%) +0.03s (+ 0.20%) 17.00s 17.06s p=0.036 n=6
angular-1 - node (v18.15.0, x64)
Errors 7 7 ~ ~ ~ p=1.000 n=6
Symbols 947,102 947,102 ~ ~ ~ p=1.000 n=6
Types 410,738 410,738 ~ ~ ~ p=1.000 n=6
Memory used 1,224,015k (± 0.00%) 1,224,017k (± 0.00%) ~ 1,223,933k 1,224,094k p=0.936 n=6
Parse Time 7.84s (± 0.75%) 7.90s (± 0.56%) ~ 7.84s 7.96s p=0.054 n=6
Bind Time 2.22s (± 0.64%) 2.23s (± 0.54%) ~ 2.22s 2.25s p=0.493 n=6
Check Time 36.35s (± 0.31%) 36.48s (± 0.40%) ~ 36.31s 36.65s p=0.149 n=6
Emit Time 17.89s (± 0.23%) 17.92s (± 0.61%) ~ 17.80s 18.11s p=0.748 n=6
Total Time 64.30s (± 0.16%) 64.52s (± 0.33%) ~ 64.27s 64.78s p=0.093 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,521,651 2,521,651 ~ ~ ~ p=1.000 n=6
Types 936,037 936,037 ~ ~ ~ p=1.000 n=6
Memory used 2,351,756k (± 0.00%) 2,351,775k (± 0.00%) ~ 2,351,704k 2,351,857k p=0.810 n=6
Parse Time 10.99s (± 0.51%) 11.02s (± 0.36%) ~ 10.97s 11.07s p=0.377 n=6
Bind Time 2.56s (± 0.57%) 2.56s (± 0.59%) ~ 2.53s 2.57s p=0.622 n=6
Check Time 86.58s (± 0.34%) 86.64s (± 0.35%) ~ 86.26s 87.06s p=0.748 n=6
Emit Time 0.32s (± 3.09%) 0.33s (± 2.99%) ~ 0.31s 0.34s p=0.116 n=6
Total Time 100.45s (± 0.26%) 100.55s (± 0.30%) ~ 100.10s 100.94s p=0.810 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,250,056 1,250,064 +8 (+ 0.00%) ~ ~ p=0.001 n=6
Types 264,970 264,977 +7 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,404,319k (± 0.01%) 2,464,920k (± 5.96%) ~ 2,403,762k 2,764,903k p=0.471 n=6
Parse Time 6.11s (± 0.63%) 6.14s (± 1.35%) ~ 6.08s 6.30s p=0.872 n=6
Bind Time 2.28s (± 0.39%) 2.26s (± 0.53%) -0.02s (- 0.73%) 2.25s 2.28s p=0.027 n=6
Check Time 41.38s (± 0.56%) 41.18s (± 0.80%) ~ 40.68s 41.69s p=0.173 n=6
Emit Time 3.62s (± 4.28%) 3.58s (± 3.60%) ~ 3.46s 3.83s p=0.419 n=6
Total Time 53.40s (± 0.54%) 53.17s (± 0.70%) ~ 52.68s 53.69s p=0.230 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,250,056 1,250,064 +8 (+ 0.00%) ~ ~ p=0.001 n=6
Types 264,970 264,977 +7 (+ 0.00%) ~ ~ p=0.001 n=6
Memory used 2,479,946k (± 0.02%) 2,479,337k (± 0.02%) ~ 2,478,467k 2,480,361k p=0.173 n=6
Parse Time 7.86s (± 0.86%) 7.87s (± 0.66%) ~ 7.80s 7.91s p=0.575 n=6
Bind Time 2.53s (± 0.56%) 2.53s (± 0.70%) ~ 2.50s 2.55s p=0.627 n=6
Check Time 51.66s (± 0.61%) 51.70s (± 0.81%) ~ 51.07s 52.16s p=0.689 n=6
Emit Time 4.36s (± 2.06%) 4.41s (± 1.59%) ~ 4.32s 4.53s p=0.170 n=6
Total Time 66.42s (± 0.58%) 66.50s (± 0.72%) ~ 65.70s 66.99s p=0.810 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 260,936 260,944 +8 (+ 0.00%) ~ ~ p=0.001 n=6
Types 106,385 106,392 +7 (+ 0.01%) ~ ~ p=0.001 n=6
Memory used 436,562k (± 0.02%) 436,748k (± 0.01%) +186k (+ 0.04%) 436,675k 436,778k p=0.005 n=6
Parse Time 4.25s (± 0.71%) 4.27s (± 0.78%) ~ 4.24s 4.32s p=0.455 n=6
Bind Time 1.61s (± 0.39%) 1.61s (± 0.39%) ~ 1.60s 1.62s p=1.000 n=6
Check Time 22.47s (± 0.44%) 22.53s (± 0.33%) ~ 22.43s 22.65s p=0.378 n=6
Emit Time 1.85s (± 0.82%) 1.86s (± 1.69%) ~ 1.83s 1.92s p=0.806 n=6
Total Time 30.18s (± 0.43%) 30.28s (± 0.34%) ~ 30.14s 30.42s p=0.471 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 68 68 ~ ~ ~ p=1.000 n=6
Symbols 225,916 225,916 ~ ~ ~ p=1.000 n=6
Types 94,414 94,414 ~ ~ ~ p=1.000 n=6
Memory used 370,910k (± 0.03%) 370,923k (± 0.02%) ~ 370,809k 371,053k p=0.936 n=6
Parse Time 3.44s (± 0.73%) 3.46s (± 0.70%) ~ 3.43s 3.49s p=0.466 n=6
Bind Time 1.93s (± 1.13%) 1.92s (± 0.78%) ~ 1.89s 1.93s p=0.256 n=6
Check Time 19.52s (± 0.09%) 19.57s (± 0.59%) ~ 19.40s 19.67s p=0.374 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 24.89s (± 0.14%) 24.94s (± 0.50%) ~ 24.77s 25.06s p=0.422 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,099,752 3,099,752 ~ ~ ~ p=1.000 n=6
Types 1,068,967 1,068,967 ~ ~ ~ p=1.000 n=6
Memory used 3,196,765k (± 0.00%) 3,196,792k (± 0.00%) ~ 3,196,736k 3,196,871k p=0.575 n=6
Parse Time 17.21s (± 0.45%) 17.17s (± 0.24%) ~ 17.11s 17.22s p=0.375 n=6
Bind Time 5.31s (± 0.39%) 5.37s (± 1.90%) ~ 5.30s 5.55s p=0.572 n=6
Check Time 99.80s (± 0.45%) 99.56s (± 0.37%) ~ 99.17s 100.07s p=0.296 n=6
Emit Time 27.43s (± 0.38%) 28.21s (± 7.66%) ~ 27.22s 32.62s p=0.521 n=6
Total Time 149.75s (± 0.37%) 150.31s (± 1.30%) ~ 149.24s 154.28s p=0.936 n=6
webpack - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 278,920 278,920 ~ ~ ~ p=1.000 n=6
Types 113,837 113,837 ~ ~ ~ p=1.000 n=6
Memory used 428,303k (± 0.01%) 428,287k (± 0.01%) ~ 428,259k 428,345k p=0.810 n=6
Parse Time 3.29s (± 0.25%) 3.30s (± 0.67%) ~ 3.28s 3.33s p=1.000 n=6
Bind Time 1.44s (± 0.62%) 1.43s -0.01s (- 0.69%) ~ ~ p=0.028 n=6
Check Time 14.97s (± 0.29%) 14.94s (± 0.34%) ~ 14.85s 14.99s p=0.520 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 19.71s (± 0.23%) 19.68s (± 0.30%) ~ 19.56s 19.72s p=0.742 n=6
xstate-main - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 540,027 540,027 ~ ~ ~ p=1.000 n=6
Types 181,292 181,292 ~ ~ ~ p=1.000 n=6
Memory used 483,579k (± 0.02%) 483,564k (± 0.01%) ~ 483,519k 483,633k p=1.000 n=6
Parse Time 4.02s (± 0.62%) 4.02s (± 0.24%) ~ 4.01s 4.03s p=0.805 n=6
Bind Time 1.43s (± 0.38%) 1.44s (± 0.72%) ~ 1.42s 1.45s p=0.663 n=6
Check Time 22.91s (± 0.35%) 22.90s (± 0.32%) ~ 22.80s 23.02s p=0.872 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 28.36s (± 0.27%) 28.35s (± 0.24%) ~ 28.27s 28.47s p=0.467 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60011/merge:

Everything looks good!

@andrewbranch
Copy link
Member Author

I think this can go in after the beta cut if needed, but either way, @sandersn feel free to merge for me upon approval.

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

I'd like to know whether this will make us start resolving @import in TS files.

@@ -4617,12 +4617,10 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
? location
: (isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)?.name ||
(isLiteralImportTypeNode(location) ? location : undefined)?.argument.literal ||
(isInJSFile(location) && isJSDocImportTag(location) ? location.moduleSpecifier : undefined) ||
Copy link
Member

Choose a reason for hiding this comment

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

Does it matter that we aren't checking isInJsFile any more? Would we resolve an @import inside a ts file now?

Copy link
Member

Choose a reason for hiding this comment

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

Confirmed by changing the test to .ts instead. I'll add that as importTag22.ts and merge the PR.

@sandersn sandersn merged commit 8496039 into microsoft:main Sep 25, 2024
32 checks passed
@andrewbranch andrewbranch deleted the bug/60007 branch October 14, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

JSDoc @import of "tslib" fails under --moduleResolution bundler
4 participants