From 315a79b1827e126d8feefd3aa96c14d5eeb02e18 Mon Sep 17 00:00:00 2001 From: Maxime GRIS Date: Sun, 11 Nov 2018 12:21:30 +0100 Subject: [PATCH] ref/ Upgrade to Angular 7 --- README.md | 4 ++-- package.json | 40 +++++++++++++++++++++------------------- src/app/app.module.ts | 1 - src/polyfills.ts | 42 +++++++++++++++++++----------------------- 4 files changed, 42 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 8dfea91..c631726 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ Bootstrap and package your project with Angular 6(+) and Electron (Typescript + Currently runs with: -- Angular v6.1.2 -- Electron v2.0.7 +- Angular v7.0.3 +- Electron v3.0.2 - Electron Builder v20.28.1 With this sample, you can : diff --git a/package.json b/package.json index 71cd8f3..40d984e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "angular-electron", - "version": "4.2.2", - "description": "Angular 6 with Electron (Typescript + SASS + Hot Reload)", + "version": "5.0.0", + "description": "Angular 7 with Electron (Typescript + SASS + Hot Reload)", "homepage": "https://github.com/maximegris/angular-electron", "author": { "name": "Maxime GRIS", @@ -9,7 +9,7 @@ }, "keywords": [ "angular", - "angular 6", + "angular 7", "electron", "typescript", "sass" @@ -34,30 +34,32 @@ "electron:windows": "npm run build:prod && npx electron-builder build --windows", "electron:mac": "npm run build:prod && npx electron-builder build --mac", "test": "npm run postinstall:web && ng test", - "e2e": "npm run postinstall:web && ng e2e" + "e2e": "npm run postinstall:web && ng e2e", + "version": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md" }, "dependencies": {}, "devDependencies": { - "@angular-devkit/build-angular": "0.6.3", - "@angular/cli": "6.1.2", - "@angular/common": "6.1.2", - "@angular/compiler": "6.1.2", - "@angular/compiler-cli": "6.1.2", - "@angular/core": "6.1.2", - "@angular/forms": "6.1.2", - "@angular/http": "6.1.2", - "@angular/language-service": "6.1.2", - "@angular/platform-browser": "6.1.2", - "@angular/platform-browser-dynamic": "6.1.2", - "@angular/router": "6.1.2", + "@angular-devkit/build-angular": "~0.10.0", + "@angular/cli": "7.0.5", + "@angular/common": "7.0.3", + "@angular/compiler": "7.0.3", + "@angular/compiler-cli": "7.0.3", + "@angular/core": "7.0.3", + "@angular/forms": "7.0.3", + "@angular/http": "7.0.3", + "@angular/language-service": "7.0.3", + "@angular/platform-browser": "7.0.3", + "@angular/platform-browser-dynamic": "7.0.3", + "@angular/router": "7.0.3", "@ngx-translate/core": "10.0.1", "@ngx-translate/http-loader": "3.0.1", "@types/jasmine": "2.8.7", "@types/jasminewd2": "2.0.3", "@types/node": "8.9.4", "codelyzer": "4.2.1", + "conventional-changelog-cli": "^2.0.11", "core-js": "2.5.6", - "electron": "^3.0.2", + "electron": "3.0.8", "electron-builder": "20.28.1", "electron-reload": "1.2.2", "jasmine-core": "3.1.0", @@ -70,10 +72,10 @@ "npm-run-all": "4.1.3", "npx": "10.2.0", "protractor": "5.3.2", - "rxjs": "6.2.2", + "rxjs": "6.3.3", "ts-node": "6.0.3", "tslint": "5.10.0", - "typescript": "2.7.2", + "typescript": "3.1.6", "wait-on": "2.1.0", "webdriver-manager": "12.0.6", "zone.js": "0.8.26" diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d9c04f7..9078630 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,4 +1,3 @@ -import 'zone.js/dist/zone-mix'; import 'reflect-metadata'; import '../polyfills'; import { BrowserModule } from '@angular/platform-browser'; diff --git a/src/polyfills.ts b/src/polyfills.ts index d3e73dd..ee8b84d 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -11,7 +11,7 @@ * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + * Learn more in https://angular.io/guide/browser-support */ /*************************************************************************************************** @@ -34,21 +34,23 @@ // import 'core-js/es6/weak-map'; // import 'core-js/es6/set'; +/** + * If the application will be indexed by Google Search, the following is required. + * Googlebot uses a renderer based on Chrome 41. + * https://developers.google.com/search/docs/guides/rendering + **/ +// import 'core-js/es6/array'; + /** IE10 and IE11 requires the following for NgClass support on SVG elements */ // import 'classlist.js'; // Run `npm install --save classlist.js`. /** IE10 and IE11 requires the following for the Reflect API. */ // import 'core-js/es6/reflect'; - -/** Evergreen browsers require these. **/ -// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. -import 'core-js/es7/reflect'; - - /** - * Required to support Web Animations `@angular/platform-browser/animations`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + * Web Animations `@angular/platform-browser/animations` + * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. + * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). **/ // import 'web-animations-js'; // Run `npm install --save web-animations-js`. @@ -57,27 +59,21 @@ import 'core-js/es7/reflect'; * user can disable parts of macroTask/DomEvents patch by setting following flags */ -// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame -// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick -// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames -/* -* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js -* with the following flag, it will bypass `zone.js` patch for IE/Edge -*/ + /* + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + */ // (window as any).__Zone_enable_cross_context_check = true; /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js/dist/zone-mix'; // Included with Angular CLI. +import 'zone.js/dist/zone'; // Included with Angular CLI. -/** - * You can load zone-patch-electron to allow electron native APIs - * (Such as dialog/shortcut/menu/getFileIcon/shell/session/ - * desktopCapturer/onEvent) in ngZone - */ -// import 'zone.js/dist/zone-patch-electron'; // add zone-patch-electron to patch Electron native API /*************************************************************************************************** * APPLICATION IMPORTS