angular/packages
JoostK 87bca2a5c6 perf(compiler-cli): avoid module resolution in cycle analysis (#40948)
The compiler performs cycle analysis for the used directives and pipes
of a component's template to avoid introducing a cyclic import into the
generated output. The used directives and pipes are represented by their
output expression which would typically be an `ExternalExpr`; those are
responsible for the generation of an `import` statement. Cycle analysis
needs to determine the `ts.SourceFile` that would end up being imported
by these `ExternalExpr`s, as the `ts.SourceFile` is then checked against
the program's `ImportGraph` to determine if the import is allowed, i.e.
does not introduce a cycle. To accomplish this, the `ExternalExpr` was
dissected and ran through module resolution to obtain the imported
`ts.SourceFile`.

This module resolution step is relatively expensive, as it typically
needs to hit the filesystem. Even in the presence of a module resolution
cache would these module resolution requests generally see cache misses,
as the generated import originates from a file for which the cache has
not previously seen the imported module specifier.

This commit removes the need for the module resolution by wrapping the
generated `Expression` in an `EmittedReference` struct. This allows the
reference emitter mechanism that is responsible for generating the
`Expression` to also communicate from which `ts.SourceFile` the
generated `Expression` would be imported, precluding the need for module
resolution down the road.

PR Close #40948
2021-03-08 12:05:49 -08:00
..
animations fix(animations): error when setting position before starting animation (#28255) 2021-02-19 12:09:02 -08:00
bazel fix(bazel): fix incorrect rollup plugin method signature (#41101) 2021-03-08 10:06:46 -08:00
benchpress fix(dev-infra): update type castings for JSON.parse usage (#40710) 2021-02-09 10:48:43 -08:00
common feat(core): manually annotate de-sugarred core tree-shakable providers with @pureOrBreakMyCode (#41096) 2021-03-08 10:30:08 -08:00
compiler feat(compiler): emit @__PURE__ or @pureOrBreakMyCode annotations in the generated code (#41096) 2021-03-08 10:30:08 -08:00
compiler-cli perf(compiler-cli): avoid module resolution in cycle analysis (#40948) 2021-03-08 12:05:49 -08:00
core feat(core): manually annotate de-sugarred core tree-shakable providers with @pureOrBreakMyCode (#41096) 2021-03-08 10:30:08 -08:00
docs docs(di): fix typo in advanced di doc (#36634) 2020-05-01 09:50:28 -07:00
elements fix(elements): update type castings for JSON.parse usage (#40710) 2021-02-09 10:48:43 -08:00
examples docs: improve description, examples of DecimalPipe's digitsInfo parameter (#40714) 2021-02-26 15:42:29 -08:00
forms docs(forms): add array example to get method (#41008) 2021-02-26 08:24:22 -08:00
language-service fix(language-service): Only provide dom completions for inline templates (#41078) 2021-03-04 14:51:06 -08:00
localize feat(localize): add scripts to migrate away from legacy message IDs (#41026) 2021-03-08 10:05:42 -08:00
misc/angular-in-memory-web-api docs: remove duplicated the (#40434) 2021-01-14 11:33:57 -08:00
platform-browser Revert "fix(animations): cleanup DOM elements when the root view is removed (#41001)" (#41056) 2021-03-02 13:31:25 -08:00
platform-browser-dynamic refactor(core): don't use innerHTML in DOMTestComponentRenderer (#41099) 2021-03-08 08:39:09 -08:00
platform-server fix(common): cleanup location change listeners when the root view is removed (#40867) 2021-03-04 13:09:04 -08:00
private/testing build: update .bazelversion (#40579) 2021-01-26 11:35:54 -08:00
router fix(common): cleanup location change listeners when the root view is removed (#40867) 2021-03-04 13:09:04 -08:00
service-worker fix(service-worker): update type castings for JSON.parse usage (#40710) 2021-02-09 10:48:43 -08:00
upgrade fix(upgrade): fix HMR for hybrid applications (#40045) 2020-12-10 13:40:53 -08:00
zone.js feat(core): drop support for zone.js 0.10.x (#40823) 2021-02-24 07:58:29 -08:00
BUILD.bazel build: replace @types/trusted-types dep with minimal type defs (#39211) 2020-10-15 09:08:00 -07:00
circular-deps-test.conf.js fix(platform-webworker): remove platform-webworker and platform-webworker-dynamic (#38846) 2020-09-30 09:13:59 -04:00
empty.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
goog.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
license-banner.txt docs: update year (#40925) 2021-02-22 12:37:40 -08:00
README.md docs: add doc reference to npm package readme (#33911) 2019-11-20 14:46:23 -08:00
system.d.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
tsconfig-build-no-strict.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-build.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-test.json refactor: fix typescript strict flag failures in all tests (#30993) 2019-07-18 14:21:26 -07:00
tsconfig.json fix(platform-webworker): remove platform-webworker and platform-webworker-dynamic (#38846) 2020-09-30 09:13:59 -04:00
types.d.ts build: replace @types/trusted-types dep with minimal type defs (#39211) 2020-10-15 09:08:00 -07:00

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