Do not calculate signatures if old state is not used by sheetalkamat · Pull Request #43314 · microsoft/TypeScript (original) (raw)
Changes in this:
- If the old state was not present or not used, we set flag that says instead of calculating signature for a file (which is dts emit hash) use the version of file as the signature.
- This makes it so that initial compilation will not calculate the d.ts emit and next file change to the file will be treated as non local change and thats when the signatures for file reference dependency are calculated and it would probably result in emitting more files than necessary but thats the compromise for not having to spend cost for d.ts emit in the initial round. The next change to that file should be able to correctly detect local/non local change as before.
925e70e Just updates tests to ensure we are testing the scenarios we intended.
dd1cef2 is actual change and may be ideal to look at the changes as part of that commit.
69ebfe3 Checks updates to the incremental correctness of the program, essentially signature is same as d.ts emit signature or version of the file. Also exported modules map is checked in similar way.
44ba0ec Reverts the compileOnSave to old behavior of always computing signature
This is simplified implementation of work in #42960 by @sokra
There are more todos that we can improve on, eg if global file is changed, mark it for lazy signatures etc but i think that each change should be separate change to be able to evaluate the perf impact and if needed revert it.
Potential improvements:
- Global file change => resulting in emitting all files so could benefit from using signature as version
- Certain number of new files percentage
- Certain number of changed file percentage