-
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
Build .tsbuildinfo file when building using tsc --b #29813
Conversation
…st manipulate output Step 1: Update the verbose log to reflect it
We can ship with this requirement and see how it goes |
src/compiler/emitter.ts
Outdated
if (declarationMapText === text) return; | ||
break; | ||
default: | ||
Debug.assertNever(name as never); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asserting to never
here defeats the purpose of the assertNever
function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e. this should just be Debug.fail
@RyanCavanaugh Added logic to start from scratch if not same compiler version as discussed in design meeting. |
Best feature of 3.4! |
Should we commit |
@tommedema They are like the output .js files and shouldn't be committed to version control. |
@tommedema don't think so, it is a cache which will be overridden by next tsc launch if code changes |
This isn't the behaviour I'm seeing using
When using Should I log a new issue for this? It seems easy to repro but I can work on one if needed. |
Ah, thank you! |
incremental
file with.tsbuildinfo
extension is emitted.incremental
astrue
and its error to specifyincremental
asfalse
in the composite projecttsBuildInfoFile
options, it uses the path specified by that to write the build information.out
oroutFile
option, theoutFileWithoutExtension.tsbuildinfo
file is written next to output js file.outDir
, config files base file name with extension as.tsbuildinfo
is written inoutDir
.tsbuildinfo
is written next to the config fileBuildInfo
shown below.program
in buildInfo is Builder information so we can track the file changes since that version and build incrementally even without watch (that is emitting only affected files or getting errors only from changed/affected files). This should help us get perf similar to --w incremental builds even on subsequent invokes of build (In short we are serializing information of builder program that we keep in memory during incremental builds in--w
mode). Also pulled 6c5ae93 to store semantic diagnostics though in--b
scenario it will always be just file name as emit happens only if there are no errors.bundle
stores information to be able to emit into single file. This consists of different sections in file, eg. prologues, prepended file contents and their range's. When having project that references another project withprepend
astrue
, this helps in faster emit when the referenced project changes but it doesn't change declaration file. Previously we would have to create program for project referencing changed output to generate new output, but this just uses section information from buildinfo file and emit new output without having to create program. This saves us time for creating program and checking errors (since the errors are not cached with --out as we cant tell change in declaration emit) and emitting all files. Having section also fixes issues like Duplicate"use strict"
prologue in the generated output. #25550 to generate better output.internal
declaration sections, so if project hasstripInternal
instead of concatenating whole string it skips out portions ofinternal
and generates correct.d.ts
--out
since any change means new emit and new diagnostics, so its ok to not store program information in this case and in other scenario there is nothing of importance in those other section than program so may be separating these two (reading and writing only modified field) might not be a bad decision. But will need to see how that goes.Measured perf with updating LKG from master to build this branch using
gulp local
and then with this branch's build as LKG and usinggulp local