Skip to content
Permalink
Browse files

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 0a4c1c8.

PR Close #31496
  • Loading branch information...
ayazhafiz authored and matsko committed Jul 10, 2019
1 parent fac20bd commit 0c61a35ea3d86d0a0cd7a46e5446f1f7f0956702
Showing with 5 additions and 8 deletions.
  1. +5 −8 packages/bazel/src/ngc-wrapped/index.ts
@@ -145,15 +145,15 @@ export function relativeToRootDirs(filePath: string, rootDirs: string[]): string
}

export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost, bazelOpts, files,
inputs, expectedOuts, gatherDiagnostics, oldBazelHost}: {
inputs, expectedOuts, gatherDiagnostics, bazelHost}: {
allDepsCompiledWithBazel?: boolean,
compilerOpts: ng.CompilerOptions,
tsHost: ts.CompilerHost, inputs?: {[path: string]: string},
bazelOpts: BazelOptions,
files: string[],
expectedOuts: string[],
gatherDiagnostics?: (program: ng.Program) => ng.Diagnostics,
oldBazelHost?: CompilerHost,
bazelHost?: CompilerHost,
}): {diagnostics: ng.Diagnostics, program: ng.Program} {
let fileLoader: FileLoader;

@@ -246,12 +246,9 @@ export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost,
moduleName, containingFile, compilerOptions, generatedFileModuleResolverHost);
}

const bazelHost = new CompilerHost(
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);
if (!bazelHost) {
bazelHost = new CompilerHost(
files, compilerOpts, bazelOpts, tsHost, fileLoader, generatedFileModuleResolver);
}

// Also need to disable decorator downleveling in the BazelHost in Ivy mode.

0 comments on commit 0c61a35

Please sign in to comment.
You can’t perform that action at this time.