refactor(core): rename ngInjectableDef to ɵprov (#33151)
Injectable 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 ngInjectableDef to "prov" (for "provider", since injector defs are known as "inj"). 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. PR Close #33151
This commit is contained in:

committed by
Matias Niemelä

parent
cda9248b33
commit
86104b82b8
@ -9,7 +9,7 @@ This document details the new architecture of the Angular compiler in a post-Ivy
|
||||
|
||||
### The Ivy Compilation Model
|
||||
|
||||
Broadly speaking, The Ivy model is that Angular decorators (`@Injectable`, etc) are compiled to static properties on the classes (`ngInjectableDef`). This operation must take place without global program knowledge, and in most cases only with knowledge of that single decorator.
|
||||
Broadly speaking, The Ivy model is that Angular decorators (`@Injectable`, etc) are compiled to static properties on the classes (`ɵprov`). This operation must take place without global program knowledge, and in most cases only with knowledge of that single decorator.
|
||||
|
||||
The one exception is `@Component`, which requires knowledge of the metadata from the `@NgModule` which declares the component in order to properly generate the component def (`ɵcmp`). In particular, the selectors which are applicable during compilation of a component template are determined by the module that declares that component, and the transitive closure of the exports of that module's imports.
|
||||
|
||||
|
@ -87,7 +87,7 @@ class:
|
||||
|
||||
Only one definition is generated per class. All components are directives so a
|
||||
`ɵcmp` contains all the `ɵdir` information. All directives
|
||||
are injectable so `ɵcmp` and `ɵdir` contain `ngInjectableDef`
|
||||
are injectable so `ɵcmp` and `ɵdir` contain `ɵprov`
|
||||
information.
|
||||
|
||||
For `CompilePipeSummary` the table looks like:
|
||||
|
Reference in New Issue
Block a user