Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Computed names in declarations files are resolved even when non-literal, preserve computed names when expressions are entity names#60052

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

weswigham
Copy link
Member

This PR basically removes the grammar error requiring computed names in declaration files/other contexts resolve to literal types, and allows them to resolve to whatever so long as they're an entity name expression (a.b.c), and endeavors in declaration emit to preserve those input computed names that imply index signatures wherever possible. This clears the way forisolatedDeclarations to allowalways emitting a computed property name on the output for a computed property name on the input, so long as the expression is an entity name expression.

ExE-Boss and franca6 reacted with thumbs up emojiExE-Boss reacted with hooray emojidragomirtitian, robpalme, ericrafalovsky, MichaelMitchell-at, ExE-Boss, and franca6 reacted with heart emojiExE-Boss reacted with rocket emojialex-page reacted with eyes emoji
@typescript-bottypescript-bot added Author: Team For Uncommitted BugPR for untriaged, rejected, closed or missing bug labelsSep 24, 2024
@weswigham
Copy link
MemberAuthor

@typescript-bot test it

typescript-bot reacted with thumbs up emoji

@typescript-bot
Copy link
Collaborator

typescript-bot commentedSep 24, 2024
edited
Loading

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

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

@typescript-bot
Copy link
Collaborator

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document themon our wiki's API Breaking Changes page.

Also, please make sure@DanielRosenwasser and@RyanCavanaugh are aware of the changes, just as a heads up.

@typescript-bot
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the user tests with tsc comparingmain andrefs/pull/60052/merge:

Something interesting changed - please have a look.

Details

effect

tsconfig.json

tsconfig.base.json

packages/schema/dtslint/tsconfig.json

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,34062,340~~~p=1.000 n=6
Types50,37850,378~~~p=1.000 n=6
Memory used193,214k (± 0.82%)195,011k (± 0.98%)~192,422k196,310kp=0.298 n=6
Parse Time1.93s (± 0.89%)1.96s (± 0.42%)+0.03s (+ 1.64%)1.95s1.97sp=0.006 n=6
Bind Time1.05s (± 0.79%)1.07s (± 0.98%)~1.05s1.08sp=0.122 n=6
Check Time13.98s (± 0.48%)13.97s (± 0.27%)~13.91s14.00sp=0.872 n=6
Emit Time4.09s (± 4.96%)4.04s (± 3.26%)~3.97s4.31sp=0.572 n=6
Total Time21.05s (± 0.79%)21.03s (± 0.54%)~20.94s21.25sp=0.686 n=6
angular-1 - node (v18.15.0, x64)
Errors77~~~p=1.000 n=6
Symbols947,102947,102~~~p=1.000 n=6
Types410,738410,738~~~p=1.000 n=6
Memory used1,224,040k (± 0.00%)1,224,060k (± 0.00%)~1,224,033k1,224,144kp=0.689 n=6
Parse Time6.62s (± 0.57%)6.61s (± 0.67%)~6.56s6.69sp=0.688 n=6
Bind Time1.87s (± 0.22%)1.87s (± 0.40%)~1.86s1.88sp=1.000 n=6
Check Time31.30s (± 0.25%)31.41s (± 0.34%)~31.27s31.56sp=0.064 n=6
Emit Time15.05s (± 0.41%)15.03s (± 0.28%)~14.98s15.07sp=0.288 n=6
Total Time54.84s (± 0.25%)54.93s (± 0.31%)~54.68s55.14sp=0.378 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,521,6512,521,652+1 (+ 0.00%)~~p=0.001 n=6
Types936,037936,038+1 (+ 0.00%)~~p=0.001 n=6
Memory used2,351,731k (± 0.00%)2,351,955k (± 0.00%)+224k (+ 0.01%)2,351,914k2,351,986kp=0.005 n=6
Parse Time9.29s (± 0.33%)9.29s (± 0.22%)~9.26s9.32sp=0.871 n=6
Bind Time2.14s (± 0.35%)2.14s (± 0.55%)~2.12s2.15sp=0.933 n=6
Check Time73.26s (± 0.29%)73.48s (± 0.76%)~73.00s74.46sp=0.689 n=6
Emit Time0.28s (± 3.19%)0.27s (± 3.31%)~0.26s0.28sp=0.113 n=6
Total Time84.97s (± 0.27%)85.17s (± 0.66%)~84.68s86.18sp=0.688 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,250,0561,250,396+340 (+ 0.03%)~~p=0.001 n=6
Types264,970265,020+50 (+ 0.02%)~~p=0.001 n=6
Memory used2,404,455k (± 0.03%)2,405,163k (± 0.03%)+708k (+ 0.03%)2,404,332k2,405,839kp=0.045 n=6
Parse Time5.12s (± 0.51%)5.12s (± 0.43%)~5.08s5.14sp=1.000 n=6
Bind Time1.90s (± 0.47%)1.91s (± 0.39%)~1.90s1.92sp=0.149 n=6
Check Time34.91s (± 0.30%)34.95s (± 0.37%)~34.70s35.07sp=0.422 n=6
Emit Time3.02s (± 3.84%)2.99s (± 0.89%)~2.95s3.03sp=0.748 n=6
Total Time44.97s (± 0.45%)44.98s (± 0.33%)~44.70s45.11sp=0.298 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,250,0561,250,396+340 (+ 0.03%)~~p=0.001 n=6
Types264,970265,020+50 (+ 0.02%)~~p=0.001 n=6
Memory used2,478,660k (± 0.02%)2,479,162k (± 0.02%)~2,478,578k2,480,282kp=0.093 n=6
Parse Time6.37s (± 0.30%)6.35s (± 0.94%)~6.25s6.41sp=1.000 n=6
Bind Time2.05s (± 0.57%)2.06s (± 0.60%)~2.04s2.07sp=0.625 n=6
Check Time41.61s (± 0.92%)41.82s (± 0.83%)~41.44s42.19sp=0.298 n=6
Emit Time3.58s (± 1.28%)3.67s (± 3.57%)~3.51s3.85sp=0.173 n=6
Total Time53.63s (± 0.71%)53.92s (± 0.58%)~53.50s54.21sp=0.128 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols260,936261,221+285 (+ 0.11%)~~p=0.001 n=6
Types106,385106,435+50 (+ 0.05%)~~p=0.001 n=6
Memory used436,588k (± 0.03%)436,904k (± 0.01%)+316k (+ 0.07%)436,835k436,951kp=0.005 n=6
Parse Time2.85s (± 0.31%)2.86s (± 0.97%)~2.83s2.90sp=0.683 n=6
Bind Time1.08s (± 1.43%)1.07s (± 1.40%)~1.06s1.09sp=0.423 n=6
Check Time15.37s (± 0.35%)15.46s (± 0.25%)+0.09s (+ 0.56%)15.39s15.51sp=0.020 n=6
Emit Time1.28s (± 1.45%)1.29s (± 1.61%)~1.26s1.32sp=0.744 n=6
Total Time20.58s (± 0.30%)20.68s (± 0.36%)~20.56s20.75sp=0.065 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors6868~~~p=1.000 n=6
Symbols225,916225,916~~~p=1.000 n=6
Types94,41494,414~~~p=1.000 n=6
Memory used370,841k (± 0.02%)370,962k (± 0.02%)+121k (+ 0.03%)370,873k371,066kp=0.013 n=6
Parse Time2.76s (± 1.24%)2.79s (± 0.67%)~2.76s2.81sp=0.259 n=6
Bind Time1.57s (± 1.38%)1.58s (± 1.06%)~1.56s1.60sp=0.463 n=6
Check Time15.78s (± 0.40%)15.77s (± 0.22%)~15.73s15.82sp=0.467 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.11s (± 0.44%)20.14s (± 0.12%)~20.12s20.18sp=0.872 n=6
vscode - node (v18.15.0, x64)
Errors11~~~p=1.000 n=6
Symbols3,099,7753,099,775~~~p=1.000 n=6
Types1,068,9731,068,973~~~p=1.000 n=6
Memory used3,196,811k (± 0.00%)3,197,123k (± 0.00%)+312k (+ 0.01%)3,197,050k3,197,255kp=0.005 n=6
Parse Time17.20s (± 0.22%)17.23s (± 0.41%)~17.17s17.37sp=0.332 n=6
Bind Time5.42s (± 2.44%)5.39s (± 2.61%)~5.27s5.58sp=0.936 n=6
Check Time100.10s (± 0.42%)100.11s (± 0.39%)~99.73s100.78sp=1.000 n=6
Emit Time27.43s (± 0.72%)27.45s (± 0.48%)~27.31s27.67sp=0.689 n=6
Total Time150.15s (± 0.33%)150.18s (± 0.39%)~149.55s151.03sp=0.689 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols278,920278,920~~~p=1.000 n=6
Types113,837113,837~~~p=1.000 n=6
Memory used428,349k (± 0.02%)428,371k (± 0.02%)~428,277k428,542kp=0.936 n=6
Parse Time3.95s (± 0.44%)3.94s (± 0.31%)~3.93s3.96sp=0.622 n=6
Bind Time1.72s (± 0.52%)1.72s (± 0.57%)~1.71s1.73sp=0.798 n=6
Check Time17.69s (± 0.24%)17.61s (± 0.39%)~17.54s17.72sp=0.065 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time23.36s (± 0.18%)23.28s (± 0.32%)~23.19s23.39sp=0.073 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols540,027540,027~~~p=1.000 n=6
Types181,292181,292~~~p=1.000 n=6
Memory used483,548k (± 0.01%)483,586k (± 0.01%)~483,525k483,677kp=0.298 n=6
Parse Time4.02s (± 0.52%)4.01s (± 0.37%)~3.99s4.03sp=0.514 n=6
Bind Time1.42s (± 1.45%)1.43s (± 0.53%)~1.42s1.44sp=0.935 n=6
Check Time22.90s (± 0.55%)22.91s (± 0.36%)~22.79s23.04sp=0.873 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time28.35s (± 0.43%)28.35s (± 0.29%)~28.25s28.50sp=1.000 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the top 400 repos with tsc comparingmain andrefs/pull/60052/merge:

Something interesting changed - please have a look.

Details

alibaba/lowcode-engine

40 of 42 projects failed to build with the old tsc and were ignored

modules/code-generator/tsconfig.json

FormidableLabs/victory

9 of 63 projects failed to build with the old tsc and were ignored

packages/victory-axis/tsconfig.json

packages/victory-axis/tsconfig.build.json

tinacms/tinacms

13 of 25 projects failed to build with the old tsc and were ignored

packages/@tinacms/schema-tools/tsconfig.json

packages/@tinacms/graphql/tsconfig.json

packages/@tinacms/cli/tsconfig.json

tusen-ai/naive-ui

3 of 6 projects failed to build with the old tsc and were ignored

src/tsconfig.demo.json

vuetifyjs/vuetify

3 of 7 projects failed to build with the old tsc and were ignored

packages/vuetify/tsconfig.json

packages/vuetify/tsconfig.dist.json

packages/vuetify/tsconfig.checks.json

@MichaelMitchell-at
Copy link
Contributor

MichaelMitchell-at commentedSep 25, 2024
edited
Loading

Amazing! Has the team already discussed the intent to ship this feature or is this only an experiment? Asking because I'm wondering ifhttps://github.com/oxc-project/oxc/tree/main/crates/oxc_isolated_declarations could bypass the need to implement something like#58771 (oxc-project/oxc#4016) and implement the behavior in this PR directly.

@weswigham
Copy link
MemberAuthor

You can't ship this before we do because it produces declaration files that can't be correctly read by current versions of TS 😉

MichaelMitchell-at reacted with eyes emoji

@weswighamweswighamforce-pushed thecomputed-names-in-declarations-files-are-resolved branch from7fec56c to22c5c89CompareOctober 1, 2024 17:31
@weswighamweswighamforce-pushed thecomputed-names-in-declarations-files-are-resolved branch fromf1fcd56 to587f9e0CompareOctober 1, 2024 17:58
@weswigham
Copy link
MemberAuthor

@typescript-bot test it

typescript-bot reacted with thumbs up emoji

@typescript-bot
Copy link
Collaborator

typescript-bot commentedOct 1, 2024
edited
Loading

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

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

@typescript-bot
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the user tests with tsc comparingmain andrefs/pull/60052/merge:

Something interesting changed - please have a look.

Details

effect

tsconfig.json

tsconfig.base.json

packages/schema/dtslint/tsconfig.json

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3131~~~p=1.000 n=6
Symbols62,34062,340~~~p=1.000 n=6
Types50,37950,379~~~p=1.000 n=6
Memory used193,378k (± 0.73%)192,924k (± 0.09%)~192,779k193,152kp=0.471 n=6
Parse Time1.31s (± 0.57%)1.31s (± 0.57%)~1.30s1.32sp=1.000 n=6
Bind Time0.72s0.72s~~~p=1.000 n=6
Check Time9.75s (± 0.53%)9.74s (± 0.25%)~9.71s9.78sp=0.872 n=6
Emit Time2.72s (± 0.59%)2.73s (± 0.51%)~2.70s2.74sp=0.315 n=6
Total Time14.50s (± 0.35%)14.50s (± 0.18%)~14.46s14.53sp=1.000 n=6
angular-1 - node (v18.15.0, x64)
Errors3333~~~p=1.000 n=6
Symbols947,886947,886~~~p=1.000 n=6
Types410,840410,840~~~p=1.000 n=6
Memory used1,224,800k (± 0.01%)1,224,879k (± 0.00%)+78k (+ 0.01%)1,224,780k1,224,952kp=0.031 n=6
Parse Time8.05s (± 0.83%)8.06s (± 0.86%)~7.97s8.16sp=0.810 n=6
Bind Time2.26s (± 0.72%)2.27s (± 1.24%)~2.24s2.32sp=0.739 n=6
Check Time37.72s (± 0.43%)37.62s (± 0.41%)~37.39s37.79sp=0.296 n=6
Emit Time18.08s (± 0.82%)18.17s (± 0.42%)~18.09s18.25sp=0.468 n=6
Total Time66.11s (± 0.24%)66.11s (± 0.22%)~65.89s66.27sp=0.873 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,522,0382,522,038~~~p=1.000 n=6
Types936,053936,053~~~p=1.000 n=6
Memory used2,352,501k (± 0.00%)2,352,657k (± 0.00%)+156k (+ 0.01%)2,352,576k2,352,706kp=0.005 n=6
Parse Time9.37s (± 0.23%)9.33s (± 0.25%)-0.04s (- 0.46%)9.29s9.36sp=0.014 n=6
Bind Time2.16s (± 0.24%)2.16s (± 0.29%)~2.15s2.17sp=0.386 n=6
Check Time75.87s (± 0.27%)75.65s (± 0.17%)~75.49s75.79sp=0.066 n=6
Emit Time0.28s (± 2.95%)0.28s (± 2.26%)~0.27s0.29sp=0.432 n=6
Total Time87.67s (± 0.23%)87.41s (± 0.15%)~87.26s87.54sp=0.066 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,258,1061,258,459+353 (+ 0.03%)~~p=0.001 n=6
Types266,266266,354+88 (+ 0.03%)~~p=0.001 n=6
Memory used3,146,790k (± 0.03%)3,146,909k (± 0.02%)~3,146,389k3,147,720kp=1.000 n=6
Parse Time6.59s (± 0.55%)6.59s (± 0.54%)~6.54s6.63sp=0.810 n=6
Bind Time2.35s (± 0.73%)2.34s (± 1.82%)~2.28s2.41sp=0.468 n=6
Check Time43.00s (± 0.25%)43.08s (± 0.33%)~42.86s43.28sp=0.378 n=6
Emit Time3.51s (± 2.00%)3.52s (± 1.40%)~3.45s3.60sp=0.936 n=6
Total Time55.45s (± 0.31%)55.54s (± 0.31%)~55.27s55.79sp=0.471 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,258,1061,258,459+353 (+ 0.03%)~~p=0.001 n=6
Types266,266266,354+88 (+ 0.03%)~~p=0.001 n=6
Memory used2,496,029k (± 0.01%)2,496,975k (± 0.01%)+946k (+ 0.04%)2,496,399k2,497,391kp=0.008 n=6
Parse Time5.41s (± 0.54%)5.37s (± 1.00%)~5.32s5.47sp=0.107 n=6
Bind Time1.74s (± 0.48%)1.74s (± 0.32%)~1.73s1.74sp=0.855 n=6
Check Time35.83s (± 0.20%)35.82s (± 0.16%)~35.75s35.92sp=0.810 n=6
Emit Time3.05s (± 1.10%)3.05s (± 2.13%)~2.93s3.12sp=1.000 n=6
Total Time46.03s (± 0.21%)45.98s (± 0.27%)~45.91s46.23sp=0.378 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols261,785262,083+298 (+ 0.11%)~~p=0.001 n=6
Types106,508106,596+88 (+ 0.08%)~~p=0.001 n=6
Memory used438,475k (± 0.01%)438,838k (± 0.01%)+363k (+ 0.08%)438,803k438,875kp=0.005 n=6
Parse Time2.90s (± 0.42%)2.88s (± 0.42%)~2.87s2.90sp=0.138 n=6
Bind Time1.10s1.10s~~~p=1.000 n=6
Check Time15.71s (± 0.25%)15.72s (± 0.27%)~15.66s15.78sp=0.809 n=6
Emit Time1.31s (± 1.31%)1.32s (± 0.96%)~1.31s1.34sp=0.359 n=6
Total Time21.02s (± 0.22%)21.03s (± 0.19%)~20.98s21.07sp=0.809 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors6868~~~p=1.000 n=6
Symbols225,919225,919~~~p=1.000 n=6
Types94,41594,415~~~p=1.000 n=6
Memory used371,091k (± 0.02%)371,081k (± 0.01%)~371,048k371,129kp=0.575 n=6
Parse Time2.88s (± 1.13%)2.90s (± 0.55%)~2.89s2.93sp=0.224 n=6
Bind Time1.60s (± 1.84%)1.58s (± 0.89%)~1.56s1.60sp=0.258 n=6
Check Time16.32s (± 0.24%)16.30s (± 0.28%)~16.25s16.38sp=0.573 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.80s (± 0.37%)20.79s (± 0.20%)~20.74s20.85sp=1.000 n=6
vscode - node (v18.15.0, x64)
Errors33~~~p=1.000 n=6
Symbols3,110,2993,110,299~~~p=1.000 n=6
Types1,072,1791,072,179~~~p=1.000 n=6
Memory used3,202,479k (± 0.01%)3,203,049k (± 0.00%)+570k (+ 0.02%)3,202,916k3,203,338kp=0.005 n=6
Parse Time14.02s (± 0.33%)14.02s (± 0.45%)~13.94s14.09sp=0.872 n=6
Bind Time4.44s (± 0.44%)4.43s (± 0.24%)~4.42s4.45sp=0.871 n=6
Check Time85.29s (± 1.42%)86.61s (± 3.30%)~84.75s92.09sp=0.575 n=6
Emit Time24.92s (± 9.42%)24.08s (± 9.10%)~22.53s26.93sp=0.377 n=6
Total Time128.67s (± 2.09%)129.14s (± 2.74%)~125.83s133.40sp=0.936 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols279,484279,484~~~p=1.000 n=6
Types114,024114,024~~~p=1.000 n=6
Memory used429,365k (± 0.03%)429,460k (± 0.04%)~429,295k429,739kp=0.230 n=6
Parse Time5.02s (± 0.98%)5.06s (± 0.44%)~5.04s5.10sp=0.225 n=6
Bind Time2.14s (± 1.56%)2.15s (± 1.28%)~2.12s2.19sp=0.746 n=6
Check Time22.47s (± 0.56%)22.48s (± 0.54%)~22.35s22.63sp=0.936 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time29.64s (± 0.30%)29.70s (± 0.42%)~29.53s29.85sp=0.572 n=6
xstate-main - node (v18.15.0, x64)
Errors33~~~p=1.000 n=6
Symbols540,560540,560~~~p=1.000 n=6
Types181,448181,448~~~p=1.000 n=6
Memory used484,360k (± 0.01%)484,386k (± 0.01%)~484,284k484,461kp=0.298 n=6
Parse Time3.36s (± 0.72%)3.37s (± 0.56%)~3.34s3.39sp=0.571 n=6
Bind Time1.18s (± 0.89%)1.18s (± 1.16%)~1.16s1.19sp=0.804 n=6
Check Time19.12s (± 0.40%)19.04s (± 0.27%)~18.97s19.10sp=0.091 n=6
Emit Time0.00s (±244.70%)0.00s~~~p=0.405 n=6
Total Time23.66s (± 0.25%)23.59s (± 0.22%)~23.51s23.65sp=0.125 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@weswigham
Copy link
MemberAuthor

@typescript-bot test it

typescript-bot reacted with thumbs up emoji

@typescript-bot
Copy link
Collaborator

typescript-bot commentedOct 1, 2024
edited
Loading

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

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

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the user tests with tsc comparingmain andrefs/pull/60052/merge:

Something interesting changed - please have a look.

Details

effect

tsconfig.json

tsconfig.base.json

packages/schema/dtslint/tsconfig.json

@typescript-bot
Copy link
Collaborator

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

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3131~~~p=1.000 n=6
Symbols62,34062,340~~~p=1.000 n=6
Types50,37950,379~~~p=1.000 n=6
Memory used194,035k (± 0.98%)193,440k (± 0.74%)~192,753k196,365kp=0.575 n=6
Parse Time1.32s (± 0.48%)1.30s (± 0.97%)-0.02s (- 1.52%)1.29s1.32sp=0.019 n=6
Bind Time0.72s0.72s~~~p=1.000 n=6
Check Time9.73s (± 0.28%)9.73s (± 0.26%)~9.69s9.77sp=0.566 n=6
Emit Time2.73s (± 0.59%)2.71s (± 1.15%)~2.66s2.75sp=0.191 n=6
Total Time14.50s (± 0.31%)14.46s (± 0.27%)~14.41s14.50sp=0.125 n=6
angular-1 - node (v18.15.0, x64)
Errors3333~~~p=1.000 n=6
Symbols947,886947,886~~~p=1.000 n=6
Types410,840410,840~~~p=1.000 n=6
Memory used1,224,561k (± 0.00%)1,224,687k (± 0.00%)+126k (+ 0.01%)1,224,644k1,224,743kp=0.005 n=6
Parse Time6.66s (± 0.89%)6.63s (± 0.83%)~6.55s6.69sp=0.514 n=6
Bind Time1.89s (± 0.44%)1.88s (± 0.29%)~1.88s1.89sp=0.855 n=6
Check Time31.81s (± 0.38%)31.86s (± 0.15%)~31.77s31.91sp=0.377 n=6
Emit Time15.21s (± 0.88%)15.18s (± 0.40%)~15.10s15.26sp=1.000 n=6
Total Time55.56s (± 0.45%)55.56s (± 0.17%)~55.40s55.65sp=0.575 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,522,0382,522,038~~~p=1.000 n=6
Types936,053936,053~~~p=1.000 n=6
Memory used2,352,496k (± 0.00%)2,352,669k (± 0.00%)+173k (+ 0.01%)2,352,612k2,352,740kp=0.005 n=6
Parse Time9.37s (± 0.55%)9.35s (± 0.30%)~9.30s9.37sp=0.517 n=6
Bind Time2.17s (± 0.41%)2.16s (± 0.65%)~2.14s2.18sp=0.215 n=6
Check Time76.04s (± 0.38%)76.14s (± 0.26%)~75.79s76.35sp=0.575 n=6
Emit Time0.28s0.28s (± 1.47%)~0.27s0.28sp=0.405 n=6
Total Time87.86s (± 0.36%)87.92s (± 0.23%)~87.57s88.17sp=0.575 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,258,1061,258,500+394 (+ 0.03%)~~p=0.001 n=6
Types266,266266,376+110 (+ 0.04%)~~p=0.001 n=6
Memory used2,422,532k (± 0.01%)2,423,377k (± 0.02%)+845k (+ 0.03%)2,423,035k2,424,182kp=0.005 n=6
Parse Time5.20s (± 0.89%)5.20s (± 0.76%)~5.14s5.24sp=0.748 n=6
Bind Time1.93s (± 0.39%)1.93s (± 0.72%)~1.91s1.94sp=0.740 n=6
Check Time35.52s (± 0.28%)35.37s (± 0.34%)~35.21s35.52sp=0.054 n=6
Emit Time3.01s (± 1.85%)3.02s (± 0.71%)~2.98s3.04sp=1.000 n=6
Total Time45.68s (± 0.15%)45.52s (± 0.26%)-0.16s (- 0.34%)45.35s45.64sp=0.020 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,258,1061,258,500+394 (+ 0.03%)~~p=0.001 n=6
Types266,266266,376+110 (+ 0.04%)~~p=0.001 n=6
Memory used2,859,100k (±13.77%)2,766,705k (±12.90%)~2,499,732k3,222,096kp=0.689 n=6
Parse Time6.72s (± 2.99%)6.63s (± 2.17%)~6.47s6.89sp=0.748 n=6
Bind Time2.14s (± 1.99%)2.19s (± 3.98%)~2.11s2.36sp=0.336 n=6
Check Time43.19s (± 0.48%)43.07s (± 0.40%)~42.81s43.33sp=0.471 n=6
Emit Time3.57s (± 2.43%)3.49s (± 1.70%)~3.41s3.59sp=0.173 n=6
Total Time55.63s (± 0.46%)55.39s (± 0.29%)~55.20s55.65sp=0.128 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols261,785262,124+339 (+ 0.13%)~~p=0.001 n=6
Types106,508106,618+110 (+ 0.10%)~~p=0.001 n=6
Memory used438,789k (± 0.01%)439,077k (± 0.01%)+288k (+ 0.07%)439,040k439,137kp=0.005 n=6
Parse Time3.54s (± 0.67%)3.54s (± 1.41%)~3.48s3.63sp=0.809 n=6
Bind Time1.31s (± 0.89%)1.32s (± 1.12%)~1.30s1.33sp=0.219 n=6
Check Time18.94s (± 0.42%)18.84s (± 0.36%)~18.72s18.92sp=0.064 n=6
Emit Time1.55s (± 1.27%)1.54s (± 1.26%)~1.52s1.57sp=0.466 n=6
Total Time25.33s (± 0.40%)25.24s (± 0.24%)~25.14s25.31sp=0.172 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors6868~~~p=1.000 n=6
Symbols225,919225,919~~~p=1.000 n=6
Types94,41594,415~~~p=1.000 n=6
Memory used371,077k (± 0.01%)371,092k (± 0.01%)~371,027k371,165kp=0.630 n=6
Parse Time3.59s (± 1.59%)3.62s (± 1.41%)~3.52s3.66sp=0.260 n=6
Bind Time1.96s (± 1.66%)1.96s (± 0.95%)~1.93s1.98sp=1.000 n=6
Check Time20.27s (± 0.28%)20.31s (± 0.32%)~20.24s20.41sp=0.145 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time25.82s (± 0.25%)25.88s (± 0.29%)~25.78s25.97sp=0.227 n=6
vscode - node (v18.15.0, x64)
Errors33~~~p=1.000 n=6
Symbols3,110,4593,110,459~~~p=1.000 n=6
Types1,072,2261,072,226~~~p=1.000 n=6
Memory used3,202,640k (± 0.01%)3,203,131k (± 0.00%)+491k (+ 0.02%)3,202,948k3,203,256kp=0.008 n=6
Parse Time14.10s (± 0.70%)14.00s (± 0.28%)~13.94s14.05sp=0.077 n=6
Bind Time4.44s (± 0.23%)4.43s (± 0.26%)~4.41s4.44sp=0.491 n=6
Check Time86.30s (± 1.71%)85.42s (± 1.41%)~84.13s87.72sp=0.173 n=6
Emit Time24.62s (± 8.98%)23.45s (± 7.52%)~22.60s27.04sp=0.471 n=6
Total Time129.44s (± 2.70%)127.31s (± 2.30%)~125.26s133.20sp=0.093 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols279,484279,484~~~p=1.000 n=6
Types114,024114,024~~~p=1.000 n=6
Memory used429,471k (± 0.03%)429,554k (± 0.02%)~429,430k429,687kp=0.230 n=6
Parse Time4.07s (± 0.36%)4.06s (± 0.93%)~3.99s4.09sp=0.806 n=6
Bind Time1.74s (± 0.63%)1.73s (± 1.69%)~1.69s1.78sp=0.319 n=6
Check Time18.11s (± 0.58%)18.21s (± 0.23%)~18.13s18.25sp=0.197 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time23.92s (± 0.41%)23.99s (± 0.29%)~23.90s24.08sp=0.199 n=6
xstate-main - node (v18.15.0, x64)
Errors33~~~p=1.000 n=6
Symbols540,560540,560~~~p=1.000 n=6
Types181,448181,448~~~p=1.000 n=6
Memory used484,316k (± 0.01%)484,365k (± 0.01%)~484,311k484,418kp=0.066 n=6
Parse Time3.35s (± 0.74%)3.35s (± 1.09%)~3.31s3.41sp=0.934 n=6
Bind Time1.17s (± 0.84%)1.18s (± 1.03%)~1.17s1.20sp=0.734 n=6
Check Time19.05s (± 0.28%)19.06s (± 0.39%)~18.99s19.18sp=0.872 n=6
Emit Time0.00s (±244.70%)0.00s~~~p=0.405 n=6
Total Time23.57s (± 0.26%)23.59s (± 0.29%)~23.48s23.67sp=0.689 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the top 400 repos with tsc comparingmain andrefs/pull/60052/merge:

Something interesting changed - please have a look.

Details

alibaba/lowcode-engine

40 of 42 projects failed to build with the old tsc and were ignored

modules/code-generator/tsconfig.json

1 similar comment
@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the top 400 repos with tsc comparingmain andrefs/pull/60052/merge:

Something interesting changed - please have a look.

Details

alibaba/lowcode-engine

40 of 42 projects failed to build with the old tsc and were ignored

modules/code-generator/tsconfig.json

@typescript-bot
Copy link
Collaborator

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

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3434~~~p=1.000 n=6
Symbols62,36362,363~~~p=1.000 n=6
Types50,39550,395~~~p=1.000 n=6
Memory used195,543k (± 0.93%)194,863k (± 1.04%)~192,999k196,767kp=0.336 n=6
Parse Time1.30s (± 0.94%)1.31s (± 0.92%)~1.29s1.32sp=0.300 n=6
Bind Time0.72s0.72s~~~p=1.000 n=6
Check Time9.79s (± 0.43%)9.80s (± 0.43%)~9.76s9.87sp=1.000 n=6
Emit Time2.73s (± 0.49%)2.73s (± 0.75%)~2.70s2.76sp=0.605 n=6
Total Time14.54s (± 0.32%)14.56s (± 0.36%)~14.50s14.64sp=0.747 n=6
angular-1 - node (v18.15.0, x64)
Errors3737~~~p=1.000 n=6
Symbols947,936947,936~~~p=1.000 n=6
Types410,955410,955~~~p=1.000 n=6
Memory used1,225,834k (± 0.00%)1,225,865k (± 0.00%)~1,225,827k1,225,927kp=0.471 n=6
Parse Time6.66s (± 0.61%)6.66s (± 0.67%)~6.59s6.71sp=0.872 n=6
Bind Time1.89s (± 0.33%)1.89s (± 0.27%)~1.88s1.89sp=0.386 n=6
Check Time32.05s (± 0.43%)31.97s (± 0.39%)~31.79s32.11sp=0.297 n=6
Emit Time15.17s (± 0.18%)15.19s (± 0.42%)~15.09s15.28sp=0.318 n=6
Total Time55.78s (± 0.29%)55.71s (± 0.20%)~55.56s55.84sp=0.378 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,501,8272,501,827~~~p=1.000 n=6
Types909,625909,625~~~p=1.000 n=6
Memory used2,319,533k (± 0.00%)2,319,775k (± 0.00%)+242k (+ 0.01%)2,319,672k2,319,971kp=0.005 n=6
Parse Time11.21s (± 0.48%)11.21s (± 0.73%)~11.08s11.32sp=1.000 n=6
Bind Time2.61s (± 0.58%)2.62s (± 0.74%)~2.60s2.65sp=0.408 n=6
Check Time91.22s (± 2.56%)90.44s (± 1.49%)~88.96s92.19sp=0.471 n=6
Emit Time0.35s (± 3.32%)0.35s (± 3.32%)~0.34s0.37sp=1.000 n=6
Total Time105.39s (± 2.18%)104.62s (± 1.25%)~103.17s106.37sp=0.575 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,3301,225,725+395 (+ 0.03%)~~p=0.001 n=6
Types266,569266,679+110 (+ 0.04%)~~p=0.001 n=6
Memory used3,084,924k (± 0.03%)2,842,889k (±13.22%)~2,356,448k3,085,999kp=0.810 n=6
Parse Time6.79s (± 0.77%)6.72s (± 1.14%)~6.61s6.82sp=0.298 n=6
Bind Time2.11s (± 1.57%)2.14s (± 0.42%)~2.13s2.15sp=0.065 n=6
Check Time42.81s (± 0.37%)42.70s (± 0.40%)~42.49s42.95sp=0.378 n=6
Emit Time3.44s (± 2.41%)3.57s (± 3.73%)~3.47s3.79sp=0.109 n=6
Total Time55.15s (± 0.39%)55.13s (± 0.44%)~54.80s55.43sp=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,3301,225,725+395 (+ 0.03%)~~p=0.001 n=6
Types266,569266,679+110 (+ 0.04%)~~p=0.001 n=6
Memory used2,421,934k (± 0.02%)2,422,995k (± 0.02%)+1,062k (+ 0.04%)2,422,352k2,423,695kp=0.013 n=6
Parse Time5.45s (± 1.18%)5.48s (± 1.01%)~5.41s5.56sp=0.336 n=6
Bind Time1.83s (± 0.67%)1.82s (± 0.41%)~1.81s1.83sp=0.929 n=6
Check Time35.26s (± 0.17%)35.30s (± 0.24%)~35.21s35.42sp=0.423 n=6
Emit Time3.02s (± 3.83%)3.01s (± 1.24%)~2.95s3.05sp=0.422 n=6
Total Time45.57s (± 0.47%)45.61s (± 0.16%)~45.53s45.73sp=0.092 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols262,269262,609+340 (+ 0.13%)~~p=0.001 n=6
Types106,628106,738+110 (+ 0.10%)~~p=0.001 n=6
Memory used439,863k (± 0.02%)440,355k (± 0.01%)+492k (+ 0.11%)440,275k440,440kp=0.005 n=6
Parse Time2.88s (± 0.72%)2.89s (± 0.44%)~2.88s2.91sp=0.867 n=6
Bind Time1.10s (± 0.37%)1.10s~~~p=0.405 n=6
Check Time15.78s (± 0.37%)15.76s (± 0.32%)~15.70s15.84sp=0.519 n=6
Emit Time1.30s (± 0.90%)1.31s (± 0.92%)~1.30s1.33sp=0.138 n=6
Total Time21.06s (± 0.38%)21.06s (± 0.32%)~20.99s21.17sp=0.936 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors7070~~~p=1.000 n=6
Symbols226,062226,062~~~p=1.000 n=6
Types94,48894,488~~~p=1.000 n=6
Memory used371,608k (± 0.01%)371,625k (± 0.01%)~371,574k371,648kp=0.575 n=6
Parse Time2.90s (± 0.98%)2.88s (± 1.17%)~2.84s2.92sp=0.333 n=6
Bind Time1.58s (± 0.66%)1.59s (± 1.19%)~1.56s1.62sp=0.549 n=6
Check Time16.49s (± 0.36%)16.47s (± 0.26%)~16.42s16.53sp=0.575 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.98s (± 0.32%)20.94s (± 0.29%)~20.85s21.03sp=0.294 n=6
vscode - node (v18.15.0, x64)
Errors33~~~p=1.000 n=6
Symbols3,197,9013,197,901~~~p=1.000 n=6
Types1,099,3311,099,331~~~p=1.000 n=6
Memory used3,271,892k (± 0.01%)3,271,915k (± 0.01%)~3,271,523k3,272,515kp=0.936 n=6
Parse Time14.16s (± 0.33%)14.17s (± 0.27%)~14.13s14.22sp=1.000 n=6
Bind Time4.54s (± 0.64%)4.52s (± 0.44%)~4.49s4.54sp=0.195 n=6
Check Time88.08s (± 2.16%)86.79s (± 0.57%)~86.18s87.42sp=0.575 n=6
Emit Time27.06s (± 7.58%)28.24s (± 2.44%)~27.26s28.84sp=0.173 n=6
Total Time133.84s (± 1.20%)133.71s (± 0.80%)~132.31s134.59sp=0.810 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols288,747288,747~~~p=1.000 n=6
Types117,158117,158~~~p=1.000 n=6
Memory used440,950k (± 0.02%)441,056k (± 0.02%)~440,907k441,165kp=0.093 n=6
Parse Time4.08s (± 0.94%)4.10s (± 1.27%)~4.02s4.16sp=0.871 n=6
Bind Time1.76s (± 0.91%)1.76s (± 1.63%)~1.72s1.79sp=0.627 n=6
Check Time18.85s (± 0.37%)18.79s (± 0.49%)~18.67s18.89sp=0.226 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time24.69s (± 0.27%)24.64s (± 0.66%)~24.41s24.84sp=0.748 n=6
xstate-main - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols552,389552,389~~~p=1.000 n=6
Types185,093185,093~~~p=1.000 n=6
Memory used492,432k (± 0.02%)492,546k (± 0.02%)~492,413k492,676kp=0.066 n=6
Parse Time3.42s (± 0.75%)3.41s (± 0.49%)~3.39s3.43sp=0.869 n=6
Bind Time1.18s (± 1.49%)1.17s (± 1.04%)~1.15s1.18sp=0.328 n=6
Check Time19.57s (± 1.12%)19.50s (± 0.35%)~19.39s19.58sp=0.809 n=6
Emit Time0.00s0.00s (±244.70%)~0.00s0.01sp=0.405 n=6
Total Time24.17s (± 0.86%)24.08s (± 0.32%)~23.98s24.17sp=0.423 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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@weswigham Here are the results of running the top 400 repos with tsc comparingmain andrefs/pull/60052/merge:

Everything looks good!

@weswighamweswigham marked this pull request as ready for reviewDecember 9, 2024 17:13
@dragomirtitian
Copy link
Contributor

Computed properties that have a computed name of a literal type seem to be duplicated when another computed property that is not a literal type is present:

// index.tsdeclareconstx:string;declareconsty:"y";exportclassTest{[x]=10;[y]=10;}// index.d.tsdeclareconstx:string;declareconsty:"y";exportdeclareclassTest{[x]:number;[y]:number;[y]:number;// ❌}export{};
weswigham reacted with thumbs up emoji

@jakebailey
Copy link
Member

Does this definitely fix#60818?

@weswigham
Copy link
MemberAuthor

Not intentionally, since it's onlya.b.c style names this PR special-cases to copy through to declaration emit, but the late bound index signature logic may be generic enough to at least remove the index error and make an indexer on the resulting type, rather than not and issuing an error. Though it'd obviously be better if the element access behaved more like the equivalent dotted name and produced a concrete property, which is what I'd say the "real fix" aughta be.

@typescript-bot pack this

typescript-bot reacted with thumbs up emoji

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 21, 2025
edited
Loading

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

CommandStatusResults
pack this✅ Started✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commentedJan 21, 2025
edited
Loading

Hey@weswigham, I've packed this intoan installable tgz. You can install it for testing by referencing it in yourpackage.json like so:

{    "devDependencies": {        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/164590/artifacts?artifactName=tgz&fileId=F6ABB72746FFE8FA00220E3BDB1DD1A1944C2317AEEF5C0C73BAC8C6962134A102&fileName=/typescript-5.8.0-insiders.20250121.tgz"    }}

and then runningnpm install.


There is also a playgroundfor this build and annpm module you can use via"typescript": "npm:@typescript-deploys/pr-build@5.8.0-pr-60052-36".;

@jakebailey
Copy link
Member

jakebailey commentedJan 21, 2025
edited
Loading

I think this does what it should, but what's our strategy for dealing with the fact that this PR will cause index expressions to be emitted in such a way that TS<5.8 will be unable to read them?

Is this break acceptable? I think it has to be, because we really want to do it, but it seems like we're going to have to be really clear in the blog post to people that the types may have to be downleveled somehow...

@DanielRosenwasser

Concretely, before:

declareclassBase1{[x:string]:()=>void;}

After:

declareletprop:string;declareclassBase1{[prop]:()=>void;}

@weswigham
Copy link
MemberAuthor

Is this break acceptable? I think it has to be, because we really want to do it, but it seems like we're going to have to be really clear in the blog post to people that the types may have to be downleveled somehow

Yeah. Wouldn't be the first time. It's also notable that while you do have to downlevel the declaration to inline the computed name's type to remove theA computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type. error in old versions of TS, it actually does still typecheck as expected despite the error in TS 5.7, thanks to the existing index signature work. So there's a tiny bit of versioning grace there, at least.

@RyanCavanaugh
Copy link
Member

What's the minimal input file that would cause a freshly-generated .d.ts file to not be readable by 5.7?

@jakebailey
Copy link
Member

In testing this, I think I found a bug:

letprop!:string;exportclassBase1{[x:string]:()=>void;[prop]!:()=>void;}exportclassBase2{[prop]!:()=>void;[x:string]:()=>void;}

Playground Link

The d.ts emit for this after the PR is:

exportdeclareclassBase1{[x:string]:()=>void;}exportdeclareclassBase2{[x:string]:()=>void;}

But, we can't know without type analysis that the computed property is safe to drop, and the emitter can't make that decision based on whether or not isolatedDeclarations is enabled (and those kinds of emitters would preserve both).

@weswigham
Copy link
MemberAuthor

What's the minimal input file that would cause a freshly-generated .d.ts file to not be readable by 5.7?

letprop!:string;exportclassBase1{[prop]!:()=>void;}

which will produce

declareprop:string;declareexportclassBase1{[prop]:()=>void;}

except itis readable in 5.7, where I introduced the new computed name index signature behavior for classes (but not earlier), it just has an error in the.d.ts (though will typecheck correctly).

In testing this, I think I found a bug:

A full ID emitter will be forced to retain all possibly-conflicting names, yeah. Which is fine, duplicate declarations basically merge. Where you can, removing dupes from the output is our expected behavior, though.

@weswighamweswigham merged commitcaf1aee intomicrosoft:mainJan 24, 2025
32 checks passed
@dragomirtitian
Copy link
Contributor

A full ID emitter will be forced to retain all possibly-conflicting names, yeah. Which is fine, duplicate declarations basically merge. Where you can, removing dupes from the output is our expected behavior, though.

Don't we want to keep declaration emit in sync to what an ID emitter could produce though? Because what I understand form this is that TS will remove the dupes while an ID emitter will not (since it needs type info to do so).

@jakebailey
Copy link
Member

Yes, that is why I am concerned; I do not think we should be removing them as we have previously said that we should have one emit that does the same as ID.

dragomirtitian, robpalme, and blickly reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@RyanCavanaughRyanCavanaughRyanCavanaugh approved these changes

@andrewbranchandrewbranchAwaiting requested review from andrewbranch

@sandersnsandersnAwaiting requested review from sandersn

Assignees

@weswighamweswigham

Labels
Author: TeamBreaking ChangeWould introduce errors in existing codeFor Uncommitted BugPR for untriaged, rejected, closed or missing bug
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@weswigham@typescript-bot@MichaelMitchell-at@dragomirtitian@jakebailey@RyanCavanaugh

[8]ページ先頭

©2009-2025 Movatter.jp