angular/packages/compiler-cli/ngcc/src
crisbeto f563c7c656 feat(ivy): error in ivy when inheriting a ctor from an undecorated base (#34460)
Angular View Engine uses global knowledge to compile the following code:

```typescript
export class Base {
  constructor(private vcr: ViewContainerRef) {}
}

@Directive({...})
export class Dir extends Base {
  // constructor inherited from base
}
```

Here, `Dir` extends `Base` and inherits its constructor. To create a `Dir`
the arguments to this inherited constructor must be obtained via dependency
injection. View Engine is able to generate a correct factory for `Dir` to do
this because via metadata it knows the arguments of `Base`'s constructor,
even if `Base` is declared in a different library.

In Ivy, DI is entirely a runtime concept. Currently `Dir` is compiled with
an ngDirectiveDef field that delegates its factory to `getInheritedFactory`.
This looks for some kind of factory function on `Base`, which comes up
empty. This case looks identical to an inheritance chain with no
constructors, which works today in Ivy.

Both of these cases will now become an error in this commit. If a decorated
class inherits from an undecorated base class, a diagnostic is produced
informing the user of the need to either explicitly declare a constructor or
to decorate the base class.

PR Close #34460
2019-12-18 15:04:51 -08:00
..
analysis feat(ivy): error in ivy when inheriting a ctor from an undecorated base (#34460) 2019-12-18 15:04:51 -08:00
dependencies feat(ngcc): support ignoreMissingDependencies in ngcc config (#33192) 2019-10-17 19:43:39 -04:00
entry_point_finder fix(ngcc): do not analyze dependencies for non Angular entry-points (#32303) 2019-08-26 10:08:44 -07:00
execution refactor(ngcc): add debug messages to help with debugging in parallel mode (#34437) 2019-12-17 11:39:19 -08:00
host fix(ngcc): correctly match aliased classes between src and dts files (#34254) 2019-12-18 11:25:03 -08:00
logging feat(compiler-cli): ngcc - make logging more configurable (#29591) 2019-04-01 11:53:28 -07:00
migrations fix(ngcc): fix undecorated child migration when exportAs is present (#34014) 2019-12-09 16:13:10 -08:00
packages refactor(ngcc): use bundle src to create reflection hosts (#34254) 2019-12-18 11:25:02 -08:00
rendering refactor(ngcc): remove private declaration aliases (#34254) 2019-12-18 11:25:03 -08:00
writing refactor(ngcc): abstract updating package.json files behind an interface (#32427) 2019-09-09 15:55:13 -04:00
constants.ts refactor(ivy): move ngcc into a higher level folder (#29092) 2019-03-20 14:45:54 -04:00
main.ts refactor(ngcc): slightly improve the info in error messages (#34254) 2019-12-18 11:25:03 -08:00
utils.ts fix(ngcc): handle UMD re-exports (#34254) 2019-12-18 11:25:03 -08:00