Skip to content

feat(material/ng-update): add migration for hammerjs in version 9 #17369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2019

Conversation

devversion
Copy link
Member

@jelbourn This would be up for an initial review. I realize that the actual migration file is still quite big.. but I tried to already move things out as much as possible. I'm sure we can do better, but it will probably also complicate the sharing of analysis data if we split it into multiple classes.

Also, stuff like the ImportManager could technically go into some shared utilities once we figured out where these things should live.

@devversion devversion added the target: major This PR is targeted for the next major release label Oct 11, 2019
@devversion devversion added this to the 9.0.0 milestone Oct 11, 2019
@devversion devversion requested a review from jelbourn as a code owner October 11, 2019 12:39
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 11, 2019
@devversion devversion force-pushed the wip/v9-hammerjs-migration branch from ea56863 to 609a374 Compare October 11, 2019 12:45
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just a few small comments

@devversion devversion force-pushed the wip/v9-hammerjs-migration branch 2 times, most recently from 46908af to c15de55 Compare October 14, 2019 08:28
@devversion
Copy link
Member Author

@jelbourn Addressed the feedback.

@devversion
Copy link
Member Author

Also FYI: just tried this against kubernetes-dashboard and it seemed to work as expected.

diff --git a/package.json b/package.json
index cc1568f..f131c7b 100644
--- a/package.json
+++ b/package.json
@@ -114,7 +114,6 @@
     "core-js": "3.3.0",
     "d3": "5.10.1",
     "file-saver": "2.0.2",
-    "hammerjs": "2.0.8",
     "highlight.js": "^9.15.8",
     "js-yaml": "3.13.1",
     "ng2-ace-editor": "0.3.9",
@@ -192,4 +191,4 @@
     "node": ">=10.9.0",
     "npm": ">=6.0.0"
   }
-}
+}
\ No newline at end of file
diff --git a/src/app/frontend/index.module.ts b/src/app/frontend/index.module.ts
index b6e0341..fa5e7a0 100644
--- a/src/app/frontend/index.module.ts
+++ b/src/app/frontend/index.module.ts
@@ -14,7 +14,7 @@
 
 import {HttpClientModule} from '@angular/common/http';
 import {ErrorHandler, NgModule} from '@angular/core';
-import {BrowserModule, HAMMER_GESTURE_CONFIG} from '@angular/platform-browser';
+import { BrowserModule } from '@angular/platform-browser';
 import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
 import {RouterModule} from '@angular/router';
 import {ChromeModule} from './chrome/module';
@@ -23,7 +23,6 @@ import {GlobalErrorHandler} from './error/handler';
 import {RootComponent} from './index.component';
 import {routes} from './index.routing';
 import {LoginModule} from './login/module';
-import {GestureConfig} from '@angular/material/core';
 
 @NgModule({
   imports: [
@@ -40,7 +39,6 @@ import {GestureConfig} from '@angular/material/core';
   ],
   providers: [
     {provide: ErrorHandler, useClass: GlobalErrorHandler},
-    {provide: HAMMER_GESTURE_CONFIG, useClass: GestureConfig},
   ],
   declarations: [RootComponent],
   bootstrap: [RootComponent],
diff --git a/src/app/frontend/polyfills.ts b/src/app/frontend/polyfills.ts
index 0500080..38510dd 100644
--- a/src/app/frontend/polyfills.ts
+++ b/src/app/frontend/polyfills.ts
@@ -20,14 +20,9 @@
 // IE10 and IE11 requires the following for the Reflect API.
 import 'core-js/es/reflect';
 
-import 'hammerjs';
-
 // Required to support Web Animations `@angular/platform-browser/animations`:
 import 'web-animations-js';
 
-// Required to support Angular Material animations.
-import 'hammerjs';
-
 // Zone JS is required by default for Angular itself.
 import 'zone.js/dist/zone';
 

@devversion devversion force-pushed the wip/v9-hammerjs-migration branch from c15de55 to a461ce1 Compare October 14, 2019 11:59
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 14, 2019
@jelbourn jelbourn merged commit f065977 into angular:master Oct 14, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants