Repository navigation
Better best effort type alias preservation - #40232
Wesley Wigham (weswigham) wants to merge 4 commits into
Conversation
…to ensure locally accessible type aliases are materialized at printback time
|
TypeScript Bot (@typescript-bot) perf test this (this almost certainly has a cost) TypeScript Bot (@typescript-bot) pack this |
|
Heya Wesley Wigham (@weswigham), I've started to run the tarball bundle task on this PR at 7d9bb77. You can monitor the build here. |
|
Heya Wesley Wigham (@weswigham), I've started to run the perf test suite on this PR at 7d9bb77. You can monitor the build here. Update: The results are in! |
|
Heya Wesley Wigham (@weswigham), I've started to run the parallelized community code test suite on this PR at 7d9bb77. You can monitor the build here. |
|
Heya Wesley Wigham (@weswigham), I've started to run the parallelized Definitely Typed test suite on this PR at 7d9bb77. You can monitor the build here. |
|
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
|
Wesley Wigham (@weswigham) Here they are:Comparison Report - master..40232
System
Hosts
Scenarios
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Does this PR address the non-propogation of type aliases described in point one in #45954, which makes proposals to Improve type readability? |
|
Unfortunately, we never finished reviewing this PR. It is pretty old now, so I'm going to close it to reduce the number of open PRs. |
In this PR, we record all[1] aliases we create for a type, rather than just the one we encounter on the adjacent declaration the first time we create a type, and then use that recorded list of aliases to improve declaration emit/printback in a more deterministic way.
Fixes #40092 and probably a lot of other stuff. I've labeled this as a potentially
Breaking Changeas the use of more aliases could affect people's declaration emit of inferred types - for example, thelibPropertyKeytype is often used in place ofstring | number | symbol(since it's a global type alias).[1]some aliases we could make, but likely just increase complexity, are intentionally omitted - this way we don't do things like printback
NonNullable<NonNullable<T>>as a preferred "alias" ofT.