Skip to content
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

Gradually "warm up" shape calculation in incremental scenarios #43912

Open
DanielRosenwasser opened this issue May 1, 2021 · 0 comments
Open
Assignees
Labels
Experimentation Needed Someone needs to try this out to see what happens In Discussion Not yet reached consensus Rescheduled This issue was previously scheduled to an earlier milestone Suggestion An idea for TypeScript

Comments

@DanielRosenwasser
Copy link
Member

Background

In incremental scenarios, we need to understand the "shape" of a module to determine whether its dependencies also need to be checked; however, declaration files are expensive to generate. In cases where --declaration isn't on, it can be wasteful to spend time on that.

Proposal

In some cases, it can be cheaper just to assume that a change to a module should trigger a re-check of its transitive dependencies - so we could consider the JavaScript output (or maybe even just the TypeScript input) to determine the initial shape, and then "graduate" to using the declaration files if they're referenced often enough.

  • figure out the set of dependent modules. If the set of dependencies is "large", then use the .d.ts output as the shape; otherwise, use the .js output
  • if a module gets changed often enough and it's using .js to determine shape, we switch to using its .d.ts output to determine shape

Originally posted by @DanielRosenwasser in #41219 (comment)

@DanielRosenwasser DanielRosenwasser added the Needs Investigation This issue needs a team member to investigate its status. label May 1, 2021
@DanielRosenwasser DanielRosenwasser added Experimentation Needed Someone needs to try this out to see what happens In Discussion Not yet reached consensus Suggestion An idea for TypeScript and removed Needs Investigation This issue needs a team member to investigate its status. labels May 1, 2021
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.4.0 milestone May 1, 2021
@andrewbranch andrewbranch added the Rescheduled This issue was previously scheduled to an earlier milestone label Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experimentation Needed Someone needs to try this out to see what happens In Discussion Not yet reached consensus Rescheduled This issue was previously scheduled to an earlier milestone Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants