refactor(compiler): don’t write summaries for jit by default
The default is false externally but true internally at Google.
This commit is contained in:

committed by
Alex Rickabaugh

parent
d56b7ed96d
commit
90b0713e32
@ -35,7 +35,8 @@ export class AotCompiler {
|
||||
private _viewCompiler: ViewCompiler, private _ngModuleCompiler: NgModuleCompiler,
|
||||
private _outputEmitter: OutputEmitter,
|
||||
private _summaryResolver: SummaryResolver<StaticSymbol>, private _localeId: string|null,
|
||||
private _translationFormat: string|null, private _symbolResolver: StaticSymbolResolver) {}
|
||||
private _translationFormat: string|null, private _enableSummariesForJit: boolean|null,
|
||||
private _symbolResolver: StaticSymbolResolver) {}
|
||||
|
||||
clearCache() { this._metadataResolver.clearCache(); }
|
||||
|
||||
@ -204,10 +205,12 @@ export class AotCompiler {
|
||||
o.StmtModifier.Exported
|
||||
]));
|
||||
});
|
||||
return [
|
||||
new GeneratedFile(srcFileUrl, summaryFileName(srcFileUrl), json),
|
||||
this._codegenSourceModule(srcFileUrl, forJitOutputCtx)
|
||||
];
|
||||
const summaryJson = new GeneratedFile(srcFileUrl, summaryFileName(srcFileUrl), json);
|
||||
if (this._enableSummariesForJit) {
|
||||
return [summaryJson, this._codegenSourceModule(srcFileUrl, forJitOutputCtx)];
|
||||
};
|
||||
|
||||
return [summaryJson];
|
||||
}
|
||||
|
||||
private _compileModule(outputCtx: OutputContext, ngModuleType: StaticSymbol): void {
|
||||
|
@ -70,6 +70,7 @@ export function createAotCompiler(compilerHost: AotCompilerHost, options: AotCom
|
||||
const compiler = new AotCompiler(
|
||||
config, compilerHost, staticReflector, resolver, tmplParser, new StyleCompiler(urlResolver),
|
||||
viewCompiler, new NgModuleCompiler(staticReflector), new TypeScriptEmitter(), summaryResolver,
|
||||
options.locale || null, options.i18nFormat || null, symbolResolver);
|
||||
options.locale || null, options.i18nFormat || null, options.enableSummariesForJit || null,
|
||||
symbolResolver);
|
||||
return {compiler, reflector: staticReflector};
|
||||
}
|
||||
|
@ -14,4 +14,5 @@ export interface AotCompilerOptions {
|
||||
translations?: string;
|
||||
missingTranslation?: MissingTranslationStrategy;
|
||||
enableLegacyTemplate?: boolean;
|
||||
enableSummariesForJit?: boolean
|
||||
}
|
||||
|
Reference in New Issue
Block a user