Directive defs are not considered public API, so the property
that contains them should be prefixed with Angular's marker
for "private" ('ɵ') to discourage apps from relying on def
APIs directly.
This commit adds the prefix and shortens the name from
ngDirectiveDef to dir. This is because property names
cannot be minified by Uglify without turning on property
mangling (which most apps have turned off) and are thus
size-sensitive.
Note that the other "defs" (ngFactoryDef, etc) will be
prefixed and shortened in follow-up PRs, in an attempt to
limit how large and conflict-y this change is.
PR Close #33110
ngcc migrations
There are some cases where source code needs to be migrated before ngtsc can compile it correctly.
For example, there are cases where ngtsc expects directives need to be explicitly attached to classes, whereas previously they were not required.
There are two ways this can happen:
- in a project being developed, the code can be migrated via a CLI schematic.
- in a package already published to npm, the code can be migrated as part of the ngcc compilation.
To create one of these migrations for ngcc, you should implement the Migration interface and add
an instance of the class to the DecorationAnalyzer.migrations collection.
This folder is where we keep the Migration interface and the implemented migrations.
Each migration should have a unit test stored in the ../../test/migrations directory.