refactor(core): make Testability compatible with tree-shaking (#45657)

This commit refactors the `Testability`-related logic to extract the necessary providers into a separate array, so that it can later become it's own NgModule (or exposed as an array of providers) and be excluded from the new APIs by default.

PR Close #45657
This commit is contained in:
Andrew Kushnir
2022-04-15 18:29:11 -07:00
parent d380bb49b7
commit c9b40b5100
16 changed files with 149 additions and 67 deletions
+1 -2
View File
@@ -1272,7 +1272,7 @@ export abstract class TemplateRef<C> {
// @public
export class Testability implements PublicTestability {
constructor(_ngZone: NgZone);
constructor(_ngZone: NgZone, registry: TestabilityRegistry, testabilityGetter: GetTestability);
// @deprecated
decreasePendingRequestCount(): number;
findProviders(using: any, provider: string, exactMatch: boolean): any[];
@@ -1290,7 +1290,6 @@ export class Testability implements PublicTestability {
// @public
export class TestabilityRegistry {
constructor();
findTestabilityInTree(elem: Node, findInAncestors?: boolean): Testability | null;
getAllRootElements(): any[];
getAllTestabilities(): Testability[];
+1 -1
View File
@@ -12,7 +12,7 @@
"aio-local": {
"uncompressed": {
"runtime": 4343,
"main": 454248,
"main": 454794,
"polyfills": 33980,
"styles": 71714,
"light-theme": 78213,
@@ -2,7 +2,7 @@
"cli-hello-world": {
"uncompressed": {
"runtime": 1083,
"main": 126738,
"main": 126542,
"polyfills": 33824
}
},
@@ -19,7 +19,7 @@
"cli-hello-world-ivy-compat": {
"uncompressed": {
"runtime": 1102,
"main": 133348,
"main": 133968,
"polyfills": 33957
}
},
@@ -41,7 +41,7 @@
"forms": {
"uncompressed": {
"runtime": 1063,
"main": 158922,
"main": 159280,
"polyfills": 33804
}
},