-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Enable --isolatedDeclarations
on TS codebase
#59635
Conversation
Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page. Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the generator types: for 5.5, I had to use any
in these cases since unknown
is not assignable to undefined
(and the inferred TNext
type in these cases is undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are updates to as const
objects (and other related kinds of objects)
and this #59635 (comment)
--isolatedDeclarations
on TS codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty hard to review the whole thing because the diff is so big, but I do wonder if we should even bother doing this for harness/testRunner given those don't actually have a public API...
In general though I do think we should try and name some of the types introduced here. That and there are some really unfortunate losses of inference here :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are the places where any
shows up (not counting workarounds for generators). there could be better ways to type them.
@typescript-bot perf test this faster |
@typescript-bot perf test this faster |
@iisaduan Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
@@ -10189,7 +10224,78 @@ export type PragmaArgumentType<KPrag extends keyof ConcretePragmaSpecs> = Concre | |||
: never; | |||
|
|||
/** @internal */ | |||
export type ConcretePragmaSpecs = typeof commentPragmas; | |||
export interface ConcretePragmaSpecs { | |||
readonly "reference": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still wish we could do something simpler here, but we also don't really touch this that much. (I'm personally okay with it becoming a little less safe just to not have this duplication)
Does isolated declarations improve the performance of the language service? |
@Zzzen this PR shouldn't have any performance effect on our implementation of the language service. It's possible enabling it in your own code could make some parts of the LS faster in your projects, but we have not benchmarked anything or made ID specific performance improvements for the LS. |
fixes #59097 : enables
--isolatedDeclarations
on our codebase