fix(ivy): ngcc - fixes to support compiling Material library (#26403)
1) The `DecorationAnalyzer now analyzes all source files, rather than just the entry-point files, which fixes #26183. 2) The `DecoratorAnalyzer` now runs all the `handler.analyze()` calls across the whole entry-point *before* running `handler.compile()`. This ensures that dependencies between the decorated classes *within* an entry-point are known to the handlers when running the compile process. 3) The `Renderer` now does the transformation of the typings (.d.ts) files which allows us to support packages that only have flat format entry-points better, and is faster, since we won't parse `.d.ts` files twice. PR Close #26403
This commit is contained in:

committed by
Kara Erickson

parent
dff10085e8
commit
030d43b9f3
@ -12,12 +12,13 @@ import * as path from 'path';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
export function makeProgram(
|
||||
files: {name: string, contents: string}[], options?: ts.CompilerOptions,
|
||||
files: {name: string, contents: string, isRoot?: boolean}[], options?: ts.CompilerOptions,
|
||||
host: ts.CompilerHost = new InMemoryHost(),
|
||||
checkForErrors: boolean = true): {program: ts.Program, host: ts.CompilerHost} {
|
||||
files.forEach(file => host.writeFile(file.name, file.contents, false, undefined, []));
|
||||
|
||||
const rootNames = files.map(file => host.getCanonicalFileName(file.name));
|
||||
const rootNames =
|
||||
files.filter(file => file.isRoot !== false).map(file => host.getCanonicalFileName(file.name));
|
||||
const program = ts.createProgram(
|
||||
rootNames, {
|
||||
noLib: true,
|
||||
|
Reference in New Issue
Block a user