Skip to content

Commit cde0b4b

Browse files
alxhubmatsko
authored andcommitted
fix(ivy): *Def types are private (ɵ) symbols (angular#24738)
On accident a few of the definition types were emitted as public API symbols. Much of the Ivy API surface is still prefixed with ɵ, indicating it's a private API. The definition types should be private for now. PR Close angular#24738
1 parent 9f20dd9 commit cde0b4b

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

packages/compiler-cli/src/ngtsc/transform/src/translator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ const CORE_SUPPORTED_SYMBOLS = new Set<string>([
3535
'ɵdefineNgModule',
3636
'inject',
3737
'InjectableDef',
38-
'InjectorDef',
39-
'NgModuleDef',
38+
'ɵInjectorDef',
39+
'ɵNgModuleDef',
4040
]);
4141

4242
export class ImportManager {

packages/compiler-cli/test/ngtsc/ngtsc_spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('ngtsc behavioral tests', () => {
144144
expect(jsContents).not.toContain('__decorate');
145145

146146
const dtsContents = getContents('test.d.ts');
147-
expect(dtsContents).toContain('static ngComponentDef: i0.ComponentDef<TestCmp, \'test-cmp\'>');
147+
expect(dtsContents).toContain('static ngComponentDef: i0.ɵComponentDef<TestCmp, \'test-cmp\'>');
148148
});
149149

150150
it('should compile Components without errors', () => {
@@ -196,9 +196,9 @@ describe('ngtsc behavioral tests', () => {
196196
'declarations: [TestCmp], imports: [], exports: [] })');
197197

198198
const dtsContents = getContents('test.d.ts');
199-
expect(dtsContents).toContain('static ngComponentDef: i0.ComponentDef<TestCmp, \'test-cmp\'>');
199+
expect(dtsContents).toContain('static ngComponentDef: i0.ɵComponentDef<TestCmp, \'test-cmp\'>');
200200
expect(dtsContents)
201-
.toContain('static ngModuleDef: i0.NgModuleDef<TestModule, [TestCmp], [], []>');
201+
.toContain('static ngModuleDef: i0.ɵNgModuleDef<TestModule, [TestCmp], [], []>');
202202
expect(dtsContents).not.toContain('__decorate');
203203
});
204204

@@ -240,8 +240,8 @@ describe('ngtsc behavioral tests', () => {
240240

241241
const dtsContents = getContents('test.d.ts');
242242
expect(dtsContents)
243-
.toContain('static ngModuleDef: i0.NgModuleDef<TestModule, [TestCmp], [OtherModule], []>');
244-
expect(dtsContents).toContain('static ngInjectorDef: i0.InjectorDef');
243+
.toContain('static ngModuleDef: i0.ɵNgModuleDef<TestModule, [TestCmp], [OtherModule], []>');
244+
expect(dtsContents).toContain('static ngInjectorDef: i0.ɵInjectorDef');
245245
});
246246

247247
it('should compile Pipes without errors', () => {
@@ -342,6 +342,6 @@ describe('ngtsc behavioral tests', () => {
342342
expect(jsContents).toContain('pipes: [TestPipe]');
343343

344344
const dtsContents = getContents('test.d.ts');
345-
expect(dtsContents).toContain('i0.NgModuleDef<TestModule, [TestPipe,TestCmp], [], []>');
345+
expect(dtsContents).toContain('i0.ɵNgModuleDef<TestModule, [TestPipe,TestCmp], [], []>');
346346
});
347347
});

packages/compiler/src/render3/r3_identifiers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class Identifiers {
104104
static defineComponent: o.ExternalReference = {name: 'ɵdefineComponent', moduleName: CORE};
105105

106106
static ComponentDef: o.ExternalReference = {
107-
name: 'ComponentDef',
107+
name: 'ɵComponentDef',
108108
moduleName: CORE,
109109
};
110110

@@ -114,12 +114,12 @@ export class Identifiers {
114114
};
115115

116116
static DirectiveDef: o.ExternalReference = {
117-
name: 'DirectiveDef',
117+
name: 'ɵDirectiveDef',
118118
moduleName: CORE,
119119
};
120120

121121
static InjectorDef: o.ExternalReference = {
122-
name: 'InjectorDef',
122+
name: 'ɵInjectorDef',
123123
moduleName: CORE,
124124
};
125125

@@ -129,7 +129,7 @@ export class Identifiers {
129129
};
130130

131131
static NgModuleDef: o.ExternalReference = {
132-
name: 'NgModuleDef',
132+
name: 'ɵNgModuleDef',
133133
moduleName: CORE,
134134
};
135135

packages/core/src/di.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
export * from './di/metadata';
16-
export {InjectableType, InjectorType, defineInjectable, defineInjector} from './di/defs';
16+
export {InjectableType, InjectorDef, InjectorType, defineInjectable, defineInjector} from './di/defs';
1717
export {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref';
1818
export {Injectable, InjectableDecorator, InjectableProvider} from './di/injectable';
1919
export {inject, InjectFlags, INJECTOR, Injector} from './di/injector';

packages/core/src/r3_symbols.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
* The below symbols are used for @Injectable and @NgModule compilation.
2020
*/
2121

22-
export {InjectableDef, InjectorDef, defineInjectable, defineInjector} from './di/defs';
22+
export {InjectableDef, InjectorDef as ɵInjectorDef, defineInjectable, defineInjector} from './di/defs';
2323
export {inject} from './di/injector';
24-
export {NgModuleDef} from './metadata/ng_module';
24+
export {NgModuleDef as ɵNgModuleDef} from './metadata/ng_module';
2525
export {defineNgModule as ɵdefineNgModule} from './render3/definition';
2626

2727

packages/core/test/render3/jit_environment_spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import {Identifiers} from '@angular/compiler/src/render3/r3_identifiers';
1212
import {angularCoreEnv} from '../../src/render3/jit/environment';
1313

1414
const INTERFACE_EXCEPTIONS = new Set<string>([
15-
'ComponentDef',
16-
'DirectiveDef',
17-
'InjectorDef',
18-
'NgModuleDef',
15+
'ɵComponentDef',
16+
'ɵDirectiveDef',
17+
'ɵInjectorDef',
18+
'ɵNgModuleDef',
1919
'ɵPipeDef',
2020
]);
2121

0 commit comments

Comments
 (0)