core: make main tsc compile cacheable #13069
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main typescript compilation (from the root
tsconfig.json
) hasn't hademitDeclarationOnly
turned on because of compilation errors I ran into in #12914 when I initially enabled that. Not having declaration emit was ok, though, because it's a compilation root, not a dependency for any of our other tsconfigs, so it didn't need ad.ts
emit for anything. The downside is that less of it is cacheable and more has to be re-done on each compile, even if nothing in the core files has changed.I ran into this problem again in a different context and it turns out it's fairly simple, only a single error (I thought it was the first of many), and it even tells you exactly what you need to do to fix it.
This allows fully caching the core compile, so if e.g. you're working on report stuff, you'll only spend ~100ms instead of 5s recompiling core files.