Skip to content

Commit 5c387a7

Browse files
rkirovmhevery
authored andcommitted
fix(compiler): do not emit line/char in ngsummary files. (#22840)
Having ngsummaries emit line/char numbers causes white space change to retrigger upstream recompilations. PR Close #22840
1 parent fc50c77 commit 5c387a7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/compiler/src/aot/summary_serializer.ts

+18
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,24 @@ class ToJsonSerializer extends ValueTransformer {
221221
}
222222
}
223223

224+
/**
225+
* Strip line and character numbers from ngsummaries.
226+
* Emitting them causes white spaces changes to retrigger upstream
227+
* recompilations in bazel.
228+
* TODO: find out a way to have line and character numbers in errors without
229+
* excessive recompilation in bazel.
230+
*/
231+
visitStringMap(map: {[key: string]: any}, context: any): any {
232+
if (map['__symbolic'] === 'resolved') {
233+
return visitValue(map.symbol, this, context);
234+
}
235+
if (map['__symbolic'] === 'error') {
236+
delete map['line'];
237+
delete map['character'];
238+
}
239+
return super.visitStringMap(map, context);
240+
}
241+
224242
/**
225243
* Returns null if the options.resolveValue is true, and the summary for the symbol
226244
* resolved to a type or could not be resolved.

0 commit comments

Comments
 (0)