perf(ivy): ngcc - only render .d.ts analysis when necessary (#26403)

For each package entry-point there is only one format that
is used to compile the typings files (.d.ts). This will be
either esm2015 or fesm2015 (preferred). So we would not run
any dts processing in the renderer if we are not compiling
the appropriate format.

PR Close #26403
This commit is contained in:
Pete Bacon Darwin
2018-10-16 09:46:59 +01:00
committed by Kara Erickson
parent 603e7935aa
commit 2f30bbb495
6 changed files with 15 additions and 13 deletions

View File

@ -23,7 +23,7 @@ function setup(file: {name: string, contents: string}, transformDts: boolean = f
const decorationAnalyses =
new DecorationAnalyzer(program.getTypeChecker(), host, [''], false).analyzeProgram(program);
const switchMarkerAnalyses = new SwitchMarkerAnalyzer(host).analyzeProgram(program);
const renderer = new EsmRenderer(host, false, null, dir, dir);
const renderer = new EsmRenderer(host, false, null, dir, dir, false);
return {host, program, sourceFile, renderer, decorationAnalyses, switchMarkerAnalyses};
}

View File

@ -20,7 +20,7 @@ function setup(file: {name: string, contents: string}) {
const decorationAnalyses =
new DecorationAnalyzer(program.getTypeChecker(), host, [''], false).analyzeProgram(program);
const switchMarkerAnalyses = new SwitchMarkerAnalyzer(host).analyzeProgram(program);
const renderer = new EsmRenderer(host, false, null, '', '');
const renderer = new EsmRenderer(host, false, null, '', '', false);
return {host, program, sourceFile, renderer, decorationAnalyses, switchMarkerAnalyses};
}

View File

@ -17,7 +17,7 @@ import {Esm2015ReflectionHost} from '../../src/host/esm2015_host';
import {Renderer} from '../../src/rendering/renderer';
class TestRenderer extends Renderer {
constructor(host: Esm2015ReflectionHost) { super(host, false, null, '/src', '/dist'); }
constructor(host: Esm2015ReflectionHost) { super(host, false, null, '/src', '/dist', false); }
addImports(output: MagicString, imports: {name: string, as: string}[]) {
output.prepend('\n// ADD IMPORTS\n');
}