fix(ivy): prevent ngcc from referencing missing ɵsetClassMetadata (#27055)

When ngtsc compiles @angular/core, it rewrites core imports to the
r3_symbols.ts file that exposes all internal symbols under their
external name. When creating the FESM bundle, the r3_symbols.ts file
causes the external symbol names to be rewritten to their internal name.

Under ngcc compilations of FESM bundles, the indirection of
r3_symbols.ts is no longer in place such that the external names are
retained in the bundle. Previously, the external name `ɵdefineNgModule`
was explicitly declared internally to resolve this issue, but the
recently added `setClassMetadata` was not declared as such, causing
runtime errors.

Instead of relying on the r3_symbols.ts file to perform the rewrite of
the external modules to their internal variants, the translation is
moved into the `ImportManager` during the compilation itself. This
avoids the need for providing the external name manually.

PR Close #27055
This commit is contained in:
JoostK
2018-11-11 19:16:04 +01:00
committed by Miško Hevery
parent 8ce59a583b
commit c8c8648abf
10 changed files with 121 additions and 61 deletions

View File

@ -1420,8 +1420,5 @@
},
{
"name": "wtfLeave"
},
{
"name": "ɵdefineNgModule"
}
]

View File

@ -2704,8 +2704,5 @@
},
{
"name": "wtfLeave"
},
{
"name": "ɵdefineNgModule"
}
]