Skip to content

Commit 68e7bd0

Browse files
authored
refactor(multiple): remove PlatformModule usages (#24366)
The `PlatformModule` is a noop so we don't need to import it.
1 parent 6cc1833 commit 68e7bd0

File tree

13 files changed

+16
-36
lines changed

13 files changed

+16
-36
lines changed

src/cdk/a11y/a11y-module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
*/
88

99
import {ObserversModule} from '@angular/cdk/observers';
10-
import {PlatformModule} from '@angular/cdk/platform';
1110
import {NgModule} from '@angular/core';
1211
import {CdkMonitorFocus} from './focus-monitor/focus-monitor';
1312
import {CdkTrapFocus} from './focus-trap/focus-trap';
1413
import {HighContrastModeDetector} from './high-contrast-mode/high-contrast-mode-detector';
1514
import {CdkAriaLive} from './live-announcer/live-announcer';
1615

1716
@NgModule({
18-
imports: [PlatformModule, ObserversModule],
17+
imports: [ObserversModule],
1918
declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
2019
exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
2120
})

src/cdk/scrolling/scrolling-module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import {BidiModule} from '@angular/cdk/bidi';
10-
import {PlatformModule} from '@angular/cdk/platform';
1110
import {NgModule} from '@angular/core';
1211
import {CdkFixedSizeVirtualScroll} from './fixed-size-virtual-scroll';
1312
import {CdkScrollable} from './scrollable';
@@ -24,7 +23,7 @@ export class CdkScrollableModule {}
2423
* @docs-primary-export
2524
*/
2625
@NgModule({
27-
imports: [BidiModule, PlatformModule, CdkScrollableModule],
26+
imports: [BidiModule, CdkScrollableModule],
2827
exports: [
2928
BidiModule,
3029
CdkScrollableModule,

src/cdk/text-field/text-field-module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {PlatformModule} from '@angular/cdk/platform';
109
import {NgModule} from '@angular/core';
1110
import {CdkAutofill} from './autofill';
1211
import {CdkTextareaAutosize} from './autosize';
1312

1413
@NgModule({
1514
declarations: [CdkAutofill, CdkTextareaAutosize],
16-
imports: [PlatformModule],
1715
exports: [CdkAutofill, CdkTextareaAutosize],
1816
})
1917
export class TextFieldModule {}

src/components-examples/cdk/platform/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {PlatformModule} from '@angular/cdk/platform';
21
import {NgModule} from '@angular/core';
32
import {CdkPlatformOverviewExample} from './cdk-platform-overview/cdk-platform-overview-example';
43

@@ -7,7 +6,6 @@ export {CdkPlatformOverviewExample};
76
const EXAMPLES = [CdkPlatformOverviewExample];
87

98
@NgModule({
10-
imports: [PlatformModule],
119
declarations: EXAMPLES,
1210
exports: EXAMPLES,
1311
})

src/dev-app/platform/platform-demo-module.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {PlatformModule} from '@angular/cdk/platform';
109
import {CommonModule} from '@angular/common';
1110
import {NgModule} from '@angular/core';
1211
import {RouterModule} from '@angular/router';
1312
import {PlatformDemo} from './platform-demo';
1413

1514
@NgModule({
16-
imports: [
17-
CommonModule,
18-
PlatformModule,
19-
RouterModule.forChild([{path: '', component: PlatformDemo}]),
20-
],
15+
imports: [CommonModule, RouterModule.forChild([{path: '', component: PlatformDemo}])],
2116
declarations: [PlatformDemo],
2217
})
2318
export class PlatformDemoModule {}

src/material/core/datetime/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {PlatformModule} from '@angular/cdk/platform';
109
import {NgModule} from '@angular/core';
1110
import {DateAdapter} from './date-adapter';
1211
import {MAT_DATE_FORMATS} from './date-formats';
@@ -19,7 +18,6 @@ export * from './native-date-adapter';
1918
export * from './native-date-formats';
2019

2120
@NgModule({
22-
imports: [PlatformModule],
2321
providers: [{provide: DateAdapter, useClass: NativeDateAdapter}],
2422
})
2523
export class NativeDateModule {}

src/material/core/ripple/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10-
import {PlatformModule} from '@angular/cdk/platform';
1110
import {MatCommonModule} from '../common-behaviors/common-module';
1211
import {MatRipple} from './ripple';
1312

@@ -16,7 +15,7 @@ export * from './ripple-ref';
1615
export * from './ripple-renderer';
1716

1817
@NgModule({
19-
imports: [MatCommonModule, PlatformModule],
18+
imports: [MatCommonModule],
2019
exports: [MatRipple, MatCommonModule],
2120
declarations: [MatRipple],
2221
})

src/material/sidenav/sidenav-module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {PlatformModule} from '@angular/cdk/platform';
98
import {CdkScrollableModule} from '@angular/cdk/scrolling';
109
import {CommonModule} from '@angular/common';
1110
import {NgModule} from '@angular/core';
@@ -14,7 +13,7 @@ import {MatDrawer, MatDrawerContainer, MatDrawerContent} from './drawer';
1413
import {MatSidenav, MatSidenavContainer, MatSidenavContent} from './sidenav';
1514

1615
@NgModule({
17-
imports: [CommonModule, MatCommonModule, PlatformModule, CdkScrollableModule],
16+
imports: [CommonModule, MatCommonModule, CdkScrollableModule],
1817
exports: [
1918
CdkScrollableModule,
2019
MatCommonModule,

tools/public_api_guard/cdk/a11y.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import { DoCheck } from '@angular/core';
1212
import { ElementRef } from '@angular/core';
1313
import { EventEmitter } from '@angular/core';
1414
import * as i0 from '@angular/core';
15-
import * as i4 from '@angular/cdk/platform';
16-
import * as i5 from '@angular/cdk/observers';
15+
import * as i4 from '@angular/cdk/observers';
1716
import { InjectionToken } from '@angular/core';
1817
import { NgZone } from '@angular/core';
1918
import { Observable } from 'rxjs';
@@ -32,7 +31,7 @@ export class A11yModule {
3231
// (undocumented)
3332
static ɵinj: i0.ɵɵInjectorDeclaration<A11yModule>;
3433
// (undocumented)
35-
static ɵmod: i0.ɵɵNgModuleDeclaration<A11yModule, [typeof i1.CdkAriaLive, typeof i2.CdkTrapFocus, typeof i3.CdkMonitorFocus], [typeof i4.PlatformModule, typeof i5.ObserversModule], [typeof i1.CdkAriaLive, typeof i2.CdkTrapFocus, typeof i3.CdkMonitorFocus]>;
34+
static ɵmod: i0.ɵɵNgModuleDeclaration<A11yModule, [typeof i1.CdkAriaLive, typeof i2.CdkTrapFocus, typeof i3.CdkMonitorFocus], [typeof i4.ObserversModule], [typeof i1.CdkAriaLive, typeof i2.CdkTrapFocus, typeof i3.CdkMonitorFocus]>;
3635
}
3736

3837
// @public (undocumented)

tools/public_api_guard/cdk/scrolling.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { DoCheck } from '@angular/core';
1313
import { ElementRef } from '@angular/core';
1414
import * as i0 from '@angular/core';
1515
import * as i5 from '@angular/cdk/bidi';
16-
import * as i6 from '@angular/cdk/platform';
1716
import { InjectionToken } from '@angular/core';
1817
import { IterableDiffers } from '@angular/core';
1918
import { ListRange } from '@angular/cdk/collections';
@@ -251,7 +250,7 @@ export class ScrollingModule {
251250
// (undocumented)
252251
static ɵinj: i0.ɵɵInjectorDeclaration<ScrollingModule>;
253252
// (undocumented)
254-
static ɵmod: i0.ɵɵNgModuleDeclaration<ScrollingModule, [typeof i2.CdkFixedSizeVirtualScroll, typeof i3.CdkVirtualForOf, typeof i4.CdkVirtualScrollViewport], [typeof i5.BidiModule, typeof i6.PlatformModule, typeof CdkScrollableModule], [typeof i5.BidiModule, typeof CdkScrollableModule, typeof i2.CdkFixedSizeVirtualScroll, typeof i3.CdkVirtualForOf, typeof i4.CdkVirtualScrollViewport]>;
253+
static ɵmod: i0.ɵɵNgModuleDeclaration<ScrollingModule, [typeof i2.CdkFixedSizeVirtualScroll, typeof i3.CdkVirtualForOf, typeof i4.CdkVirtualScrollViewport], [typeof i5.BidiModule, typeof CdkScrollableModule], [typeof i5.BidiModule, typeof CdkScrollableModule, typeof i2.CdkFixedSizeVirtualScroll, typeof i3.CdkVirtualForOf, typeof i4.CdkVirtualScrollViewport]>;
255254
}
256255

257256
// @public (undocumented)

tools/public_api_guard/cdk/text-field.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { DoCheck } from '@angular/core';
1010
import { ElementRef } from '@angular/core';
1111
import { EventEmitter } from '@angular/core';
1212
import * as i0 from '@angular/core';
13-
import * as i3 from '@angular/cdk/platform';
1413
import { NgZone } from '@angular/core';
1514
import { NumberInput } from '@angular/cdk/coercion';
1615
import { Observable } from 'rxjs';
@@ -92,7 +91,7 @@ export class TextFieldModule {
9291
// (undocumented)
9392
static ɵinj: i0.ɵɵInjectorDeclaration<TextFieldModule>;
9493
// (undocumented)
95-
static ɵmod: i0.ɵɵNgModuleDeclaration<TextFieldModule, [typeof i1.CdkAutofill, typeof i2.CdkTextareaAutosize], [typeof i3.PlatformModule], [typeof i1.CdkAutofill, typeof i2.CdkTextareaAutosize]>;
94+
static ɵmod: i0.ɵɵNgModuleDeclaration<TextFieldModule, [typeof i1.CdkAutofill, typeof i2.CdkTextareaAutosize], never, [typeof i1.CdkAutofill, typeof i2.CdkTextareaAutosize]>;
9695
}
9796

9897
// (No @packageDocumentation comment for this package)

tools/public_api_guard/material/core.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { FormGroupDirective } from '@angular/forms';
1919
import { HighContrastModeDetector } from '@angular/cdk/a11y';
2020
import * as i0 from '@angular/core';
2121
import * as i1 from '@angular/cdk/bidi';
22-
import * as i1_2 from '@angular/cdk/platform';
2322
import * as i4 from '@angular/common';
2423
import { InjectionToken } from '@angular/core';
2524
import { NgControl } from '@angular/forms';
@@ -232,7 +231,7 @@ export class MatLineModule {
232231
// (undocumented)
233232
static ɵinj: i0.ɵɵInjectorDeclaration<MatLineModule>;
234233
// (undocumented)
235-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatLineModule, [typeof MatLine], [typeof i1_3.MatCommonModule], [typeof MatLine, typeof i1_3.MatCommonModule]>;
234+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatLineModule, [typeof MatLine], [typeof i1_2.MatCommonModule], [typeof MatLine, typeof i1_2.MatCommonModule]>;
236235
}
237236

238237
// @public (undocumented)
@@ -318,7 +317,7 @@ export class MatOptionModule {
318317
// (undocumented)
319318
static ɵinj: i0.ɵɵInjectorDeclaration<MatOptionModule>;
320319
// (undocumented)
321-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatOptionModule, [typeof i1_4.MatOption, typeof i2.MatOptgroup], [typeof i3.MatRippleModule, typeof i4.CommonModule, typeof i1_3.MatCommonModule, typeof i6.MatPseudoCheckboxModule], [typeof i1_4.MatOption, typeof i2.MatOptgroup]>;
320+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatOptionModule, [typeof i1_3.MatOption, typeof i2.MatOptgroup], [typeof i3.MatRippleModule, typeof i4.CommonModule, typeof i1_2.MatCommonModule, typeof i6.MatPseudoCheckboxModule], [typeof i1_3.MatOption, typeof i2.MatOptgroup]>;
322321
}
323322

324323
// @public
@@ -360,7 +359,7 @@ export class MatPseudoCheckboxModule {
360359
// (undocumented)
361360
static ɵinj: i0.ɵɵInjectorDeclaration<MatPseudoCheckboxModule>;
362361
// (undocumented)
363-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatPseudoCheckboxModule, [typeof i1_6.MatPseudoCheckbox], [typeof i1_3.MatCommonModule], [typeof i1_6.MatPseudoCheckbox]>;
362+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatPseudoCheckboxModule, [typeof i1_5.MatPseudoCheckbox], [typeof i1_2.MatCommonModule], [typeof i1_5.MatPseudoCheckbox]>;
364363
}
365364

366365
// @public
@@ -401,7 +400,7 @@ export class MatRippleModule {
401400
// (undocumented)
402401
static ɵinj: i0.ɵɵInjectorDeclaration<MatRippleModule>;
403402
// (undocumented)
404-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatRippleModule, [typeof i1_5.MatRipple], [typeof i1_3.MatCommonModule, typeof i1_2.PlatformModule], [typeof i1_5.MatRipple, typeof i1_3.MatCommonModule]>;
403+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatRippleModule, [typeof i1_4.MatRipple], [typeof i1_2.MatCommonModule], [typeof i1_4.MatRipple, typeof i1_2.MatCommonModule]>;
405404
}
406405

407406
// @public
@@ -486,7 +485,7 @@ export class NativeDateModule {
486485
// (undocumented)
487486
static ɵinj: i0.ɵɵInjectorDeclaration<NativeDateModule>;
488487
// (undocumented)
489-
static ɵmod: i0.ɵɵNgModuleDeclaration<NativeDateModule, never, [typeof i1_2.PlatformModule], never>;
488+
static ɵmod: i0.ɵɵNgModuleDeclaration<NativeDateModule, never, never, never>;
490489
}
491490

492491
// @public

tools/public_api_guard/material/sidenav.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import { FocusTrapFactory } from '@angular/cdk/a11y';
2222
import * as i0 from '@angular/core';
2323
import * as i3 from '@angular/common';
2424
import * as i4 from '@angular/material/core';
25-
import * as i5 from '@angular/cdk/platform';
26-
import * as i6 from '@angular/cdk/scrolling';
25+
import * as i5 from '@angular/cdk/scrolling';
2726
import { InjectionToken } from '@angular/core';
2827
import { InteractivityChecker } from '@angular/cdk/a11y';
2928
import { NgZone } from '@angular/core';
@@ -207,7 +206,7 @@ export class MatSidenavModule {
207206
// (undocumented)
208207
static ɵinj: i0.ɵɵInjectorDeclaration<MatSidenavModule>;
209208
// (undocumented)
210-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatSidenavModule, [typeof i1.MatDrawer, typeof i1.MatDrawerContainer, typeof i1.MatDrawerContent, typeof i2.MatSidenav, typeof i2.MatSidenavContainer, typeof i2.MatSidenavContent], [typeof i3.CommonModule, typeof i4.MatCommonModule, typeof i5.PlatformModule, typeof i6.CdkScrollableModule], [typeof i6.CdkScrollableModule, typeof i4.MatCommonModule, typeof i1.MatDrawer, typeof i1.MatDrawerContainer, typeof i1.MatDrawerContent, typeof i2.MatSidenav, typeof i2.MatSidenavContainer, typeof i2.MatSidenavContent]>;
209+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatSidenavModule, [typeof i1.MatDrawer, typeof i1.MatDrawerContainer, typeof i1.MatDrawerContent, typeof i2.MatSidenav, typeof i2.MatSidenavContainer, typeof i2.MatSidenavContent], [typeof i3.CommonModule, typeof i4.MatCommonModule, typeof i5.CdkScrollableModule], [typeof i5.CdkScrollableModule, typeof i4.MatCommonModule, typeof i1.MatDrawer, typeof i1.MatDrawerContainer, typeof i1.MatDrawerContent, typeof i2.MatSidenav, typeof i2.MatSidenavContainer, typeof i2.MatSidenavContent]>;
211210
}
212211

213212
// @public

0 commit comments

Comments
 (0)