angular/packages/compiler-cli/ngcc/test
Pete Bacon Darwin ae364864f6 fix(ngcc): do not scan import expressions in d.ts files (#37503)
It is quite common for the TS compiler to have to add synthetic
types to function signatures, where the developer has not
explicitly provided them.  This results in `import(...)` expressions
appearing in typings files.  For example in `@ngrx/data` there is a
class with a getter that has an implicit type:

```ts
export declare class EntityCollectionServiceBase<...> {
  ...
  get store() {
    return this.dispatcher.store;
  }
  ...
}
```

In the d.ts file for this we get:

```ts
get store(): Store<import("@ngrx/data").EntityCache>;
```

Given that this file is within the `@ngrx/data` package already,
this caused ngcc to believe that there was a circular dependency,
causing it to fail to process the package - and in fact crash!

This commit resolves this problem by ignoring `import()` expressions
when scanning typings programs for dependencies. This ability was
only introduced very recently in a 10.0.0 RC release, and so it has
limited benefit given that up till now ngcc has been able to process
libraries effectively without it. Moreover, in the rare case that a
package does have such a dependency, it should get picked up
by the sync ngcc+CLI integration point.

PR Close #37503
2020-06-10 11:51:18 -07:00
..
analysis build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
dependencies fix(ngcc): do not scan import expressions in d.ts files (#37503) 2020-06-10 11:51:18 -07:00
entry_point_finder feat(ngcc): implement a program-based entry-point finder (#37075) 2020-06-04 09:22:39 -07:00
execution build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
helpers build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
host fix(ngcc): find decorated constructor params on IIFE wrapped classes (#37436) 2020-06-05 09:22:04 -07:00
integration feat(ngcc): implement a program-based entry-point finder (#37075) 2020-06-04 09:22:39 -07:00
locking perf(ngcc): allow immediately reporting a stale lock file (#37250) 2020-06-02 17:30:03 -04:00
logging build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
migrations build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
packages build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
rendering fix(ngcc): do not inline source-maps for non-inline typings source-maps (#37363) 2020-06-01 17:18:31 -04:00
sourcemaps build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
writing build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
BUILD.bazel feat(ngcc): implement a program-based entry-point finder (#37075) 2020-06-04 09:22:39 -07:00
ngcc_options_spec.ts perf(ngcc): cache parsed tsconfig between runs (#37417) 2020-06-04 09:19:38 -07:00
utils_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00