Skip to content

Commit 22b4b0e

Browse files
committed
docs(v9-hammerjs-migration): fixes and refinements
1 parent 09dc459 commit 22b4b0e

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

guides/v9-hammerjs-migration.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Finally, if the application uses any of the custom HammerJS gestures provided by
3333
new `HammerModule`, which enabled HammerJS event bindings. These bindings were previously enabled
3434
by default in Angular versions 8 and below.
3535

36-
If your application provides a custom [`HAMMER_GESTURE_CONFIG`][1] and also references the
36+
If the application provides a custom [`HAMMER_GESTURE_CONFIG`][1] and also references the
3737
deprecated Angular Material `GestureConfig`, the migration will print a warning about
3838
ambiguous usage. The migration cannot migrate the project automatically and manual changes
3939
are required. Read more [in the dedicated section](#The-migration-reported-ambiguous-usage-What-should-I-do).
@@ -62,12 +62,12 @@ import 'hammerjs';
6262

6363
The migration cannot automatically remove HammerJS from tests. Please manually clean up
6464
the test setup and resolve any test issues. Read more in a
65-
[dedicated section for test migration](#How-to-migrate-my-tests)
65+
[dedicated section for test migration](#How-to-migrate-my-tests).
6666

6767
### How do I migrate references to the deprecated `GestureConfig`?
6868

6969
The `GestureConfig` can be consumed in multiple ways. The migration covers the most common cases.
70-
The most common case is that an `NgModule` in your application directly provides `GestureConfig`:
70+
The most common case is that an `NgModule` in the application directly provides `GestureConfig`:
7171

7272
```typescript
7373
import {GestureConfig} from '@angular/material/core';
@@ -96,8 +96,8 @@ automatically, but the migration will report such patterns and ask for manual cl
9696
<a name="test-migration"></a>
9797
### How to migrate my tests?
9898

99-
Components in your project might use Angular Material components which previously depended
100-
on HammerJS. There might be unit tests for these components which also test gesture functionality
99+
Components in the project might use Angular Material components which previously depended
100+
upon HammerJS. There might be unit tests for these components which also test gesture functionality
101101
of the Angular Material components. For such unit tests, find all failing gesture tests. These
102102
might need to be reworked to dispatch proper events to simulate gestures, or need to be deleted.
103103
Specifically gesture tests for the `<mat-slide-toggle>` should be removed. This is because the
@@ -107,9 +107,9 @@ If some unit tests depend on the deprecated Angular Material `GestureConfig` to
107107
events, the reference should be either removed and tests reworked to use DOM events, or the
108108
reference should be changed to the new gesture config created by the migration.
109109

110-
If HammerJS has been removed by the migration from the project, you might able to need to
111-
clean up test setup that provides HammerJS. This is usually done in the test main file (usually
112-
in `src/test.ts`) where `hammerjs` is imported.
110+
If HammerJS has been removed from the project by the migration, there might be a need to refactor
111+
the test setup that provides HammerJS. This is usually done in the test main file (usually
112+
in `src/test.ts`) where `hammerjs` may be imported.
113113

114114
```typescript
115115
import 'hammerjs';
@@ -129,14 +129,16 @@ plugin, or to an actual `@Output`. For example:
129129

130130
In the example above, `rotate` could be an event from the deprecated `GestureConfig`, or an
131131
`@Output` from `<image-rotator>`. The migration warns about this to raise awareness that it
132-
might have _incorrectly kept_ HammerJS. Please manually check if you can remove HammerJS.
132+
might have _incorrectly kept_ HammerJS. Please check if HammerJS can be removed from the project
133+
manually.
133134

134135
**Case 2**: The deprecated Angular Material `GestureConfig` is used in combination with a
135136
custom [`HAMMER_GESTURE_CONFIG`][1]. This case is ambiguous because the migration is unable
136137
to detect whether a given HammerJS event binding corresponds to the custom gesture config, or to
137-
the deprecated Angular Material gesture config. If such a warning has been reported to you, check
138-
if you can remove references to the deprecated `GestureConfig`, or if you need to handle the events
139-
provided by the deprecated gesture config in your existing custom gesture config.
138+
the deprecated Angular Material gesture config. If such a warning has been reported, check
139+
if the references to the deprecated `GestureConfig` can be removed, or if the existing, custom
140+
gesture config needs to be updated to handle the events provided by the deprecated Angular Material
141+
`GestureConfig`.
140142

141143
[1]: https://v9.angular.io/api/platform-browser/HammerGestureConfig
142144
[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Import_a_module_for_its_side_effects_only

0 commit comments

Comments
 (0)