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
2
tools/public_api_guard/common/common.d.ts
vendored
2
tools/public_api_guard/common/common.d.ts
vendored
@ -446,7 +446,7 @@ export declare abstract class ViewportScroller {
|
||||
abstract scrollToPosition(position: [number, number]): void;
|
||||
abstract setHistoryScrollRestoration(scrollRestoration: 'auto' | 'manual'): void;
|
||||
abstract setOffset(offset: [number, number] | (() => [number, number])): void;
|
||||
static ngInjectableDef: never;
|
||||
static ɵprov: never;
|
||||
}
|
||||
|
||||
export declare enum WeekDay {
|
||||
|
12
tools/public_api_guard/core/core.d.ts
vendored
12
tools/public_api_guard/core/core.d.ts
vendored
@ -428,7 +428,7 @@ export interface InjectableDecorator {
|
||||
export declare type InjectableProvider = ValueSansProvider | ExistingSansProvider | StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider;
|
||||
|
||||
export interface InjectableType<T> extends Type<T> {
|
||||
ngInjectableDef: never;
|
||||
ɵprov: never;
|
||||
}
|
||||
|
||||
export interface InjectDecorator {
|
||||
@ -446,7 +446,7 @@ export declare enum InjectFlags {
|
||||
|
||||
export declare class InjectionToken<T> {
|
||||
protected _desc: string;
|
||||
readonly ngInjectableDef: never | undefined;
|
||||
readonly ɵprov: never | undefined;
|
||||
constructor(_desc: string, options?: {
|
||||
providedIn?: Type<any> | 'root' | 'platform' | 'any' | null;
|
||||
factory: () => T;
|
||||
@ -459,7 +459,7 @@ export declare abstract class Injector {
|
||||
/** @deprecated */ abstract get(token: any, notFoundValue?: any): any;
|
||||
static NULL: Injector;
|
||||
static THROW_IF_NOT_FOUND: Object;
|
||||
static ngInjectableDef: never;
|
||||
static ɵprov: never;
|
||||
/** @deprecated */ static create(providers: StaticProvider[], parent?: Injector): Injector;
|
||||
static create(options: {
|
||||
providers: StaticProvider[];
|
||||
@ -517,7 +517,7 @@ export declare class IterableDiffers {
|
||||
/** @deprecated */ factories: IterableDifferFactory[];
|
||||
constructor(factories: IterableDifferFactory[]);
|
||||
find(iterable: any): IterableDifferFactory;
|
||||
static ngInjectableDef: never;
|
||||
static ɵprov: never;
|
||||
static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers;
|
||||
static extend(factories: IterableDifferFactory[]): StaticProvider;
|
||||
}
|
||||
@ -552,7 +552,7 @@ export declare class KeyValueDiffers {
|
||||
/** @deprecated */ factories: KeyValueDifferFactory[];
|
||||
constructor(factories: KeyValueDifferFactory[]);
|
||||
find(kv: any): KeyValueDifferFactory;
|
||||
static ngInjectableDef: never;
|
||||
static ɵprov: never;
|
||||
static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers;
|
||||
static extend<S>(factories: KeyValueDifferFactory[]): StaticProvider;
|
||||
}
|
||||
@ -1270,7 +1270,7 @@ export declare function resolveForwardRef<T>(type: T): T;
|
||||
|
||||
export declare abstract class Sanitizer {
|
||||
abstract sanitize(context: SecurityContext, value: {} | string | null): string | null;
|
||||
static ngInjectableDef: never;
|
||||
static ɵprov: never;
|
||||
}
|
||||
|
||||
export interface SchemaMetadata {
|
||||
|
Reference in New Issue
Block a user