Skip to content

Commit 0c61a35

Browse files
ayazhafizmatsko
authored andcommittedJul 12, 2019
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
1 parent fac20bd commit 0c61a35

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed
 

‎packages/bazel/src/ngc-wrapped/index.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ export function relativeToRootDirs(filePath: string, rootDirs: string[]): string
145145
}
146146

147147
export function compile({allDepsCompiledWithBazel = true, compilerOpts, tsHost, bazelOpts, files,
148-
inputs, expectedOuts, gatherDiagnostics, oldBazelHost}: {
148+
inputs, expectedOuts, gatherDiagnostics, bazelHost}: {
149149
allDepsCompiledWithBazel?: boolean,
150150
compilerOpts: ng.CompilerOptions,
151151
tsHost: ts.CompilerHost, inputs?: {[path: string]: string},
152152
bazelOpts: BazelOptions,
153153
files: string[],
154154
expectedOuts: string[],
155155
gatherDiagnostics?: (program: ng.Program) => ng.Diagnostics,
156-
oldBazelHost?: CompilerHost,
156+
bazelHost?: CompilerHost,
157157
}): {diagnostics: ng.Diagnostics, program: ng.Program} {
158158
let fileLoader: FileLoader;
159159

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

249-
const bazelHost = new CompilerHost(
250-
files, compilerOpts, bazelOpts, tsHost, fileLoader, generatedFileModuleResolver);
251-
if (oldBazelHost) {
252-
// TODO(ayazhafiz): this kind of patching is hacky. Revisit this after the
253-
// indexer consumer of this code is known to be working.
254-
Object.assign(bazelHost, oldBazelHost);
249+
if (!bazelHost) {
250+
bazelHost = new CompilerHost(
251+
files, compilerOpts, bazelOpts, tsHost, fileLoader, generatedFileModuleResolver);
255252
}
256253

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

0 commit comments

Comments
 (0)
Please sign in to comment.