Skip to content

Commit c4f2174

Browse files
crisbetommalerba
authored andcommitted
refactor: clean up remaining hammer.js usages (#17268)
Now that none of the components use Hammer.js anymore, we can clean up the remaining usages from the project.
1 parent 361d1cf commit c4f2174

36 files changed

+55
-421
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@
148148
/src/dev-app/examples-page/** @andrewseguin
149149
/src/dev-app/expansion/** @jelbourn
150150
/src/dev-app/focus-origin/** @mmalerba
151-
/src/dev-app/gestures/** @jelbourn
152151
/src/dev-app/google-map/** @mbehrlich
153152
/src/dev-app/grid-list/** @jelbourn
154153
/src/dev-app/icon/** @jelbourn

guides/getting-started.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,11 @@ ng add @angular/material
1818

1919
The `ng add` command will install Angular Material, the [Component Dev Kit (CDK)](https://material.angular.io/cdk/categories), [Angular Animations](https://angular.io/guide/animations) and ask you the following questions to determine which features to include:
2020

21-
1. Choose a prebuilt theme name, or "custom" for a custom theme:
21+
1. Choose a prebuilt theme name, or "custom" for a custom theme:
2222

2323
You can choose from [prebuilt material design themes](https://material.angular.io/guide/theming#using-a-pre-built-theme) or set up an extensible [custom theme](https://material.angular.io/guide/theming#defining-a-custom-theme).
2424

25-
2. Set up HammerJS for gesture recognition:
26-
27-
[HammerJS](http://hammerjs.github.io/) provides gesture recognition capabilities required by some components (`mat-slide-toggle`, `mat-slider`, `matToolTip`).
28-
29-
Please note, if you choose not to install HammerJS it can be installed later
30-
(see [Appendix](#installing-hammerjs)).
31-
32-
3. Set up browser animations for Angular Material:
25+
2. Set up browser animations for Angular Material:
3326

3427
Importing the [`BrowserAnimationsModule`](https://angular.io/api/platform-browser/animations/BrowserAnimationsModule) into your application enables Angular's [animation system](https://angular.io/guide/animations). Declining this will disable most of Angular Material's animations.
3528

@@ -79,20 +72,3 @@ and point your browser to [http://localhost:4200](http://localhost:4200)
7972
You should see the material slider component on the page.
8073

8174
In addition to the install schematic, Angular Material comes with [several schematics](https://material.angular.io/guide/schematics) (like nav, table, address-form, etc.) that can be used to easily generate pre-built components in your application.
82-
83-
84-
### Appendix
85-
86-
#### Installing HammerJS
87-
88-
[HammerJS](http://hammerjs.github.io/) can be installed using the following npm command:
89-
90-
```bash
91-
npm install --save hammerjs
92-
```
93-
94-
After installing, import it on your app's entry point (e.g. `src/main.ts`).
95-
96-
```ts
97-
import 'hammerjs';
98-
```

guides/schematics.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ The Angular Material `ng add` schematic helps you setup an Angular CLI project t
3030
- Remove margins from `body`
3131
- Set `height: 100%` on `html` and `body`
3232
- Make Roboto the default font of your app
33-
- Install and import `hammerjs` for [gesture support](./getting-started#step-5-gesture-support) in your project
3433

3534

3635
## Component schematics

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
"@types/glob": "^5.0.33",
8484
"@types/gulp": "3.8.32",
8585
"@types/gulp-util": "^3.0.34",
86-
"@types/hammerjs": "^2.0.35",
8786
"@types/inquirer": "^0.0.43",
8887
"@types/jasmine": "^3.4.0",
8988
"@types/marked": "^0.4.2",
@@ -115,7 +114,6 @@
115114
"gulp-rename": "^1.2.2",
116115
"gulp-sass": "^4.0.2",
117116
"gulp-util": "^3.0.8",
118-
"hammerjs": "^2.0.8",
119117
"highlight.js": "^9.11.0",
120118
"husky": "^1.3.1",
121119
"inquirer": "^6.2.0",

src/dev-app/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ ng_module(
3333
"//src/dev-app/examples-page",
3434
"//src/dev-app/expansion",
3535
"//src/dev-app/focus-origin",
36-
"//src/dev-app/gestures",
3736
"//src/dev-app/google-map",
3837
"//src/dev-app/grid-list",
3938
"//src/dev-app/icon",
@@ -133,7 +132,6 @@ dev_server(
133132
"@npm//:node_modules/@material/top-app-bar/dist/mdc.topAppBar.js",
134133
"@npm//:node_modules/@webcomponents/custom-elements/custom-elements.min.js",
135134
"@npm//:node_modules/core-js/client/core.js",
136-
"@npm//:node_modules/hammerjs/hammer.min.js",
137135
"@npm//:node_modules/moment/min/moment-with-locales.min.js",
138136
"@npm//:node_modules/rxjs/bundles/rxjs.umd.min.js",
139137
"@npm//:node_modules/systemjs/dist/system.js",

src/dev-app/dev-app/dev-app-layout.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export class DevAppLayout {
3939
{name: 'Drag and Drop', route: '/drag-drop'},
4040
{name: 'Expansion Panel', route: '/expansion'},
4141
{name: 'Focus Origin', route: '/focus-origin'},
42-
{name: 'Gestures', route: '/gestures'},
4342
{name: 'Google Map', route: '/google-map'},
4443
{name: 'Grid List', route: '/grid-list'},
4544
{name: 'Icon', route: '/icon'},

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
import {CommonModule} from '@angular/common';
1010
import {NgModule} from '@angular/core';
1111
import {MatButtonModule} from '@angular/material/button';
12-
import {GestureConfig} from '@angular/material/core';
1312
import {MatIconModule} from '@angular/material/icon';
1413
import {MatListModule} from '@angular/material/list';
1514
import {MatSidenavModule} from '@angular/material/sidenav';
1615
import {MatToolbarModule} from '@angular/material/toolbar';
17-
import {HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
1816
import {RouterModule} from '@angular/router';
1917
import {DevApp404} from './dev-app-404';
2018
import {DevAppHome} from './dev-app-home';
@@ -32,10 +30,6 @@ import {DevAppLayout} from './dev-app-layout';
3230
],
3331
declarations: [DevAppLayout, DevAppHome, DevApp404],
3432
exports: [DevAppLayout],
35-
36-
// We need to pass this in here, because the gesture config currently doesn't for lazy-loaded
37-
// modules. See https://github.com/angular/components/issues/4595#issuecomment-416641018.
38-
providers: [{provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig}]
3933
})
4034
export class DevAppModule {
4135
}

src/dev-app/dev-app/routes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export const DEV_APP_ROUTES: Routes = [
3939
path: 'focus-origin',
4040
loadChildren: 'focus-origin/focus-origin-demo-module#FocusOriginDemoModule'
4141
},
42-
{path: 'gestures', loadChildren: 'gestures/gestures-demo-module#GesturesDemoModule'},
4342
{path: 'google-map', loadChildren: 'google-map/google-map-demo-module#GoogleMapDemoModule'},
4443
{path: 'grid-list', loadChildren: 'grid-list/grid-list-demo-module#GridListDemoModule'},
4544
{path: 'icon', loadChildren: 'icon/icon-demo-module#IconDemoModule'},

src/dev-app/gestures/BUILD.bazel

Lines changed: 0 additions & 21 deletions
This file was deleted.

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

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)