fix(bazel): pass custom bazel compiler host rather than rewriting one (#31496)
Switch back to passing a custom bazel host instead of rewriting one that is passed to `compile` now that the Angular indexer is stable. Revert "feat(bazel): allow passing and rewriting an old bazel host" This reverts commit 0a4c1c8f803a65f5c156af90e67f7d7d68ebc7f8. PR Close #31496
This commit is contained in:
parent
fac20bd8d1
commit
0c61a35ea3
@ -145,7 +145,7 @@ export function relativeToRootDirs(filePath: string, rootDirs: string[]): string
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost, bazelOpts, files,
|
export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost, bazelOpts, files,
|
||||||
inputs, expectedOuts, gatherDiagnostics, oldBazelHost}: {
|
inputs, expectedOuts, gatherDiagnostics, bazelHost}: {
|
||||||
allDepsCompiledWithBazel?: boolean,
|
allDepsCompiledWithBazel?: boolean,
|
||||||
compilerOpts: ng.CompilerOptions,
|
compilerOpts: ng.CompilerOptions,
|
||||||
tsHost: ts.CompilerHost, inputs?: {[path: string]: string},
|
tsHost: ts.CompilerHost, inputs?: {[path: string]: string},
|
||||||
@ -153,7 +153,7 @@ export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost,
|
|||||||
files: string[],
|
files: string[],
|
||||||
expectedOuts: string[],
|
expectedOuts: string[],
|
||||||
gatherDiagnostics?: (program: ng.Program) => ng.Diagnostics,
|
gatherDiagnostics?: (program: ng.Program) => ng.Diagnostics,
|
||||||
oldBazelHost?: CompilerHost,
|
bazelHost?: CompilerHost,
|
||||||
}): {diagnostics: ng.Diagnostics, program: ng.Program} {
|
}): {diagnostics: ng.Diagnostics, program: ng.Program} {
|
||||||
let fileLoader: FileLoader;
|
let fileLoader: FileLoader;
|
||||||
|
|
||||||
@ -246,12 +246,9 @@ export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost,
|
|||||||
moduleName, containingFile, compilerOptions, generatedFileModuleResolverHost);
|
moduleName, containingFile, compilerOptions, generatedFileModuleResolverHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bazelHost = new CompilerHost(
|
if (!bazelHost) {
|
||||||
|
bazelHost = new CompilerHost(
|
||||||
files, compilerOpts, bazelOpts, tsHost, fileLoader, generatedFileModuleResolver);
|
files, compilerOpts, bazelOpts, tsHost, fileLoader, generatedFileModuleResolver);
|
||||||
if (oldBazelHost) {
|
|
||||||
// TODO(ayazhafiz): this kind of patching is hacky. Revisit this after the
|
|
||||||
// indexer consumer of this code is known to be working.
|
|
||||||
Object.assign(bazelHost, oldBazelHost);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also need to disable decorator downleveling in the BazelHost in Ivy mode.
|
// Also need to disable decorator downleveling in the BazelHost in Ivy mode.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user