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

Make the implicitly exported rule consistent between checker and binder #54659

Merged
merged 2 commits into from Jun 22, 2023

Conversation

gabritto
Copy link
Member

Fixes #54342.

In the binder, when deciding if a declaration should be treated as exported or not, we consult the declaration container's flags to see if it is an "export context", meaning an ambient context where declarations are implicitly exported. In the checker, however, we treat everything in an ambient context as exported, regardless of whether we're in an ambient context where declarations are implicitly exported, resulting in us incorrectly not erroring on the .d.ts file present in #54342.

@gabritto
Copy link
Member Author

@typescript-bot run DT

@typescript-bot
Copy link
Collaborator

Heya @gabritto, I'm starting to run the parallelized Definitely Typed test suite on this PR at 777e7be. Hold tight - I'll update this comment with the log link once the build has been queued.

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jun 15, 2023
@gabritto
Copy link
Member Author

Well, I guess the bot still isn't working, so we'll have to wait to see what this PR breaks in DT.

@gabritto
Copy link
Member Author

@typescript-bot run DT

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 15, 2023

Heya @gabritto, I've started to run the parallelized Definitely Typed test suite on this PR at 777e7be. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

Hey @gabritto, the results of running the DT tests are ready.
There were interesting changes:

Branch only errors:

Package: react-relay
Error:

Error: Errors in typescript@local for external dependencies:
../relay-runtime/lib/store/RelayStoreTypes.d.ts(108,18): error TS2395: Individual declarations in merged declaration 'OperationDescriptor' must be all exported or all local.
../relay-runtime/lib/store/RelayStoreTypes.d.ts(419,11): error TS2395: Individual declarations in merged declaration 'OperationDescriptor' must be all exported or all local.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: react-relay/v7
Error:

Error: Errors in typescript@local for external dependencies:
../../relay-runtime/lib/store/RelayStoreTypes.d.ts(108,18): error TS2395: Individual declarations in merged declaration 'OperationDescriptor' must be all exported or all local.
../../relay-runtime/lib/store/RelayStoreTypes.d.ts(419,11): error TS2395: Individual declarations in merged declaration 'OperationDescriptor' must be all exported or all local.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: relay-runtime
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/relay-runtime/lib/store/RelayStoreTypes.d.ts:108:18
ERROR: 108:18  expect  TypeScript@local compile error: 
Individual declarations in merged declaration 'OperationDescriptor' must be all exported or all local.
ERROR: 419:11  expect  TypeScript@local compile error: 
Individual declarations in merged declaration 'OperationDescriptor' must be all exported or all local.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: jsonld
Error:

Error: /home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/DefinitelyTyped/types/jsonld/index.d.ts:7:22
ERROR: 7:22    expect  TypeScript@local compile error: 
Individual declarations in merged declaration 'JsonLdProcessor' must be all exported or all local.
ERROR: 146:12  expect  TypeScript@local compile error: 
Individual declarations in merged declaration 'JsonLdProcessor' must be all exported or all local.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

Package: relay-test-utils
Error:

Error: Errors in typescript@local for external dependencies:
../relay-runtime/lib/store/RelayStoreTypes.d.ts(108,18): error TS2395: Individual declarations in merged declaration 'OperationDescriptor' must be all exported or all local.
../relay-runtime/lib/store/RelayStoreTypes.d.ts(419,11): error TS2395: Individual declarations in merged declaration 'OperationDescriptor' must be all exported or all local.

    at testTypesVersion (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:194:15)
    at async runTests (/home/vsts/work/1/s/DefinitelyTyped-tools/packages/dtslint-runner/node_modules/@definitelytyped/dtslint/dist/index.js:151:9)

You can check the log here.

@gabritto
Copy link
Member Author

@typescript-bot test this
@typescript-bot user test this
@typescript-bot user test tsserver
@typescript-bot test top100
@typescript-bot test tsserver top100
@typescript-bot perf test this

pretty please

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 15, 2023

Heya @gabritto, I've started to run the diff-based user code test suite on this PR at 777e7be. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 15, 2023

Heya @gabritto, I've started to run the diff-based top-repos suite (tsserver) on this PR at 777e7be. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 15, 2023

Heya @gabritto, I've started to run the extended test suite on this PR at 777e7be. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 15, 2023

Heya @gabritto, I've started to run the perf test suite on this PR at 777e7be. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 15, 2023

Heya @gabritto, I've started to run the diff-based user code test suite (tsserver) on this PR at 777e7be. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Jun 15, 2023

Heya @gabritto, I've started to run the diff-based top-repos suite on this PR at 777e7be. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the user test suite comparing main and refs/pull/54659/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the user test suite comparing main and refs/pull/54659/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Unknown failure"
  • 1 instance of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

rxjs-src

/mnt/ts_downloads/rxjs-src/build.sh

  • [NEW] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-54659/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
  • [MISSING] error TS2428: All declarations of 'WeakMap' must have identical type parameters.
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.collection.d.ts(63,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.iterable.d.ts(162,11)
    • /home/vsts/work/1/s/typescript-main/lib/lib.es2015.symbol.wellknown.d.ts(140,11)

@jakebailey
Copy link
Member

I am moderately suspicious that the user tests didn't net anything, but maybe that's to be expected if this only happened in ambient contexts. (I guess top100 is still running)

@typescript-bot
Copy link
Collaborator

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

Here they are:

Compiler

Comparison Report - main..54659
Metric main 54659 Delta Best Worst p-value
Angular - node (v18.10.0, x64)
Memory used 366,135k (± 0.01%) 366,143k (± 0.01%) ~ 366,108k 366,187k p=0.630 n=6
Parse Time 3.41s (± 0.69%) 3.41s (± 1.07%) ~ 3.37s 3.46s p=1.000 n=6
Bind Time 1.12s (± 0.67%) 1.12s (± 0.67%) ~ 1.11s 1.13s p=1.000 n=6
Check Time 8.78s (± 0.48%) 8.82s (± 0.88%) ~ 8.74s 8.95s p=0.808 n=6
Emit Time 7.43s (± 0.76%) 7.46s (± 0.75%) ~ 7.39s 7.56s p=0.334 n=6
Total Time 20.75s (± 0.45%) 20.81s (± 0.66%) ~ 20.62s 21.01s p=0.471 n=6
Compiler-Unions - node (v18.10.0, x64)
Memory used 192,708k (± 1.51%) 192,745k (± 1.50%) ~ 190,817k 196,484k p=0.810 n=6
Parse Time 1.51s (± 0.72%) 1.51s (± 1.00%) ~ 1.48s 1.52s p=1.000 n=6
Bind Time 0.77s (± 0.00%) 0.77s (± 0.82%) ~ 0.76s 0.78s p=1.000 n=6
Check Time 9.49s (± 0.43%) 9.45s (± 0.32%) ~ 9.41s 9.49s p=0.108 n=6
Emit Time 2.74s (± 1.16%) 2.74s (± 0.96%) ~ 2.72s 2.79s p=0.809 n=6
Total Time 14.51s (± 0.34%) 14.47s (± 0.38%) ~ 14.38s 14.55s p=0.170 n=6
Monaco - node (v18.10.0, x64)
Memory used 346,606k (± 0.01%) 346,632k (± 0.01%) ~ 346,601k 346,731k p=0.748 n=6
Parse Time 2.60s (± 0.86%) 2.60s (± 0.80%) ~ 2.56s 2.62s p=0.369 n=6
Bind Time 1.01s (± 0.97%) 1.01s (± 0.51%) ~ 1.00s 1.01s p=0.931 n=6
Check Time 7.14s (± 0.48%) 7.16s (± 0.53%) ~ 7.12s 7.22s p=0.373 n=6
Emit Time 4.24s (± 0.72%) 4.25s (± 0.81%) ~ 4.22s 4.31s p=0.808 n=6
Total Time 14.99s (± 0.33%) 15.01s (± 0.37%) ~ 14.92s 15.08s p=0.748 n=6
TFS - node (v18.10.0, x64)
Memory used 300,653k (± 0.00%) 300,641k (± 0.01%) ~ 300,616k 300,665k p=0.378 n=6
Parse Time 2.06s (± 1.18%) 2.04s (± 0.91%) ~ 2.02s 2.07s p=0.418 n=6
Bind Time 1.14s (± 0.78%) 1.14s (± 1.02%) ~ 1.13s 1.16s p=0.933 n=6
Check Time 6.64s (± 0.46%) 6.63s (± 0.44%) ~ 6.59s 6.66s p=0.419 n=6
Emit Time 3.87s (± 0.44%) 3.86s (± 0.54%) ~ 3.83s 3.88s p=0.331 n=6
Total Time 13.71s (± 0.27%) 13.68s (± 0.29%) ~ 13.63s 13.72s p=0.225 n=6
material-ui - node (v18.10.0, x64)
Memory used 481,063k (± 0.02%) 481,102k (± 0.01%) ~ 480,990k 481,145k p=0.298 n=6
Parse Time 3.11s (± 0.26%) 3.11s (± 0.41%) ~ 3.09s 3.12s p=0.558 n=6
Bind Time 0.92s (± 1.15%) 0.92s (± 1.64%) ~ 0.90s 0.93s p=0.868 n=6
Check Time 16.81s (± 0.20%) 16.86s (± 0.33%) ~ 16.78s 16.94s p=0.123 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 20.83s (± 0.17%) 20.89s (± 0.27%) ~ 20.81s 20.97s p=0.090 n=6
xstate - node (v18.10.0, x64)
Memory used 563,165k (± 0.04%) 563,178k (± 0.03%) ~ 562,942k 563,362k p=0.936 n=6
Parse Time 3.82s (± 0.45%) 3.81s (± 0.46%) ~ 3.78s 3.83s p=0.293 n=6
Bind Time 1.63s (± 0.46%) 1.63s (± 1.10%) ~ 1.61s 1.66s p=0.934 n=6
Check Time 2.79s (± 0.53%) 2.80s (± 0.52%) ~ 2.79s 2.82s p=0.164 n=6
Emit Time 0.08s (± 0.00%) 0.08s (± 0.00%) ~ 0.08s 0.08s p=1.000 n=6
Total Time 8.32s (± 0.27%) 8.32s (± 0.41%) ~ 8.28s 8.38s p=0.808 n=6
Angular - node (v16.17.1, x64)
Memory used 365,530k (± 0.01%) 365,526k (± 0.01%) ~ 365,470k 365,591k p=0.936 n=6
Parse Time 3.56s (± 0.49%) 3.56s (± 0.29%) ~ 3.55s 3.58s p=0.558 n=6
Bind Time 1.18s (± 0.44%) 1.18s (± 0.54%) ~ 1.17s 1.19s p=0.386 n=6
Check Time 9.62s (± 0.40%) 9.63s (± 0.51%) ~ 9.59s 9.72s p=0.936 n=6
Emit Time 7.95s (± 0.86%) 7.91s (± 0.63%) ~ 7.86s 8.00s p=0.172 n=6
Total Time 22.30s (± 0.47%) 22.28s (± 0.36%) ~ 22.19s 22.38s p=0.809 n=6
Compiler-Unions - node (v16.17.1, x64)
Memory used 192,572k (± 0.03%) 193,158k (± 0.70%) ~ 192,562k 195,923k p=0.173 n=6
Parse Time 1.59s (± 0.76%) 1.60s (± 1.16%) ~ 1.57s 1.62s p=0.607 n=6
Bind Time 0.83s (± 1.01%) 0.83s (± 0.99%) ~ 0.82s 0.84s p=1.000 n=6
Check Time 10.15s (± 0.93%) 10.19s (± 0.60%) ~ 10.13s 10.28s p=0.688 n=6
Emit Time 3.00s (± 1.02%) 3.01s (± 0.56%) ~ 2.98s 3.03s p=0.935 n=6
Total Time 15.58s (± 0.62%) 15.62s (± 0.59%) ~ 15.50s 15.72s p=0.748 n=6
Monaco - node (v16.17.1, x64)
Memory used 345,877k (± 0.00%) 345,885k (± 0.01%) ~ 345,862k 345,908k p=0.572 n=6
Parse Time 2.73s (± 0.67%) 2.73s (± 0.40%) ~ 2.71s 2.74s p=0.869 n=6
Bind Time 1.09s (± 0.47%) 1.09s (± 0.69%) ~ 1.08s 1.10s p=0.784 n=6
Check Time 7.84s (± 0.49%) 7.89s (± 0.64%) ~ 7.85s 7.99s p=0.052 n=6
Emit Time 4.44s (± 0.54%) 4.47s (± 0.80%) ~ 4.42s 4.52s p=0.169 n=6
Total Time 16.10s (± 0.41%) 16.18s (± 0.37%) ~ 16.12s 16.27s p=0.066 n=6
TFS - node (v16.17.1, x64)
Memory used 299,992k (± 0.01%) 299,989k (± 0.01%) ~ 299,962k 300,020k p=0.936 n=6
Parse Time 2.16s (± 0.59%) 2.17s (± 0.98%) ~ 2.14s 2.20s p=0.565 n=6
Bind Time 1.24s (± 0.61%) 1.24s (± 0.61%) ~ 1.23s 1.25s p=1.000 n=6
Check Time 7.30s (± 0.27%) 7.32s (± 0.51%) ~ 7.27s 7.36s p=0.372 n=6
Emit Time 4.31s (± 0.46%) 4.36s (± 0.73%) +0.04s (+ 1.04%) 4.31s 4.41s p=0.018 n=6
Total Time 15.01s (± 0.24%) 15.08s (± 0.29%) +0.07s (+ 0.44%) 15.01s 15.13s p=0.030 n=6
material-ui - node (v16.17.1, x64)
Memory used 480,361k (± 0.01%) 480,350k (± 0.01%) ~ 480,321k 480,395k p=0.810 n=6
Parse Time 3.26s (± 0.39%) 3.25s (± 0.16%) ~ 3.25s 3.26s p=0.273 n=6
Bind Time 0.93s (± 0.59%) 0.94s (± 0.86%) ~ 0.94s 0.96s p=0.054 n=6
Check Time 17.90s (± 0.91%) 17.83s (± 0.35%) ~ 17.75s 17.92s p=0.520 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 22.10s (± 0.77%) 22.03s (± 0.28%) ~ 21.94s 22.11s p=0.575 n=6
xstate - node (v16.17.1, x64)
Memory used 560,644k (± 0.02%) 560,615k (± 0.02%) ~ 560,506k 560,770k p=0.575 n=6
Parse Time 3.99s (± 0.49%) 3.99s (± 0.32%) ~ 3.98s 4.01s p=0.870 n=6
Bind Time 1.76s (± 0.43%) 1.75s (± 0.23%) ~ 1.75s 1.76s p=0.100 n=6
Check Time 3.06s (± 0.64%) 3.06s (± 0.40%) ~ 3.05s 3.08s p=0.870 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 0.00%) ~ 0.09s 0.09s p=1.000 n=6
Total Time 8.90s (± 0.37%) 8.89s (± 0.22%) ~ 8.87s 8.92s p=0.466 n=6
Angular - node (v14.21.3, x64)
Memory used 359,557k (± 0.01%) 359,578k (± 0.01%) ~ 359,544k 359,632k p=0.199 n=6
Parse Time 3.65s (± 0.56%) 3.68s (± 0.76%) ~ 3.64s 3.71s p=0.141 n=6
Bind Time 1.22s (± 0.62%) 1.22s (± 0.80%) ~ 1.21s 1.24s p=0.652 n=6
Check Time 10.02s (± 0.51%) 10.11s (± 0.35%) +0.08s (+ 0.85%) 10.05s 10.15s p=0.024 n=6
Emit Time 8.31s (± 0.91%) 8.37s (± 0.88%) ~ 8.27s 8.48s p=0.261 n=6
Total Time 23.21s (± 0.40%) 23.37s (± 0.47%) ~ 23.27s 23.54s p=0.066 n=6
Compiler-Unions - node (v14.21.3, x64)
Memory used 187,940k (± 0.02%) 187,930k (± 0.01%) ~ 187,909k 187,966k p=0.689 n=6
Parse Time 1.61s (± 0.47%) 1.62s (± 0.64%) ~ 1.60s 1.63s p=0.351 n=6
Bind Time 0.85s (± 0.61%) 0.85s (± 1.05%) ~ 0.84s 0.86s p=0.541 n=6
Check Time 10.28s (± 0.49%) 10.34s (± 0.61%) ~ 10.27s 10.45s p=0.065 n=6
Emit Time 3.13s (± 1.08%) 3.13s (± 0.63%) ~ 3.09s 3.14s p=0.808 n=6
Total Time 15.86s (± 0.44%) 15.94s (± 0.44%) ~ 15.87s 16.07s p=0.127 n=6
Monaco - node (v14.21.3, x64)
Memory used 341,039k (± 0.01%) 341,045k (± 0.01%) ~ 340,977k 341,071k p=0.471 n=6
Parse Time 2.79s (± 0.63%) 2.82s (± 0.93%) ~ 2.79s 2.87s p=0.071 n=6
Bind Time 1.11s (± 1.05%) 1.12s (± 0.75%) ~ 1.11s 1.13s p=0.167 n=6
Check Time 8.20s (± 0.57%) 8.25s (± 0.88%) ~ 8.11s 8.31s p=0.148 n=6
Emit Time 4.67s (± 1.12%) 4.66s (± 0.44%) ~ 4.64s 4.68s p=0.745 n=6
Total Time 16.78s (± 0.37%) 16.84s (± 0.44%) ~ 16.72s 16.95s p=0.227 n=6
TFS - node (v14.21.3, x64)
Memory used 295,153k (± 0.00%) 295,154k (± 0.00%) ~ 295,146k 295,161k p=0.873 n=6
Parse Time 2.40s (± 0.61%) 2.40s (± 1.25%) ~ 2.37s 2.45s p=0.871 n=6
Bind Time 1.07s (± 0.51%) 1.06s (± 0.49%) ~ 1.06s 1.07s p=0.640 n=6
Check Time 7.64s (± 0.79%) 7.63s (± 0.40%) ~ 7.59s 7.66s p=0.810 n=6
Emit Time 4.33s (± 0.60%) 4.35s (± 0.82%) ~ 4.32s 4.42s p=0.416 n=6
Total Time 15.44s (± 0.43%) 15.45s (± 0.39%) ~ 15.38s 15.53s p=0.936 n=6
material-ui - node (v14.21.3, x64)
Memory used 475,894k (± 0.01%) 475,892k (± 0.00%) ~ 475,859k 475,912k p=0.936 n=6
Parse Time 3.33s (± 0.41%) 3.34s (± 0.29%) ~ 3.33s 3.35s p=0.315 n=6
Bind Time 1.01s (± 0.51%) 1.00s (± 0.63%) ~ 0.99s 1.01s p=0.091 n=6
Check Time 18.80s (± 0.44%) 18.78s (± 0.61%) ~ 18.65s 18.98s p=0.629 n=6
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) ~ 0.00s 0.00s p=1.000 n=6
Total Time 23.14s (± 0.37%) 23.12s (± 0.53%) ~ 22.99s 23.33s p=0.687 n=6
xstate - node (v14.21.3, x64)
Memory used 549,633k (± 0.00%) 549,628k (± 0.00%) ~ 549,607k 549,643k p=0.574 n=6
Parse Time 4.22s (± 0.36%) 4.24s (± 0.52%) ~ 4.21s 4.27s p=0.167 n=6
Bind Time 1.67s (± 0.45%) 1.61s (± 3.36%) ~ 1.57s 1.68s p=0.215 n=6
Check Time 3.16s (± 0.52%) 3.16s (± 0.68%) ~ 3.13s 3.19s p=1.000 n=6
Emit Time 0.09s (± 0.00%) 0.09s (± 5.53%) ~ 0.09s 0.10s p=0.174 n=6
Total Time 9.14s (± 0.31%) 9.10s (± 0.58%) ~ 9.06s 9.20s p=0.173 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.21.3, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.21.3, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.21.3, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.21.3, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.21.3, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.21.3, x64)
Benchmark Name Iterations
Current 54659 6
Baseline main 6

TSServer

Comparison Report - main..54659
Metric main 54659 Delta Best Worst p-value
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,540ms (± 0.94%) 2,555ms (± 0.72%) ~ 2,539ms 2,590ms p=0.229 n=6
Req 2 - geterr 5,487ms (± 2.15%) 5,517ms (± 1.81%) ~ 5,325ms 5,622ms p=0.810 n=6
Req 3 - references 337ms (± 0.51%) 336ms (± 0.41%) ~ 334ms 337ms p=0.249 n=6
Req 4 - navto 289ms (± 0.97%) 287ms (± 0.53%) ~ 284ms 288ms p=0.211 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 84ms (± 1.22%) 85ms (± 0.74%) ~ 84ms 86ms p=0.203 n=6
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 2,664ms (± 0.61%) 2,667ms (± 0.63%) ~ 2,640ms 2,691ms p=0.936 n=6
Req 2 - geterr 4,305ms (± 0.36%) 4,280ms (± 0.36%) ~ 4,259ms 4,299ms p=0.054 n=6
Req 3 - references 351ms (± 0.90%) 349ms (± 0.43%) ~ 346ms 350ms p=0.222 n=6
Req 4 - navto 288ms (± 0.47%) 288ms (± 0.61%) ~ 285ms 290ms p=0.868 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 64ms (± 4.53%) 65ms (± 5.83%) ~ 62ms 70ms p=0.677 n=6
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 3,073ms (± 0.33%) 3,092ms (± 0.53%) +20ms (+ 0.64%) 3,081ms 3,124ms p=0.031 n=6
Req 2 - geterr 1,554ms (± 1.10%) 1,578ms (± 1.12%) ~ 1,546ms 1,597ms p=0.106 n=6
Req 3 - references 113ms (± 0.97%) 113ms (± 1.30%) ~ 111ms 115ms p=0.805 n=6
Req 4 - navto 359ms (± 0.33%) 358ms (± 0.49%) ~ 357ms 361ms p=0.564 n=6
Req 5 - completionInfo count 2,864 (± 0.00%) 2,864 (± 0.00%) ~ 2,864 2,864 p=1.000 n=6
Req 5 - completionInfo 373ms (± 2.82%) 378ms (± 2.41%) ~ 364ms 387ms p=0.332 n=6
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,647ms (± 0.34%) 2,678ms (± 0.28%) +31ms (+ 1.16%) 2,668ms 2,688ms p=0.005 n=6
Req 2 - geterr 6,019ms (± 0.56%) 6,022ms (± 0.52%) ~ 5,994ms 6,079ms p=1.000 n=6
Req 3 - references 352ms (± 0.90%) 353ms (± 0.47%) ~ 350ms 355ms p=0.515 n=6
Req 4 - navto 286ms (± 0.91%) 288ms (± 1.41%) ~ 285ms 296ms p=0.257 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 92ms (± 2.73%) 92ms (± 1.31%) ~ 91ms 94ms p=0.934 n=6
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 2,826ms (± 0.24%) 2,831ms (± 0.31%) ~ 2,821ms 2,844ms p=0.297 n=6
Req 2 - geterr 4,658ms (± 0.32%) 4,670ms (± 0.65%) ~ 4,632ms 4,718ms p=0.471 n=6
Req 3 - references 364ms (± 0.28%) 365ms (± 0.44%) ~ 362ms 366ms p=0.138 n=6
Req 4 - navto 283ms (± 0.91%) 283ms (± 0.80%) ~ 279ms 285ms p=0.868 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 68ms (± 1.24%) 67ms (± 0.61%) ~ 66ms 67ms p=0.115 n=6
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 3,219ms (± 0.12%) 3,233ms (± 0.29%) +14ms (+ 0.43%) 3,225ms 3,249ms p=0.005 n=6
Req 2 - geterr 1,720ms (± 0.56%) 1,718ms (± 0.52%) ~ 1,705ms 1,729ms p=0.689 n=6
Req 3 - references 122ms (± 1.41%) 123ms (± 0.42%) ~ 123ms 124ms p=0.142 n=6
Req 4 - navto 344ms (± 1.24%) 343ms (± 0.72%) ~ 340ms 346ms p=0.570 n=6
Req 5 - completionInfo count 2,864 (± 0.00%) 2,864 (± 0.00%) ~ 2,864 2,864 p=1.000 n=6
Req 5 - completionInfo 410ms (± 2.01%) 413ms (± 1.08%) ~ 405ms 417ms p=0.260 n=6
Compiler-UnionsTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,779ms (± 0.32%) 2,790ms (± 0.53%) ~ 2,761ms 2,800ms p=0.066 n=6
Req 2 - geterr 6,157ms (± 0.34%) 6,226ms (± 1.39%) +69ms (+ 1.11%) 6,158ms 6,395ms p=0.031 n=6
Req 3 - references 362ms (± 0.44%) 362ms (± 0.78%) ~ 358ms 366ms p=1.000 n=6
Req 4 - navto 288ms (± 0.36%) 289ms (± 0.31%) ~ 288ms 290ms p=0.054 n=6
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) ~ 1,356 1,356 p=1.000 n=6
Req 5 - completionInfo 100ms (± 2.96%) 102ms (± 2.39%) ~ 98ms 104ms p=0.373 n=6
CompilerTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 2,974ms (± 0.63%) 2,978ms (± 0.49%) ~ 2,966ms 3,007ms p=0.378 n=6
Req 2 - geterr 4,566ms (± 0.79%) 4,548ms (± 0.71%) ~ 4,517ms 4,599ms p=0.470 n=6
Req 3 - references 371ms (± 0.31%) 372ms (± 0.52%) ~ 369ms 374ms p=0.410 n=6
Req 4 - navto 297ms (± 0.25%) 299ms (± 0.28%) +1ms (+ 0.45%) 298ms 300ms p=0.020 n=6
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) ~ 1,518 1,518 p=1.000 n=6
Req 5 - completionInfo 77ms (± 0.72%) 76ms (± 1.07%) ~ 75ms 77ms p=0.859 n=6
xstateTSServer - node (v14.21.3, x64)
Req 1 - updateOpen 3,480ms (± 0.60%) 3,445ms (± 1.33%) ~ 3,384ms 3,498ms p=0.298 n=6
Req 2 - geterr 1,843ms (± 0.26%) 1,847ms (± 0.83%) ~ 1,833ms 1,875ms p=1.000 n=6
Req 3 - references 157ms (± 5.85%) 152ms (± 7.13%) ~ 136ms 161ms p=0.221 n=6
Req 4 - navto 408ms (± 1.31%) 408ms (± 1.93%) ~ 400ms 419ms p=1.000 n=6
Req 5 - completionInfo count 2,864 (± 0.00%) 2,864 (± 0.00%) ~ 2,864 2,864 p=1.000 n=6
Req 5 - completionInfo 435ms (± 0.75%) 434ms (± 3.22%) ~ 417ms 451ms p=0.574 n=6
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.21.3, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.21.3, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.21.3, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.21.3, x64)
Benchmark Name Iterations
Current 54659 6
Baseline main 6

Startup

Comparison Report - main..54659
Metric main 54659 Delta Best Worst p-value
tsc-startup - node (v16.17.1, x64)
Execution time 141.16ms (± 0.17%) 144.30ms (± 0.49%) +3.14ms (+ 2.22%) 141.52ms 149.37ms p=0.000 n=600
tsserver-startup - node (v16.17.1, x64)
Execution time 220.25ms (± 0.18%) 224.22ms (± 0.51%) +3.97ms (+ 1.80%) 220.48ms 230.43ms p=0.000 n=600
tsserverlibrary-startup - node (v16.17.1, x64)
Execution time 221.57ms (± 0.15%) 226.76ms (± 0.22%) +5.19ms (+ 2.34%) 222.74ms 233.85ms p=0.000 n=600
typescript-startup - node (v16.17.1, x64)
Execution time 203.47ms (± 0.16%) 206.85ms (± 0.38%) +3.38ms (+ 1.66%) 203.77ms 213.42ms p=0.000 n=600
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-148-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v16.17.1, x64)
Scenarios
  • tsc-startup - node (v16.17.1, x64)
  • tsserver-startup - node (v16.17.1, x64)
  • tsserverlibrary-startup - node (v16.17.1, x64)
  • typescript-startup - node (v16.17.1, x64)
Benchmark Name Iterations
Current 54659 6
Baseline main 6

Developer Information:

Download Benchmark

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the top-repos suite comparing main and refs/pull/54659/merge:

Everything looks good!

1 similar comment
@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the top-repos suite comparing main and refs/pull/54659/merge:

Everything looks good!

@@ -455,7 +456,8 @@ function getModuleInstanceStateForAliasTarget(specifier: ExportSpecifier, visite
return ModuleInstanceState.Instantiated; // Couldn't locate, assume could refer to a value
}

const enum ContainerFlags {
/** @internal */
export const enum ContainerFlags {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not experienced enough to know the right way to do this, but it does feel a little suspicious to export... I feel like I've seen a function that does something similar in the checker but I can't recall the name.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to make sure the container used to check the implicit export rules is precisely the same the binder uses, and the binder uses those flags for that... I saw a getContainerNode in services/utilities, and getEnclosingBlockScopeContainer in compiler/utilities, but those are different.

@andrewbranch andrewbranch added the Breaking Change Would introduce errors in existing code label Jun 22, 2023
@gabritto gabritto merged commit 49deff2 into main Jun 22, 2023
17 checks passed
@gabritto gabritto deleted the gabritto/issue54342 branch June 22, 2023 19:27
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 5.2.0 milestone Jun 29, 2023
@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jun 29, 2023

For me or anyone else in the future: the export default feels like a red herring, so I'll just mention that

declare module 'replace-in-file' {
    export function replaceInFile(config: unknown): Promise<unknown[]>;
    export {};

    namespace replaceInFile {
        export function sync(config: unknown): unknown[];
  }
}

introduces the same issue.

In an ambient module, adding an export { ... } or a similar construct like export default ... implicitly changes whether all declarations are automatically exported.

TypeScript now recognizes these unfortunately confusing semantics more consistently, and issues an error on the fact that all declarations of replaceInFile need to agree in their modifiers.

In the case where there is no export {} or export default, there is no error because everything is implicitly exported anyway.

declare module 'replace-in-file' {
    export function replaceInFile(config: unknown): Promise<unknown[]>;

    namespace replaceInFile {
        export function sync(config: unknown): unknown[];
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team Breaking Change Would introduce errors in existing code For Backlog Bug PRs that fix a backlog bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default imported function merged with namespace cannot be called (has no call signatures)
5 participants