-
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
New flag assumeChangesAffectShape for incremental and watch scenario #41219
Conversation
The PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
@sheetalkamat with this flag, would we have to recheck all dependencies (unless |
Yes this flag means, we will assume every change is "non local" unless |
I wonder if we could consider a sort of combined approach. For example, given a module:
|
I feel like those are some of the things we could do generally and shouldn't be affected by this flag.. this flag is escape route to users whose d.ts is not easily computable and they cant find the way to fix the original issue or waiting on us (which most of the time is design limitation, because type is complicated) @sokra had done some changes on line of based on set delay d.ts computation as part of #42960 and i did mark those as TODO in #43314 which i plan to pick up in 4.4 individually so we its easier to measure, tweak, revert... |
Yeah, I was thinking about how some of the ideas there, here and stuff we've seen in GCs/JITs where hot paths get "warmed up" could kind of be explored. If you think might be promising, I can create an issue to track it. |
Definitely worth investigating |
… affect the dependencies This avoids having to generate d.ts files for the sources
84b536f
to
d52da06
Compare
@typescript-bot pack this |
Heya @sheetalkamat, I've started to run the tarball bundle task on this PR at d52da06. You can monitor the build here. |
Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
@typescript-bot pack this |
Heya @sheetalkamat, I've started to run the tarball bundle task on this PR at 4028fbe. You can monitor the build here. |
Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
We normally use d.ts emit for a file as its signature so we can only emit or refresh diagnostics for only files that depend on it when shape of the file changes and any local change that doesn't affect its d.ts file, doesn't affect any other files in the compilation.
While this is good, there have been reports when people have run into issue with memory or perf because d.ts is slow.
Technical work around is to figure out where this slowness is coming from and explicitly annotate types so compiler doesn't have to manufacture them. But another possible work around is to use this new flag
assumeChangesAffectShape
which mean any change to file is assumed to change its shape.The one side effect of this flag is that any change results in writing/analyzing more files than might be necessary but still could be acceptable. But this might be acceptable to people who run into issues with d.ts emit because they want to use
--watch
but arent looking to generate the d.ts files. As the compilation with local change might be slower than without this flag but could still be faster than running full build.@DanielRosenwasser @RyanCavanaugh please consider if this is reasonable flag .. if yes, i can add reviewers to the change.
Possibly will help: #35729, #34916, #34119, #30732, #22826, #21140, #42937