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
@ -125,14 +125,14 @@ describe('ngInjectableDef Bazel Integration', () => {
|
||||
expect(TestBed.inject(Service).value).toEqual('overridden');
|
||||
});
|
||||
|
||||
it('does not override existing ngInjectableDef', () => {
|
||||
it('does not override existing ɵprov', () => {
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
useValue: new Service(false),
|
||||
})
|
||||
class Service {
|
||||
constructor(public value: boolean) {}
|
||||
static ngInjectableDef = {
|
||||
static ɵprov = {
|
||||
providedIn: 'root',
|
||||
factory: () => new Service(true),
|
||||
token: Service,
|
||||
@ -143,7 +143,7 @@ describe('ngInjectableDef Bazel Integration', () => {
|
||||
expect(TestBed.inject(Service).value).toEqual(true);
|
||||
});
|
||||
|
||||
it('does not override existing ngInjectableDef in case of inheritance', () => {
|
||||
it('does not override existing ɵprov in case of inheritance', () => {
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
useValue: new ParentService(false),
|
||||
|
Reference in New Issue
Block a user