feat(ivy): avoid unnecessary recompilations in TestBed (#29294)
Prior to this change, we always recompile all Components/Directives/Pipes even if they were AOT-compiled and had no overrides. This is causing problems in case we try to recompile a Component with "templateUrl" or "styleUrls" (which were already resolved in case of AOT) and generally this unnecessary work that TestBed was doing is not required. This commit adds extra logic to check whether a Component/Directive/Pipe already have compiled NG def (like ngComponentDef) and whether there are no overrides present - in this case recompilation is skipped. Recompilation is also skipped in case a Component/Directive has only Provider overrides - in this situation providers resolver function is patched to reflect overrides. Provider overrides are very common in g3, thus this code path ensures no full recompilation. PR Close #29294
This commit is contained in:

committed by
Matias Niemelä

parent
86aba1e8f3
commit
0244a2433e
@ -144,9 +144,7 @@ if (isBrowser) {
|
||||
});
|
||||
}),
|
||||
10000); // Long timeout here because this test makes an actual ResourceLoader
|
||||
// request, and
|
||||
// is slow
|
||||
// on Edge.
|
||||
// request, and is slow on Edge.
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user