angular-docs-cn/packages/core/schematics/test
Paul Gschwendtner d12cdb5019 fix(migrations): do not incorrectly add todo for @Injectable or @Pipe (#37732)
As of v10, the `undecorated-classes-with-decorated-fields` migration
generally deals with undecorated classes using Angular features. We
intended to run this migation as part of v10 again as undecorated
classes with Angular features are no longer supported in planned v11.

The migration currently behaves incorrectly in some cases where an
`@Injectable` or `@Pipe` decorated classes uses the `ngOnDestroy`
lifecycle hook. We incorrectly add a TODO for those classes. This
commit fixes that.

Additionally, this change makes the migration more robust to
not migrate a class if it inherits from a component, pipe
injectable or non-abstract directive. We previously did not
need this as the undecorated-classes-with-di migration ran
before, but this is no longer the case.

Last, this commit fixes an issue where multiple TODO's could be
added. This happens when multiple Angular CLI build targets have
an overlap in source files. Multiple programs then capture the
same source file, causing the migration to detect an undecorated
class multiple times (i.e. adding a TODO twice).

Fixes #37726.

PR Close #37732
2020-06-25 14:22:08 -07:00
..
google3 fix(migrations): do not incorrectly add todo for @Injectable or @Pipe (#37732) 2020-06-25 14:22:08 -07:00
BUILD.bazel fix(core): remove ngcc postinstall migration (#33727) 2019-11-12 14:03:48 -08:00
all-migrations.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
dynamic_queries_migration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
helpers.ts fix(migrations): do not incorrectly add todo for @Injectable or @Pipe (#37732) 2020-06-25 14:22:08 -07:00
line_mappings_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
missing_injectable_migration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
module_with_providers_migration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
move_document_migration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
project_tsconfig_paths_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
renderer_to_renderer2_migration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
static_queries_migration_template_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
static_queries_migration_usage_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
template_var_assignment_migration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
undecorated_classes_with_decorated_fields_migration_spec.ts fix(migrations): do not incorrectly add todo for @Injectable or @Pipe (#37732) 2020-06-25 14:22:08 -07:00
undecorated_classes_with_di_migration_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00