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

Experiment with storing output timestamps in .tsbuildinfo #46677

Closed
DanielRosenwasser opened this issue Nov 4, 2021 · 2 comments · Fixed by #48784
Closed

Experiment with storing output timestamps in .tsbuildinfo #46677

DanielRosenwasser opened this issue Nov 4, 2021 · 2 comments · Fixed by #48784
Assignees
Labels
Domain: --incremental The issue relates to incremental compilation Domain: Performance Reports of unusually slow behavior Domain: tsc -b Issues related to build mode Experimentation Needed Someone needs to try this out to see what happens Fix Available A PR has been opened for this issue 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

DanielRosenwasser commented Nov 4, 2021

Occasionally, TypeScript makes the choice not to write output files in --watch mode if the output is the same as what's on disk; however, this causes complications with --incremental. Under --incremental, --watch still needs to update each output file's timestamps so that a subsequent invocation of tsc --build will avoid rebuilding certain files. See more here: 7b290fd.

One concern with this is that it causes issues with downstream tooling - messing with output files that wouldn't have been rewritten causes issues for tools that want to be more incremental as well. See #46661.

Another concern is that this causes a bunch of file-touching anyway which can potentially be slow. It's not clear whether this is really a bottleneck, but there is some discussion in #45082 around issues here, and it may warrant some investigation.

We should investigate book-keeping with .tsbuildinfo to avoid manually touching timestamps every time.

@jfstephe
Copy link

jfstephe commented Nov 9, 2021

Note: A potential further consideration may be around browser caching of the output files. If the modified time of the file changes then browsers may not cache the unchanged file. Just trying to add weight to this really painful issue (for us).

@DanielRosenwasser DanielRosenwasser added Domain: tsc -b Issues related to build mode In Discussion Not yet reached consensus labels Nov 15, 2021
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.6.0 milestone Nov 15, 2021
@DanielRosenwasser
Copy link
Member Author

DanielRosenwasser commented Nov 15, 2021

@rbuckton try tackling this soon in the 4.6 cycle, loop @jakebailey, @amcasey, and me in reviews.

@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Apr 29, 2022
@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: --incremental The issue relates to incremental compilation Domain: Performance Reports of unusually slow behavior Domain: tsc -b Issues related to build mode Experimentation Needed Someone needs to try this out to see what happens Fix Available A PR has been opened for this issue 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

Successfully merging a pull request may close this issue.

6 participants