-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Domain: PerformanceReports of unusually slow behaviorReports of unusually slow behaviorExperimentation NeededSomeone needs to try this out to see what happensSomeone needs to try this out to see what happensSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Object types can be very large and in (e.g.) a react project that makes heavy use of type inference, it's not uncommon to have to refer to a type that is either not imported or is simply anonymous (e.g. a props type). When these appear in multiple places in a declaration file, they tend to expand it considerably. Perhaps we could just synthesize type aliases for them?
- We'd have to be careful not to change the exported API shape
- We could use a heuristic to skip the work for small types (e.g. < 20 characters)
- Even if we didn't wait until the second use of a type to decide to extract it, we'd be adding ~4 tokens per type (
type id =
andid
at the use site)
strblr
Metadata
Metadata
Assignees
Labels
Domain: PerformanceReports of unusually slow behaviorReports of unusually slow behaviorExperimentation NeededSomeone needs to try this out to see what happensSomeone needs to try this out to see what happensSuggestionAn idea for TypeScriptAn idea for TypeScript