Skip to content

Commit d412cd4

Browse files
committed
5.2. Investigate and fix size regressions
Removes usgaes of constants from `MDCRippleFoundation`. It looks like their use was preventing the class from being tree-shaken. Results after removing the constants show that the MDC-based implementation is 3kb smaller: https://github.com/mmalerba/mdc-size-comparison/blob/ee1b73a181c4a23345251656df23574140a747c0/results/size-summary.txt
1 parent 82ced0c commit d412cd4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/material-experimental/mdc-checkbox/checkbox.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import {
3636
} from '@angular/material';
3737
import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
3838
import {MDCCheckboxAdapter, MDCCheckboxFoundation} from '@material/checkbox';
39-
import {MDCRippleFoundation} from '@material/ripple';
4039

4140
let nextUniqueId = 0;
4241

@@ -202,8 +201,11 @@ export class MatCheckbox implements AfterViewInit, OnDestroy, ControlValueAccess
202201
radius: 20,
203202
centered: true,
204203
animation: {
205-
enterDuration: MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS,
206-
exitDuration: MDCRippleFoundation.numbers.FG_DEACTIVATION_MS,
204+
// TODO(mmalerba): Use the MDC constants once they are exported separately from the
205+
// foundation. Grabbing them off the foundation prevents the foundation class from being
206+
// tree-shaken.
207+
enterDuration: 225 /* MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS */,
208+
exitDuration: 150 /* MDCRippleFoundation.numbers.FG_DEACTIVATION_MS */,
207209
},
208210
},
209211
rippleDisabled: true

0 commit comments

Comments
 (0)