Skip to content

Conversation

@rbuckton
Copy link
Contributor

@rbucktonrbuckton commented Mar 25, 2020

This weakens the definition of PromiseLike to allow the value argument to be T | awaited T. This is necessary because PromiseLike represents any promise-like value that can be adopted by a native Promise. This includes Promise definitions that are not Promise/A+ compatible, such as JQuery's Deferred. As a result, the value argument may or not be recursively unwrapped depending on the implementation.

This is intended to work in conjunction with DefinitelyTyped/DefinitelyTyped#43337 to address errors in DefinitelyTyped and other projects following the introduction of awaited.

NOTE: this means that unlike with Promise, a PromiseLike<Promise<number>> will not be assignable to PromiseLike<number>, as the value may not be recursively unwrapped and therefore we cannot guarantee they are relatable.

@rbuckton
Copy link
ContributorAuthor

@typescript-bot perf test
@typescript-bot run dt
@typescript-bot test this
@typescript-bot user test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 25, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 25, 2020

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

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 25, 2020

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 25, 2020

Heya @rbuckton, I've started to run the parallelized community code test suite on this PR at ed49c32. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

@typescript-bot
Copy link
Collaborator

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

Here they are:

Comparison Report - master..37570

Metricmaster37570DeltaBestWorst
Angular - node (v10.16.3, x64)
Memory used327,768k (± 0.03%)327,148k (± 0.02%)-620k (- 0.19%)326,998k327,221k
Parse Time1.64s (± 0.35%)1.62s (± 0.62%)-0.02s (- 0.98%)1.60s1.64s
Bind Time0.89s (± 0.54%)0.89s (± 1.06%)+0.01s (+ 0.68%)0.87s0.91s
Check Time4.75s (± 0.38%)4.77s (± 0.45%)+0.02s (+ 0.38%)4.71s4.82s
Emit Time5.33s (± 0.59%)5.31s (± 0.65%)-0.03s (- 0.51%)5.25s5.39s
Total Time12.61s (± 0.35%)12.59s (± 0.46%)-0.02s (- 0.15%)12.51s12.75s
Monaco - node (v10.16.3, x64)
Memory used327,114k (± 0.01%)327,124k (± 0.01%)+10k (+ 0.00%)327,039k327,214k
Parse Time1.26s (± 0.58%)1.26s (± 0.39%)-0.00s (- 0.16%)1.25s1.27s
Bind Time0.77s (± 0.29%)0.77s (± 0.29%)0.00s ( 0.00%)0.77s0.78s
Check Time4.74s (± 0.32%)4.71s (± 0.37%)-0.02s (- 0.46%)4.67s4.75s
Emit Time2.94s (± 0.95%)2.93s (± 0.83%)-0.01s (- 0.24%)2.89s2.99s
Total Time9.71s (± 0.28%)9.68s (± 0.24%)-0.03s (- 0.31%)9.63s9.72s
TFS - node (v10.16.3, x64)
Memory used291,955k (± 0.02%)291,946k (± 0.02%)-9k (- 0.00%)291,823k292,021k
Parse Time0.95s (± 0.59%)0.95s (± 0.71%)-0.00s (- 0.11%)0.93s0.96s
Bind Time0.74s (± 0.83%)0.74s (± 1.00%)+0.00s (+ 0.27%)0.73s0.76s
Check Time4.27s (± 0.37%)4.26s (± 0.38%)-0.01s (- 0.35%)4.23s4.30s
Emit Time3.04s (± 0.84%)3.04s (± 0.49%)+0.00s (+ 0.13%)3.00s3.08s
Total Time9.00s (± 0.28%)8.99s (± 0.23%)-0.01s (- 0.12%)8.95s9.04s
material-ui - node (v10.16.3, x64)
Memory used452,923k (± 0.01%)452,617k (± 0.01%)-306k (- 0.07%)452,477k452,697k
Parse Time1.78s (± 0.47%)1.77s (± 0.44%)-0.01s (- 0.67%)1.75s1.78s
Bind Time0.68s (± 1.07%)0.68s (± 0.77%)-0.00s (- 0.44%)0.67s0.69s
Check Time13.73s (± 0.76%)13.70s (± 0.62%)-0.03s (- 0.23%)13.51s13.86s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time16.19s (± 0.67%)16.15s (± 0.52%)-0.04s (- 0.25%)15.96s16.30s
Angular - node (v12.1.0, x64)
Memory used303,503k (± 0.03%)302,988k (± 0.03%)-516k (- 0.17%)302,813k303,141k
Parse Time1.57s (± 0.48%)1.57s (± 0.43%)-0.01s (- 0.57%)1.55s1.58s
Bind Time0.87s (± 0.89%)0.86s (± 0.64%)-0.01s (- 1.03%)0.85s0.87s
Check Time4.65s (± 0.36%)4.64s (± 0.45%)-0.01s (- 0.28%)4.59s4.70s
Emit Time5.46s (± 0.50%)5.48s (± 0.93%)+0.02s (+ 0.27%)5.38s5.61s
Total Time12.56s (± 0.29%)12.55s (± 0.51%)-0.02s (- 0.12%)12.39s12.70s
Monaco - node (v12.1.0, x64)
Memory used307,074k (± 0.02%)307,064k (± 0.02%)-10k (- 0.00%)306,931k307,226k
Parse Time1.21s (± 0.46%)1.21s (± 0.51%)+0.00s (+ 0.25%)1.20s1.22s
Bind Time0.74s (± 0.64%)0.74s (± 1.08%)-0.00s (- 0.13%)0.73s0.76s
Check Time4.55s (± 0.54%)4.53s (± 0.42%)-0.02s (- 0.48%)4.49s4.57s
Emit Time2.95s (± 0.53%)2.94s (± 0.78%)-0.01s (- 0.41%)2.90s2.99s
Total Time9.46s (± 0.33%)9.43s (± 0.28%)-0.03s (- 0.34%)9.38s9.51s
TFS - node (v12.1.0, x64)
Memory used274,242k (± 0.01%)274,288k (± 0.02%)+46k (+ 0.02%)274,171k274,355k
Parse Time0.93s (± 1.08%)0.93s (± 0.93%)+0.00s (+ 0.11%)0.91s0.94s
Bind Time0.71s (± 1.26%)0.71s (± 1.16%)+0.00s (+ 0.14%)0.69s0.73s
Check Time4.20s (± 0.56%)4.18s (± 0.61%)-0.02s (- 0.45%)4.12s4.22s
Emit Time3.10s (± 0.60%)3.10s (± 0.87%)+0.01s (+ 0.26%)3.04s3.17s
Total Time8.93s (± 0.41%)8.93s (± 0.43%)-0.01s (- 0.07%)8.80s8.98s
material-ui - node (v12.1.0, x64)
Memory used430,351k (± 0.02%)430,104k (± 0.01%)-247k (- 0.06%)429,976k430,225k
Parse Time1.75s (± 0.43%)1.75s (± 0.51%)+0.00s (+ 0.06%)1.73s1.78s
Bind Time0.63s (± 1.18%)0.63s (± 0.95%)-0.00s (- 0.63%)0.61s0.64s
Check Time12.17s (± 0.33%)12.13s (± 0.46%)-0.04s (- 0.34%)12.04s12.30s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time14.55s (± 0.30%)14.51s (± 0.41%)-0.04s (- 0.30%)14.40s14.68s
Angular - node (v8.9.0, x64)
Memory used322,796k (± 0.01%)322,342k (± 0.02%)-453k (- 0.14%)322,201k322,476k
Parse Time2.12s (± 0.42%)2.11s (± 0.56%)-0.00s (- 0.24%)2.09s2.14s
Bind Time0.91s (± 0.89%)0.92s (± 0.75%)+0.00s (+ 0.22%)0.90s0.93s
Check Time5.48s (± 1.16%)5.49s (± 1.03%)+0.01s (+ 0.22%)5.29s5.58s
Emit Time6.24s (± 0.97%)6.29s (± 0.96%)+0.06s (+ 0.95%)6.21s6.46s
Total Time14.75s (± 0.38%)14.81s (± 0.30%)+0.07s (+ 0.46%)14.70s14.91s
Monaco - node (v8.9.0, x64)
Memory used325,466k (± 0.02%)325,484k (± 0.01%)+18k (+ 0.01%)325,407k325,545k
Parse Time1.54s (± 0.48%)1.54s (± 0.45%)-0.00s (- 0.13%)1.53s1.56s
Bind Time0.89s (± 0.65%)0.89s (± 0.62%)-0.00s (- 0.11%)0.88s0.90s
Check Time5.37s (± 0.81%)5.38s (± 0.55%)+0.01s (+ 0.26%)5.33s5.46s
Emit Time3.49s (± 0.55%)3.51s (± 0.51%)+0.01s (+ 0.40%)3.48s3.55s
Total Time11.30s (± 0.53%)11.33s (± 0.29%)+0.03s (+ 0.22%)11.27s11.41s
TFS - node (v8.9.0, x64)
Memory used291,404k (± 0.01%)291,344k (± 0.02%)-60k (- 0.02%)291,160k291,489k
Parse Time1.25s (± 0.36%)1.25s (± 0.38%)-0.00s (- 0.16%)1.24s1.26s
Bind Time0.74s (± 0.78%)0.74s (± 0.90%)+0.00s (+ 0.00%)0.73s0.75s
Check Time4.86s (± 0.55%)4.92s (± 1.69%)+0.05s (+ 1.09%)4.78s5.09s
Emit Time3.34s (± 1.38%)3.26s (± 2.33%)-0.08s (- 2.49%)3.08s3.41s
Total Time10.20s (± 0.35%)10.17s (± 0.55%)-0.03s (- 0.33%)10.07s10.30s
material-ui - node (v8.9.0, x64)
Memory used455,419k (± 0.01%)455,209k (± 0.01%)-210k (- 0.05%)455,026k455,336k
Parse Time2.11s (± 0.75%)2.10s (± 0.32%)-0.01s (- 0.62%)2.08s2.11s
Bind Time0.81s (± 1.22%)0.81s (± 0.84%)-0.00s (- 0.25%)0.79s0.82s
Check Time17.86s (± 0.55%)17.71s (± 0.55%)-0.15s (- 0.85%)17.46s17.86s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time20.78s (± 0.48%)20.61s (± 0.50%)-0.17s (- 0.80%)20.35s20.77s
Angular - node (v8.9.0, x86)
Memory used185,731k (± 0.03%)185,493k (± 0.02%)-238k (- 0.13%)185,410k185,591k
Parse Time2.05s (± 0.61%)2.05s (± 0.56%)-0.00s (- 0.10%)2.03s2.08s
Bind Time1.07s (± 0.73%)1.07s (± 0.62%)+0.00s (+ 0.37%)1.06s1.09s
Check Time5.00s (± 0.27%)5.02s (± 0.54%)+0.02s (+ 0.38%)4.97s5.09s
Emit Time6.07s (± 0.83%)6.06s (± 0.66%)-0.01s (- 0.16%)5.99s6.18s
Total Time14.19s (± 0.30%)14.20s (± 0.33%)+0.01s (+ 0.06%)14.08s14.28s
Monaco - node (v8.9.0, x86)
Memory used185,281k (± 0.03%)185,315k (± 0.03%)+34k (+ 0.02%)185,172k185,450k
Parse Time1.59s (± 0.73%)1.59s (± 1.40%)-0.00s (- 0.13%)1.57s1.68s
Bind Time0.76s (± 0.62%)0.77s (± 0.76%)+0.00s (+ 0.52%)0.76s0.78s
Check Time5.39s (± 0.34%)5.40s (± 0.31%)+0.02s (+ 0.33%)5.37s5.44s
Emit Time2.88s (± 1.50%)2.86s (± 0.85%)-0.02s (- 0.59%)2.83s2.94s
Total Time10.63s (± 0.49%)10.63s (± 0.38%)+0.01s (+ 0.06%)10.55s10.70s
TFS - node (v8.9.0, x86)
Memory used166,796k (± 0.02%)166,773k (± 0.02%)-23k (- 0.01%)166,717k166,825k
Parse Time1.29s (± 0.60%)1.29s (± 0.74%)-0.00s (- 0.23%)1.27s1.31s
Bind Time0.71s (± 0.56%)0.71s (± 0.67%)+0.00s (+ 0.56%)0.70s0.72s
Check Time4.63s (± 0.80%)4.63s (± 1.03%)+0.01s (+ 0.17%)4.53s4.73s
Emit Time2.98s (± 0.65%)2.99s (± 0.87%)+0.01s (+ 0.37%)2.92s3.05s
Total Time9.61s (± 0.42%)9.63s (± 0.66%)+0.02s (+ 0.21%)9.53s9.78s
material-ui - node (v8.9.0, x86)
Memory used257,623k (± 0.02%)257,479k (± 0.02%)-145k (- 0.06%)257,400k257,619k
Parse Time2.18s (± 0.80%)2.17s (± 0.41%)-0.00s (- 0.23%)2.15s2.19s
Bind Time0.69s (± 1.26%)0.68s (± 1.18%)-0.01s (- 1.45%)0.66s0.70s
Check Time16.20s (± 0.39%)16.28s (± 0.53%)+0.08s (+ 0.49%)16.08s16.42s
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)0.00s ( NaN%)0.00s0.00s
Total Time19.07s (± 0.35%)19.13s (± 0.48%)+0.06s (+ 0.34%)18.91s19.28s
System
Machine Namets-ci-ubuntu
Platformlinux 4.4.0-166-generic
Architecturex64
Available Memory16 GB
Available Memory1 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v10.16.3, x64)
  • node (v12.1.0, x64)
  • node (v8.9.0, x64)
  • node (v8.9.0, x86)
Scenarios
  • Angular - node (v10.16.3, x64)
  • Angular - node (v12.1.0, x64)
  • Angular - node (v8.9.0, x64)
  • Angular - node (v8.9.0, x86)
  • Monaco - node (v10.16.3, x64)
  • Monaco - node (v12.1.0, x64)
  • Monaco - node (v8.9.0, x64)
  • Monaco - node (v8.9.0, x86)
  • TFS - node (v10.16.3, x64)
  • TFS - node (v12.1.0, x64)
  • TFS - node (v8.9.0, x64)
  • TFS - node (v8.9.0, x86)
  • material-ui - node (v10.16.3, x64)
  • material-ui - node (v12.1.0, x64)
  • material-ui - node (v8.9.0, x64)
  • material-ui - node (v8.9.0, x86)
BenchmarkNameIterations
Current3757010
Baselinemaster10

@falsandtru
Copy link
Contributor

Can you explain some actual problems caused by the current correct definition? If you weaken the definition, I have to define my correct PromiseLike interface to strictly check the types.

@sandersn
Copy link
Member

The user tests look pretty bad with this change. But I don't know what they were like before. Have they been this broken since first merging awaited ?

@falsandtru
Copy link
Contributor

See also my first fix falsandtru/spica@c569afd

We need strictAwaitedTypes: false by default (probably even when strict flag is enabled for a while). And strictAwaitedTypes must always be disabled in the dependencies as the other stricter checking flags has been. Currently I can't use the latest nightly build because it can't compile @types/jquery.

@rbuckton
Copy link
ContributorAuthor

Closing in favor of #37610 while we continue to investigate the impact of awaited.

@microsoftmicrosoft locked as resolved and limited conversation to collaborators Oct 21, 2025
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rbuckton@typescript-bot@falsandtru@sandersn