-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
projectVersion not bumped when rootFileNames changes #996
projectVersion not bumped when rootFileNames changes #996
Comments
Hmm, I believe I purposely reverted this in d133b39 because I couldn't replicate any issue and wanted to avoid changing the logic you had added 😄 I can make this change again. |
Actually, I take that back - it looks like I did change this in 2e9a2f1 and I believe it follows your expectation. |
Here's where I think we're missing a That line is effectively adding a new entry to the Right now ts-node adds all I created an example: https://github.com/TypeStrong/ts-node-repros/tree/issues-996 |
I addressed this in #998. Unfortunately, it resurfaces #884. #884 was caused by The regression was being masked because we weren't properly bumping |
Interesting, thanks for the reproduction!
How do we reconcile this change with the fact that it seems to speed things up for people in #754? Is that just an accident or side effect of skipping new programs effectively? Or does your |
One possibility, which I had considered before but didn't believe, is that the act of creating a new identity for |
I need to do some benchmarking to be sure. I've used codegen to create a huge project for testing in the past; I just need to make sure it's representative of a real-world project. Last time I generated 1000 empty files; this time I need to fill them with code so it takes time to parse.
I'm not sure, but I'm worried it might be. Maybe it's related to #997? If there were filename inconsistencies, TypeScript would be internally discovering a #970 might help. With #970, I'm pretty sure we'll be able to avoid many cases where the |
Thanks @cspotcode. Feel free to revert any of my hacks anytime! 😄 |
Weird, I just checked the compiler source code, and
When I have time for benchmarking, I'll test that theory. |
Expected Behavior
getProjectVersion()
is incremented when a new file is appended togetScriptFileNames()
array.Actual Behavior
getProjectVersion()
is not incremented when a file is added togetScriptFileNames()
during typechecking, before it has beenrequire()
d.@blakeembrey it looks like this was changed here:
#985
That pull request means that all files added to the in-memory cache are also added to
getScriptFileNames()
so they need to trigger a bump ofgetProjectVersion()
Otherwise it breaks the TS compiler's expectations, which might cause bugs down the road.Steps to reproduce the problem
Omitted a rigorous reproduction until I double-check with you that this change was, indeed, accidental.
If you have a
index.ts
that imports afoo.ts
, and you dots-node ./index.ts
:typechecking will see the import statement, and
updateMemoryCache
will be called to pullfoo.ts
into the cache, adding it to thefileVersions
Map.Specifications
The text was updated successfully, but these errors were encountered: