refactor(core): rename ngFactoryDef to ɵfac (#33116)
Factory 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 ngFactoryDef to fac. 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" (ngPipeDef, 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 #33116
This commit is contained in:

committed by
Miško Hevery

parent
c3aaa5211e
commit
0de2a5e408
@ -117,8 +117,8 @@ export function compileInjectable(meta: R3InjectableMetadata): InjectableDef {
|
||||
function delegateToFactory(type: o.Expression) {
|
||||
return {
|
||||
statements: [],
|
||||
// () => meta.type.ngFactoryDef(t)
|
||||
// () => meta.type.ɵfac(t)
|
||||
factory: o.fn([new o.FnParam('t', o.DYNAMIC_TYPE)], [new o.ReturnStatement(type.callMethod(
|
||||
'ngFactoryDef', [o.variable('t')]))])
|
||||
'ɵfac', [o.variable('t')]))])
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user