angular-cn/packages/core/schematics/migrations/google3
Paul Gschwendtner 32eafef6a7 fix(core): undecorated-classes-with-decorated-fields migration does not decorate derived classes (#35339)
The `undecorated-classes-with-decorated-fields` migration has been
introduced with 904a2018e0, but misses
logic for decorating derived classes of undecorated classes which use
Angular features. Example scenario:

```ts
export abstract class MyBaseClass {
  @Input() someInput = true;
}

export abstract class BaseClassTwo extends MyBaseClass {}

@Component(...)
export class MyButton extends BaseClassTwo {}
```

Both abstract classes would need to be migrated. Previously, the migration
only added `@Directive()` to `MyBaseClass`, but with this change, it
also decorates `BaseClassTwo`.

This is necessary because the Angular Compiler requires `BaseClassTwo` to
have a directive definition when it flattens the directive metadata for
`MyButton` in order to perform type checking. Technically, not decorating
`BaseClassTwo` does not break at runtime.

We basically want to enforce consistent use of `@Directive` to simplify the
mental model. [See the migration guide](https://angular.io/guide/migration-undecorated-classes#migrating-classes-that-use-field-decorators).

Fixes #34376.

PR Close #35339
2020-04-02 10:51:48 -07:00
..
BUILD.bazel fix(core): undecorated-classes-with-decorated-fields migration does not decorate derived classes (#35339) 2020-04-02 10:51:48 -07:00
dynamicQueriesRule.ts feat(core): add dynamic queries schematic (#32231) 2019-09-11 19:14:03 -04:00
explicitQueryTimingRule.ts refactor(core): move google3 migration rules into single directory (#30956) 2019-07-23 15:52:40 -07:00
noMissingInjectableRule.ts refactor(core): missing-injectable migration should respect providers of directives and components (#33011) 2019-10-14 20:24:01 +00:00
noTemplateVariableAssignmentRule.ts refactor(core): move google3 migration rules into single directory (#30956) 2019-07-23 15:52:40 -07:00
rendererToRenderer2Rule.ts refactor(core): move renderer2 migration lint rule into google3 folder (#31817) 2019-08-09 10:46:45 -07:00
undecoratedClassesWithDecoratedFieldsRule.ts fix(core): undecorated-classes-with-decorated-fields migration does not decorate derived classes (#35339) 2020-04-02 10:51:48 -07:00