angular-docs-cn/integration/ng_update_migrations
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
..
src fix(migrations): do not incorrectly add todo for @Injectable or @Pipe (#37732) 2020-06-25 14:22:08 -07:00
.gitignore build: create integration test for ng-update migrations (#32349) 2019-08-29 12:34:43 -07:00
README.md build: create integration test for ng-update migrations (#32349) 2019-08-29 12:34:43 -07:00
angular.json build: create integration test for ng-update migrations (#32349) 2019-08-29 12:34:43 -07:00
browserslist build: create integration test for ng-update migrations (#32349) 2019-08-29 12:34:43 -07:00
karma.conf.js build: create integration test for ng-update migrations (#32349) 2019-08-29 12:34:43 -07:00
package.json build: add npm_integration_test && angular_integration_test (#33927) 2020-02-24 08:59:18 -08:00
test.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
tsconfig.app.json build: create integration test for ng-update migrations (#32349) 2019-08-29 12:34:43 -07:00
tsconfig.json build: create integration test for ng-update migrations (#32349) 2019-08-29 12:34:43 -07:00
tsconfig.spec.json build: create integration test for ng-update migrations (#32349) 2019-08-29 12:34:43 -07:00
yarn.lock test: add integration test for undecorated-classes-with-decorated-fields migration (#35339) 2020-04-02 10:51:48 -07:00

README.md

NgUpdateMigrations

This project was generated with Angular CLI version 8.0.0-beta.15.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.