angular/packages/compiler-cli/src/transformers
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
..
api.ts feat(ivy): introduce a flag to control template type-checking for Ivy (#29698) 2019-04-19 11:15:25 -07:00
compiler_host.ts test(ivy): support multiple compilations in the ngtsc test env (#29380) 2019-04-01 15:13:56 -07:00
entry_points.ts Revert "Revert "Revert "perf(compiler): skip type check and emit in bazel in some cases. (#19646)""" 2017-10-12 16:09:49 -07:00
inline_resources.ts build(compiler-cli): enable full TypeScript strictness (#29436) 2019-03-21 12:14:39 -04:00
lower_expressions.ts feat(compiler-cli): lower some exported expressions (#30038) 2019-04-23 08:30:58 -07:00
metadata_cache.ts fix(compiler-cli): strictMetadataEmit should not break on non-compliant libraries (#23275) 2018-04-09 15:35:23 -07:00
metadata_reader.ts fix(compiler-cli): propagate ts.SourceFile moduleName into metadata 2017-12-01 14:19:06 -08:00
nocollapse_hack.ts fix(ivy): add @nocollapse when writing closure-annotated code (#25775) 2018-09-11 06:53:21 -07:00
node_emitter.ts fix(ivy): use 'typeof' and 'never' for type metadata (#24862) 2018-07-20 11:48:36 -07:00
node_emitter_transform.ts fix(compiler-cli): merge @fileoverview comments. (#20870) 2017-12-12 11:37:55 -08:00
program.ts fix(ivy): don't reuse a ts.Program more than once in ngtsc (#30090) 2019-04-24 11:41:21 -07:00
r3_metadata_transform.ts feat(compiler-cli): reflect static methods added to classes in metadata (#21926) 2018-02-01 08:30:58 -08:00
r3_strip_decorators.ts feat(ivy): @NgModule -> ngInjectorDef compilation (#22458) 2018-03-16 12:57:11 -07:00
r3_transform.ts feat: change @Injectable() to support tree-shakeable tokens (#22005) 2018-02-12 14:34:59 -08:00
tsc_pass_through.ts refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
util.ts feat: change @Injectable() to support tree-shakeable tokens (#22005) 2018-02-12 14:34:59 -08:00