angular/packages/compiler-cli/src/ngtsc
Alex Rickabaugh 24b2f1da2b refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887)
Previously, NgtscProgram lived in the main @angular/compiler-cli package
alongside the legacy View Engine compiler. As a result, the main package
depended on all of the ngtsc internal packages, and a significant portion of
ngtsc logic lived in NgtscProgram.

This commit refactors NgtscProgram and moves the main logic of compilation
into a new 'core' package. The new package defines a new API which enables
implementers of TypeScript compilers (compilers built using the TS API) to
support Angular transpilation as well. It involves a new NgCompiler type
which takes a ts.Program and performs Angular analysis and transformations,
as well as an NgCompilerHost which wraps an input ts.CompilerHost and adds
any extra Angular files.

Together, these two classes are used to implement a new NgtscProgram which
adapts the legacy api.Program interface used by the View Engine compiler
onto operations on the new types. The new NgtscProgram implementation is
significantly smaller and easier to reason about.

The new NgCompilerHost replaces the previous GeneratedShimsHostWrapper which
lived in the 'shims' package.

A new 'resource' package is added to support the HostResourceLoader which
previously lived in the outer compiler package.

As a result of the refactoring, the dependencies of the outer
@angular/compiler-cli package on ngtsc internal packages are significantly
trimmed.

This refactoring was driven by the desire to build a plugin interface to the
compiler so that tsc_wrapped (another consumer of the TS compiler APIs) can
perform Angular transpilation on user request.

PR Close #34887
2020-01-24 08:59:59 -08:00
..
annotations refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
core refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
cycles test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34736) 2020-01-15 14:58:07 -05:00
diagnostics fix(ngcc): do not attempt compilation when analysis fails (#34889) 2020-01-23 14:47:03 -08:00
entry_point test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34736) 2020-01-15 14:58:07 -05:00
file_system refactor(ivy): add exclusive mode to writeFile() (#34722) 2020-01-22 15:35:34 -08:00
imports refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
incremental docs(ivy): move incremental package README file to the correct location (#34912) 2020-01-23 13:30:10 -08:00
indexer refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
metadata feat(ivy): throw compilation error when providing undecorated classes (#34460) 2019-12-18 15:04:49 -08:00
modulewithproviders refactor(ivy): change ImportMode enum to ImportFlags (#34649) 2020-01-23 10:31:47 -08:00
partial_evaluator fix(ngcc): libraries using spread in object literals cannot be processed (#34661) 2020-01-23 10:29:57 -08:00
perf refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
reflection refactor(compiler-cli): fix typo in TypeScriptCompilerHost#getExportsOfModule() error message (#34811) 2020-01-23 13:58:37 -08:00
resource refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
routing perf(ivy): use module resolution cache (#34332) 2019-12-12 14:06:37 -08:00
scope refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
shims refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
switch build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -08:00
testing refactor(ivy): implement a virtual file-system layer in ngtsc + ngcc (#30921) 2019-06-25 16:25:24 -07:00
transform refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
translator refactor(ivy): consistently translate types to ts.TypeNode (#34021) 2020-01-06 11:06:07 -08:00
typecheck refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
util test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34736) 2020-01-15 14:58:07 -05:00
program.ts refactor(ivy): introduce the 'core' package and split apart NgtscProgram (#34887) 2020-01-24 08:59:59 -08:00
synthetic_files_compiler_host.ts feat: add support for TypeScript 3.3 (and drop older versions) (#29004) 2019-03-13 10:38:37 -07:00
tsc_plugin.ts refactor(ivy): use ClassDeclaration in more ReflectionHost methods (#29209) 2019-03-21 22:20:23 +00:00