refactor(ngcc): store whether to render legacy i18n message ids in the bundle (#34135)

Placing this configuration in to the bundle avoids having to pass the
value around through lots of function calls, but also could enable
support for different behaviour per bundle in the future.

PR Close #34135
This commit is contained in:
Pete Bacon Darwin
2019-12-03 08:36:38 +00:00
committed by Miško Hevery
parent e524322c43
commit cebe49d3c9
4 changed files with 19 additions and 8 deletions

View File

@ -39,13 +39,18 @@ export function makeTestEntryPoint(
*/
export function makeTestEntryPointBundle(
packageName: string, format: EntryPointFormat, isCore: boolean, srcRootNames: AbsoluteFsPath[],
dtsRootNames?: AbsoluteFsPath[], config?: TestConfig): EntryPointBundle {
dtsRootNames?: AbsoluteFsPath[], config?: TestConfig,
enableI18nLegacyMessageIdFormat = false): EntryPointBundle {
const entryPoint = makeTestEntryPoint(packageName, packageName, config);
const src = makeTestBundleProgram(srcRootNames[0], isCore);
const dts =
dtsRootNames ? makeTestDtsBundleProgram(dtsRootNames[0], entryPoint.package, isCore) : null;
const isFlatCore = isCore && src.r3SymbolsFile === null;
return {entryPoint, format, rootDirs: [absoluteFrom('/')], src, dts, isCore, isFlatCore};
return {
entryPoint,
format,
rootDirs: [absoluteFrom('/')], src, dts, isCore, isFlatCore, enableI18nLegacyMessageIdFormat
};
}
export function makeTestBundleProgram(