Skip to content

Commit 21e646a

Browse files
devversionvivian-hu-zz
authored andcommitted
build: remove es2015 workaround (#14066)
With two commits (2adced1 and a22a9fa), we recently tried to add a workaround for an Angular bug that causes Angular Material to not work w/ ES2015. The workaround technically worked but had to be partially reverted because Google Closure compiler was no longer able to remove unused classes (due to a function with side-effects that modified the actual component metadata). Since the workaround (in the state it is right now) is not helping at all and a fix will land with Angular `v7.1.0` (angular/angular@95743e3) Closes #12760
1 parent b1d4b42 commit 21e646a

File tree

12 files changed

+0
-44
lines changed

12 files changed

+0
-44
lines changed

src/lib/input/autosize.ts

-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,3 @@ export class MatTextareaAutosize extends CdkTextareaAutosize {
4343
get matTextareaAutosize(): boolean { return this.enabled; }
4444
set matTextareaAutosize(value: boolean) { this.enabled = value; }
4545
}
46-
47-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
48-
(MatTextareaAutosize as any)['ctorParameters'] = () =>
49-
(CdkTextareaAutosize as any)['ctorParameters'];

src/lib/stepper/step-label.ts

-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,3 @@ import {CdkStepLabel} from '@angular/cdk/stepper';
1313
selector: '[matStepLabel]',
1414
})
1515
export class MatStepLabel extends CdkStepLabel {}
16-
17-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
18-
(MatStepLabel as any)['ctorParameters'] = () => (CdkStepLabel as any)['ctorParameters'];

src/lib/stepper/stepper-button.ts

-5
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,3 @@ export class MatStepperNext extends CdkStepperNext {}
3333
providers: [{provide: CdkStepper, useExisting: MatStepper}]
3434
})
3535
export class MatStepperPrevious extends CdkStepperPrevious {}
36-
37-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
38-
(MatStepperNext as any)['ctorParameters'] = () => (CdkStepperNext as any)['ctorParameters'];
39-
(MatStepperPrevious as any)['ctorParameters'] = () =>
40-
(CdkStepperPrevious as any)['ctorParameters'];

src/lib/stepper/stepper.ts

-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ export class MatStepper extends CdkStepper implements AfterContentInit {
123123
}
124124
}
125125

126-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
127-
(MatStepper as any)['ctorParameters'] = () => (CdkStepper as any)['ctorParameters'];
128-
129126
@Component({
130127
moduleId: module.id,
131128
selector: 'mat-horizontal-stepper',

src/lib/table/cell.ts

-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ export class MatHeaderCellDef extends CdkHeaderCellDef {}
4545
})
4646
export class MatFooterCellDef extends CdkFooterCellDef {}
4747

48-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
49-
(MatCellDef as any)['ctorParameters'] = () => (CdkCellDef as any)['ctorParameters'];
50-
(MatHeaderCellDef as any)['ctorParameters'] = () => (CdkHeaderCellDef as any)['ctorParameters'];
51-
(MatFooterCellDef as any)['ctorParameters'] = () => (MatFooterCellDef as any)['ctorParameters'];
52-
5348
/**
5449
* Column definition for the mat-table.
5550
* Defines a set of cells available for a table column.

src/lib/table/row.ts

-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,6 @@ export class MatFooterRowDef extends CdkFooterRowDef {}
5454
})
5555
export class MatRowDef<T> extends CdkRowDef<T> {}
5656

57-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
58-
(MatHeaderRowDef as any)['ctorParameters'] = () => (CdkHeaderRowDef as any)['ctorParameters'];
59-
(MatFooterRowDef as any)['ctorParameters'] = () => (CdkFooterRowDef as any)['ctorParameters'];
60-
(MatRowDef as any)['ctorParameters'] = () => (CdkRowDef as any)['ctorParameters'];
61-
6257
/** Footer template container that contains the cell outlet. Adds the right class and role. */
6358
@Component({
6459
moduleId: module.id,

src/lib/table/table.ts

-3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,3 @@ export class MatTable<T> extends CdkTable<T> {
2828
/** Overrides the sticky CSS class set by the `CdkTable`. */
2929
protected stickyCssClass = 'mat-table-sticky';
3030
}
31-
32-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
33-
(MatTable as any)['ctorParameters'] = () => (CdkTable as any)['ctorParameters'];

src/lib/tabs/tab-label.ts

-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,3 @@ import {CdkPortal} from '@angular/cdk/portal';
1414
selector: '[mat-tab-label], [matTabLabel]',
1515
})
1616
export class MatTabLabel extends CdkPortal {}
17-
18-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
19-
(MatTabLabel as any)['ctorParameters'] = () => (CdkPortal as any)['ctorParameters'];

src/lib/tree/node.ts

-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ export class MatTreeNodeDef<T> extends CdkTreeNodeDef<T> {
7676
@Input('matTreeNode') data: T;
7777
}
7878

79-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
80-
(MatTreeNodeDef as any)['ctorParameters'] = () => (CdkTreeNodeDef as any)['ctorParameters'];
81-
8279
/**
8380
* Wrapper for the CdkTree nested node with Material design styles.
8481
*/

src/lib/tree/padding.ts

-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,3 @@ export class MatTreeNodePadding<T> extends CdkTreeNodePadding<T> {
2323
/** The indent for each level. Default number 40px from material design menu sub-menu spec. */
2424
@Input('matTreeNodePaddingIndent') indent: number;
2525
}
26-
27-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
28-
(MatTreeNodePadding as any)['ctorParameters'] = () =>
29-
(CdkTreeNodePadding as any)['ctorParameters'];

src/lib/tree/toggle.ts

-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,3 @@ import {Directive, Input} from '@angular/core';
2222
export class MatTreeNodeToggle<T> extends CdkTreeNodeToggle<T> {
2323
@Input('matTreeNodeToggleRecursive') recursive: boolean = false;
2424
}
25-
26-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
27-
(MatTreeNodeToggle as any)['ctorParameters'] = () => (CdkTreeNodeToggle as any)['ctorParameters'];

src/lib/tree/tree.ts

-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,3 @@ export class MatTree<T> extends CdkTree<T> {
3131
// Outlets within the tree's template where the dataNodes will be inserted.
3232
@ViewChild(MatTreeNodeOutlet) _nodeOutlet: MatTreeNodeOutlet;
3333
}
34-
35-
// TODO(devversion): workaround for https://github.com/angular/material2/issues/12760
36-
(MatTree as any)['ctorParameters'] = () => (CdkTree as any)['ctorParameters'];

0 commit comments

Comments
 (0)