angular-docs-cn/packages
Alex Rickabaugh ecffc3557f perf(compiler-cli): perform template type-checking incrementally (#36211)
This optimization builds on a lot of prior work to finally make type-
checking of templates incremental.

Incrementality requires two main components:
- the ability to reuse work from a prior compilation.
- the ability to know when changes in the current program invalidate that
  prior work.

Prior to this commit, on every type-checking pass the compiler would
generate new .ngtypecheck files for each original input file in the program.

1. (Build #1 main program): empty .ngtypecheck files generated for each
   original input file.

2. (Build #1 type-check program): .ngtypecheck contents overridden for those
   which have corresponding components that need type-checked.

3. (Build #2 main program): throw away old .ngtypecheck files and generate
   new empty ones.

4. (Build #2 type-check program): same as step 2.

With this commit, the `IncrementalDriver` now tracks template type-checking
_metadata_ for each input file. The metadata contains information about
source mappings for generated type-checking code, as well as some
diagnostics which were discovered at type-check analysis time. The actual
type-checking code is stored in the TypeScript AST for type-checking files,
which is now re-used between programs as follows:

1. (Build #1 main program): empty .ngtypecheck files generated for each
   original input file.

2. (Build #1 type-check program): .ngtypecheck contents overridden for those
   which have corresponding components that need type-checked, and the
   metadata registered in the `IncrementalDriver`.

3. (Build #2 main program): The `TypeCheckShimGenerator` now reuses _all_
   .ngtypecheck `ts.SourceFile` shims from build #1's type-check program in
   the construction of build #2's main program. Some of the contents of
   these files might be stale (if a component's template changed, for
   example), but wholesale reuse here prevents unnecessary changes in the
   contents of the program at this point and makes TypeScript's job a lot
   easier.

4. (Build #2 type-check program): For those input files which have not
   "logically changed" (meaning components within are semantically the same
   as they were before), the compiler will re-use the type-check file
   metadata from build #1, and _not_ generate a new .ngtypecheck shim.
   For components which have logically changed or where the previous
   .ngtypecheck contents cannot otherwise be reused, code generation happens
   as before.

PR Close #36211
2020-05-05 18:40:42 -07:00
..
animations build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
bazel feat: remove @angular/http (#27038) 2020-05-05 17:42:01 -07:00
benchpress release(benchpress): bump version of benchpress to 0.2.0 (#36457) 2020-04-22 17:10:28 -04:00
common refactor(common): remove WrappedValue from AsyncPipe (#36633) 2020-04-30 11:41:49 -07:00
compiler fix(compiler): normalize line endings in ICU expansions (#36741) 2020-04-28 12:22:40 -07:00
compiler-cli perf(compiler-cli): perform template type-checking incrementally (#36211) 2020-05-05 18:40:42 -07:00
core fix(core): properly get root nodes from embedded views with <ng-content> (#36051) 2020-05-05 12:15:52 -07:00
docs docs(di): fix typo in advanced di doc (#36634) 2020-05-01 09:50:28 -07:00
elements build: fix and re-enable elements tests on saucelabs (#36929) 2020-05-05 12:04:48 -07:00
examples build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
forms fix(forms): handle numeric values properly in the validator (#36157) 2020-05-05 11:50:00 -07:00
language-service test(language-service): [ivy] Add mock service to overwrite files (#36923) 2020-05-05 17:52:12 -07:00
localize refactor(localize): use the new workspaces API for ng-add schematic (#36897) 2020-05-05 11:58:27 -07:00
platform-browser fix(core): log error instead of warning for unknown properties and elements (#36399) 2020-05-04 12:37:42 -07:00
platform-browser-dynamic build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
platform-server build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
platform-webworker build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
platform-webworker-dynamic build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
private/testing build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
router fix(router): cancel navigation when at least one resolver completes with no "next" emission (#24621) 2020-05-04 12:36:49 -07:00
service-worker feat(service-worker): use `ignoreVary: true` when retrieving responses from cache (#34663) 2020-05-01 09:44:07 -07:00
upgrade build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00
zone.js revert: "feat(dev-infra): exposed new rule 'component_benchmark' via dev_infra (#36434)" (#36798) 2020-04-24 11:03:38 -07:00
BUILD.bazel
README.md
circular-deps-test.conf.js build: move circular deps golden to a subfolder (#36630) 2020-04-22 17:11:20 -04:00
empty.ts
goog.d.ts
license-banner.txt build: bump year (#34651) 2020-01-13 07:21:43 -08:00
system.d.ts build: no longer run tslint from within gulp task (#35800) 2020-03-03 09:20:49 -08:00
tsconfig-build-no-strict.json
tsconfig-build.json
tsconfig-test.json
tsconfig.json revert: "feat(dev-infra): exposed new rule 'component_benchmark' via dev_infra (#36434)" (#36798) 2020-04-24 11:03:38 -07:00
types.d.ts build: reformat repo to new clang@1.4.0 (#36613) 2020-04-14 12:08:36 -07:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

Usage information and reference details can be found in Angular documentation.

License: MIT