From 33fd7e0784851cb9f82bccf32a2eb7fc82cfcca7 Mon Sep 17 00:00:00 2001 From: Alex Rickabaugh Date: Mon, 6 Aug 2018 15:52:26 +0200 Subject: [PATCH] fix(ivy): export NgModuleFactory via r3_symbols for core factories (#25392) When @angular/core is compiled by ngtsc, a factory file is generated for ApplicationModule, that is currently invalid because r3_symbols does not export NgModuleFactory. This change fixes that issue and ensures the generated ngfactory file for @angular/core is valid. PR Close #25392 --- packages/compiler-cli/src/ngtsc/transform/src/translator.ts | 1 + packages/core/src/r3_symbols.ts | 2 +- packages/core/test/bundling/todo/bundle.golden_symbols.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/compiler-cli/src/ngtsc/transform/src/translator.ts b/packages/compiler-cli/src/ngtsc/transform/src/translator.ts index 095e30683e..dc4b69c1f2 100644 --- a/packages/compiler-cli/src/ngtsc/transform/src/translator.ts +++ b/packages/compiler-cli/src/ngtsc/transform/src/translator.ts @@ -46,6 +46,7 @@ const CORE_SUPPORTED_SYMBOLS = new Set([ 'ɵInjectableDef', 'ɵInjectorDef', 'ɵNgModuleDef', + 'ɵNgModuleFactory', ]); export class ImportManager { diff --git a/packages/core/src/r3_symbols.ts b/packages/core/src/r3_symbols.ts index 10a3d014ee..4dc848392d 100644 --- a/packages/core/src/r3_symbols.ts +++ b/packages/core/src/r3_symbols.ts @@ -23,7 +23,7 @@ export {InjectableDef as ɵInjectableDef, InjectorDef as ɵInjectorDef, defineIn export {inject} from './di/injector'; export {NgModuleDef as ɵNgModuleDef} from './metadata/ng_module'; export {defineNgModule as ɵdefineNgModule} from './render3/definition'; - +export {NgModuleFactory as ɵNgModuleFactory} from './render3/ng_module_ref'; /** * The existence of this constant (in this particular file) informs the Angular compiler that the diff --git a/packages/core/test/bundling/todo/bundle.golden_symbols.json b/packages/core/test/bundling/todo/bundle.golden_symbols.json index 5d341add12..afc2343061 100644 --- a/packages/core/test/bundling/todo/bundle.golden_symbols.json +++ b/packages/core/test/bundling/todo/bundle.golden_symbols.json @@ -198,7 +198,7 @@ "name": "ViewEncapsulation$1" }, { - "name": "ViewRef$1" + "name": "ViewRef" }, { "name": "_CLEAN_PROMISE"