From cde0b4b3614656ef619be54e95a9c654dd588d51 Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Fri, 29 Jun 2018 14:17:42 -0700 Subject: [PATCH] =?UTF-8?q?fix(ivy):=20*Def=20types=20are=20private=20(?= =?UTF-8?q?=C9=B5)=20symbols=20(#24738)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #24738 --- .../src/ngtsc/transform/src/translator.ts | 4 ++-- packages/compiler-cli/test/ngtsc/ngtsc_spec.ts | 12 ++++++------ packages/compiler/src/render3/r3_identifiers.ts | 8 ++++---- packages/core/src/di.ts | 2 +- packages/core/src/r3_symbols.ts | 4 ++-- packages/core/test/render3/jit_environment_spec.ts | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/compiler-cli/src/ngtsc/transform/src/translator.ts b/packages/compiler-cli/src/ngtsc/transform/src/translator.ts index b6b3122bad..c5e8f967cd 100644 --- a/packages/compiler-cli/src/ngtsc/transform/src/translator.ts +++ b/packages/compiler-cli/src/ngtsc/transform/src/translator.ts @@ -35,8 +35,8 @@ const CORE_SUPPORTED_SYMBOLS = new Set([ 'ɵdefineNgModule', 'inject', 'InjectableDef', - 'InjectorDef', - 'NgModuleDef', + 'ɵInjectorDef', + 'ɵNgModuleDef', ]); export class ImportManager { diff --git a/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts b/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts index 1ea38268bc..e690129325 100644 --- a/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts +++ b/packages/compiler-cli/test/ngtsc/ngtsc_spec.ts @@ -144,7 +144,7 @@ describe('ngtsc behavioral tests', () => { expect(jsContents).not.toContain('__decorate'); const dtsContents = getContents('test.d.ts'); - expect(dtsContents).toContain('static ngComponentDef: i0.ComponentDef'); + expect(dtsContents).toContain('static ngComponentDef: i0.ɵComponentDef'); }); it('should compile Components without errors', () => { @@ -196,9 +196,9 @@ describe('ngtsc behavioral tests', () => { 'declarations: [TestCmp], imports: [], exports: [] })'); const dtsContents = getContents('test.d.ts'); - expect(dtsContents).toContain('static ngComponentDef: i0.ComponentDef'); + expect(dtsContents).toContain('static ngComponentDef: i0.ɵComponentDef'); expect(dtsContents) - .toContain('static ngModuleDef: i0.NgModuleDef'); + .toContain('static ngModuleDef: i0.ɵNgModuleDef'); expect(dtsContents).not.toContain('__decorate'); }); @@ -240,8 +240,8 @@ describe('ngtsc behavioral tests', () => { const dtsContents = getContents('test.d.ts'); expect(dtsContents) - .toContain('static ngModuleDef: i0.NgModuleDef'); - expect(dtsContents).toContain('static ngInjectorDef: i0.InjectorDef'); + .toContain('static ngModuleDef: i0.ɵNgModuleDef'); + expect(dtsContents).toContain('static ngInjectorDef: i0.ɵInjectorDef'); }); it('should compile Pipes without errors', () => { @@ -342,6 +342,6 @@ describe('ngtsc behavioral tests', () => { expect(jsContents).toContain('pipes: [TestPipe]'); const dtsContents = getContents('test.d.ts'); - expect(dtsContents).toContain('i0.NgModuleDef'); + expect(dtsContents).toContain('i0.ɵNgModuleDef'); }); }); diff --git a/packages/compiler/src/render3/r3_identifiers.ts b/packages/compiler/src/render3/r3_identifiers.ts index a2fb852395..12f6375229 100644 --- a/packages/compiler/src/render3/r3_identifiers.ts +++ b/packages/compiler/src/render3/r3_identifiers.ts @@ -104,7 +104,7 @@ export class Identifiers { static defineComponent: o.ExternalReference = {name: 'ɵdefineComponent', moduleName: CORE}; static ComponentDef: o.ExternalReference = { - name: 'ComponentDef', + name: 'ɵComponentDef', moduleName: CORE, }; @@ -114,12 +114,12 @@ export class Identifiers { }; static DirectiveDef: o.ExternalReference = { - name: 'DirectiveDef', + name: 'ɵDirectiveDef', moduleName: CORE, }; static InjectorDef: o.ExternalReference = { - name: 'InjectorDef', + name: 'ɵInjectorDef', moduleName: CORE, }; @@ -129,7 +129,7 @@ export class Identifiers { }; static NgModuleDef: o.ExternalReference = { - name: 'NgModuleDef', + name: 'ɵNgModuleDef', moduleName: CORE, }; diff --git a/packages/core/src/di.ts b/packages/core/src/di.ts index 1e6b201b84..0a776ced01 100644 --- a/packages/core/src/di.ts +++ b/packages/core/src/di.ts @@ -13,7 +13,7 @@ */ export * from './di/metadata'; -export {InjectableType, InjectorType, defineInjectable, defineInjector} from './di/defs'; +export {InjectableType, InjectorDef, InjectorType, defineInjectable, defineInjector} from './di/defs'; export {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref'; export {Injectable, InjectableDecorator, InjectableProvider} from './di/injectable'; export {inject, InjectFlags, INJECTOR, Injector} from './di/injector'; diff --git a/packages/core/src/r3_symbols.ts b/packages/core/src/r3_symbols.ts index e76e2d02e9..ab344a1f06 100644 --- a/packages/core/src/r3_symbols.ts +++ b/packages/core/src/r3_symbols.ts @@ -19,9 +19,9 @@ * The below symbols are used for @Injectable and @NgModule compilation. */ -export {InjectableDef, InjectorDef, defineInjectable, defineInjector} from './di/defs'; +export {InjectableDef, InjectorDef as ɵInjectorDef, defineInjectable, defineInjector} from './di/defs'; export {inject} from './di/injector'; -export {NgModuleDef} from './metadata/ng_module'; +export {NgModuleDef as ɵNgModuleDef} from './metadata/ng_module'; export {defineNgModule as ɵdefineNgModule} from './render3/definition'; diff --git a/packages/core/test/render3/jit_environment_spec.ts b/packages/core/test/render3/jit_environment_spec.ts index ea7e22b898..134970bdd6 100644 --- a/packages/core/test/render3/jit_environment_spec.ts +++ b/packages/core/test/render3/jit_environment_spec.ts @@ -12,10 +12,10 @@ import {Identifiers} from '@angular/compiler/src/render3/r3_identifiers'; import {angularCoreEnv} from '../../src/render3/jit/environment'; const INTERFACE_EXCEPTIONS = new Set([ - 'ComponentDef', - 'DirectiveDef', - 'InjectorDef', - 'NgModuleDef', + 'ɵComponentDef', + 'ɵDirectiveDef', + 'ɵInjectorDef', + 'ɵNgModuleDef', 'ɵPipeDef', ]);