refactor(core): rename ngModuleDef to ɵmod (#33142)

Module 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
ngModuleDef to mod. 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 #33142
This commit is contained in:
Kara Erickson
2019-10-14 07:20:26 -07:00
committed by Miško Hevery
parent d62eff7316
commit fc93dafab1
24 changed files with 87 additions and 89 deletions

View File

@ -23,7 +23,7 @@ export interface R3NgModuleDef {
}
/**
* Metadata required by the module compiler to generate a `ngModuleDef` for a type.
* Metadata required by the module compiler to generate a module def (`ɵmod`) for a type.
*/
export interface R3NgModuleMetadata {
/**
@ -261,7 +261,7 @@ export function compileNgModuleFromRender2(
}
function accessExportScope(module: o.Expression): o.Expression {
const selectorScope = new o.ReadPropExpr(module, 'ngModuleDef');
const selectorScope = new o.ReadPropExpr(module, 'ɵmod');
return new o.ReadPropExpr(selectorScope, 'exported');
}