angular-cn/packages/core
Paul Gschwendtner c6ecdc9a81 feat(core): undecorated-classes-with-decorated-fields migration should handle classes with lifecycle hooks (#36921)
As of v10, undecorated classes using Angular features are no longer
supported. In v10, we plan on removing the undecorated classes
compatibility code in ngtsc. This means that old patterns for
undecorated classes will result in compilation errors.

We had a migration for this in v9 already, but it looks like
the migration does not handle cases where classes uses lifecycle
hooks. This is handled in the ngtsc compatibility code, and we
should handle it similarly in migrations too.

This has not been outlined in the migration plan initially,
but an appendix has been added for v10 to the plan document.

https://hackmd.io/vuQfavzfRG6KUCtU7oK_EA?both.

Note: The migration is unable to determine whether a given undecorated
class that only defines `ngOnDestroy` is a directive or an actual
service. This means that in some cases the migration cannot do
more than adding a TODO and printing an failure.

Certainly there are more ways to determine the type of such classes,
but it would involve metadata and NgModule analysis. This is out of
scope for this migration.

PR Close #36921
2020-05-06 15:06:10 -07:00
..
global docs(ivy): document global debugging utilities and clean up API (#34453) 2020-01-30 11:30:32 -08:00
schematics feat(core): undecorated-classes-with-decorated-fields migration should handle classes with lifecycle hooks (#36921) 2020-05-06 15:06:10 -07:00
src refactor(core): make generic mandatory for ModuleWithProviders (#36892) 2020-05-06 15:01:34 -07:00
test refactor: disable sanitization for [style] and [style.prop] bindings (#35621) 2020-05-06 15:00:22 -07:00
testing build: simplify package.jsons for all of our packages (#36944) 2020-05-06 13:54:26 -07:00
BUILD.bazel build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
PACKAGE.md docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
index.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
package.json build: simplify package.jsons for all of our packages (#36944) 2020-05-06 13:54:26 -07:00
public_api.ts build: publish tree of files rather than FESMs (#18541) 2017-08-31 15:34:50 -07:00