You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(compiler-cli): allow custom/duplicate decorators for @Injectable classes in local compilation mode (#54139)
Custom/duplicate decorators break the deps tracker in local mode. But deps tracker only deals with non-injectable classes. So applying custom/duplicate decorators to `@Injectable` only classes does not disturb deps tracker and local compilation in general. There are also ~ 100 such cases in g3 which cannot be cleaned up.
PR Close#54139
'In local compilation mode, Angular does not support custom decorators or duplicate Angular decorators. Ensure all class decorators are from Angular and each decorator is used at most once for each class.',
358
-
}));
346
+
// Local compilation uses the `DepsTracker` utility, which at the moment cannot track classes
347
+
// mutated by custom/duplicate decorators. So we forbid custom/duplicate decorators on classes
348
+
// used by deps tracker, i.e., Component, Directive, etc (basically everything except
349
+
// Injectable)
350
+
// TODO(b/320536434) Support custom/duplicate decorators for the DepsTracker utility.
'In local compilation mode, Angular does not support custom decorators or duplicate Angular decorators (except for `@Injectable` classes). Ensure all class decorators are from Angular and each decorator is used at most once for each class.',
369
+
}));
359
370
record.traits=foundTraits=[];
360
371
}
361
372
@@ -715,3 +726,31 @@ function containsErrors(diagnostics: ts.Diagnostic[]|null): boolean {
0 commit comments