angular-cn/packages/compiler-cli
Alex Rickabaugh 3938563565 fix(ivy): don't reuse a ts.Program more than once in ngtsc (#30090)
ngtsc previously could attempt to reuse the main ts.Program twice. This
occurred when template type-checking was enabled and then an incremental
build was performed. This breaks a TypeScript invariant - ts.Programs can
only be reused once.

The creation of the template type-checking program reuses the main program,
rendering it moot. Then, on the next incremental build the main program
would be subject to reuse again, which would crash inside TypeScript.

This commit fixes the issue by reusing the template type-checking program
from the previous run on the next incremental build. Since under normal
circumstances the files in the type-checking program aren't changed, this
should be just as fast.

Testing strategy: a test is added in the incremental_spec which validates
that program reuse with type-checking turned on does not crash the compiler.

Fixes #30079

PR Close #30090
2019-04-24 11:41:21 -07:00
..
integrationtest fix(bazel): use //:tsconfig.json as the default for ng_module (#29670) 2019-04-02 15:57:11 -07:00
ngcc refactor(ivy): ngcc - simplify `NewEntryPointFileWriter` code (#30085) 2019-04-24 10:49:31 -07:00
src fix(ivy): don't reuse a ts.Program more than once in ngtsc (#30090) 2019-04-24 11:41:21 -07:00
test fix(ivy): don't reuse a ts.Program more than once in ngtsc (#30090) 2019-04-24 11:41:21 -07:00
BUILD.bazel refactor(ivy): move metadata registration to its own package (#29698) 2019-04-19 11:15:25 -07:00
index.ts feat(compiler-cli): export tooling definitions (#29929) 2019-04-17 17:23:01 -07:00
ngtools2.ts refactor(compiler-cli): expose ngtools api separately (#18978) 2017-08-31 14:37:13 -07:00
package.json build: update to TypeScript 3.4 (#29372) 2019-04-10 12:12:16 -07:00
tsconfig-build.json build(compiler-cli): enable full TypeScript strictness (#29436) 2019-03-21 12:14:39 -04:00
tsconfig.json build(compiler-cli): enable full TypeScript strictness (#29436) 2019-03-21 12:14:39 -04:00