mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor(core): rename ngPipeDef to ɵpipe (#33142)
Pipe 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
ngPipeDef to pipe. 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:
committed by
Miško Hevery
parent
f433d6604b
commit
d62eff7316
@@ -119,7 +119,7 @@ export class PipeDecoratorHandler implements DecoratorHandler<PipeHandlerData, D
|
||||
}
|
||||
return [
|
||||
factoryRes, {
|
||||
name: 'ngPipeDef',
|
||||
name: 'ɵpipe',
|
||||
initializer: res.expression,
|
||||
statements: [],
|
||||
type: res.type,
|
||||
|
||||
@@ -102,7 +102,7 @@ export class DtsMetadataReader implements MetadataReader {
|
||||
*/
|
||||
getPipeMetadata(ref: Reference<ClassDeclaration>): PipeMeta|null {
|
||||
const def = this.reflector.getMembersOfClass(ref.node).find(
|
||||
field => field.isStatic && field.name === 'ngPipeDef');
|
||||
field => field.isStatic && field.name === 'ɵpipe');
|
||||
if (def === undefined) {
|
||||
// No definition could be found.
|
||||
return null;
|
||||
|
||||
@@ -25,7 +25,7 @@ const R3_DEF_NAME_PATTERN = [
|
||||
'ngInjectableDef',
|
||||
'ngInjectorDef',
|
||||
'ngModuleDef',
|
||||
'ngPipeDef',
|
||||
'ɵpipe',
|
||||
'ɵfac',
|
||||
].join('|');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user