Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit e49eb39

Browse files
authored
build: upgrade to Angular and Components v8 (#1056)
Fixes #1029
1 parent e297426 commit e49eb39

File tree

8 files changed

+270
-187
lines changed

8 files changed

+270
-187
lines changed

package.json

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,29 @@
2626
"universal:serve": "gulp universal:serve"
2727
},
2828
"version": "7.0.0-beta.24",
29-
"requiredAngularVersion": ">=7.0.0-rc.0",
29+
"requiredAngularVersion": ">=8.0.0-rc.0",
3030
"dependencies": {
31-
"@angular/cdk": "^7.0.3",
32-
"@angular/common": "^7.0.3",
33-
"@angular/compiler": "^7.0.3",
34-
"@angular/core": "^7.0.3",
35-
"@angular/platform-browser": "^7.0.3",
31+
"@angular/cdk": "^8.0.0-rc.1",
32+
"@angular/common": "^8.0.0-rc.4",
33+
"@angular/compiler": "^8.0.0-rc.4",
34+
"@angular/core": "^8.0.0-rc.4",
35+
"@angular/platform-browser": "^8.0.0-rc.4",
3636
"core-js": "^2.5.7",
3737
"karma-parallel": "^0.3.1",
38-
"rxjs": "^6.3.0",
38+
"rxjs": "^6.5.1",
3939
"systemjs": "0.19.43",
4040
"tsickle": "^0.32.0",
4141
"tslib": "^1.9.3",
42-
"zone.js": "~0.8.27"
42+
"zone.js": "~0.9.1"
4343
},
4444
"devDependencies": {
45-
"@angular/animations": "^7.0.3",
46-
"@angular/compiler-cli": "^7.0.3",
47-
"@angular/forms": "^7.0.3",
48-
"@angular/http": "^7.0.3",
49-
"@angular/material": "^7.0.3",
50-
"@angular/platform-browser-dynamic": "^7.0.3",
51-
"@angular/platform-server": "^7.0.3",
52-
"@angular/router": "^7.0.3",
45+
"@angular/animations": "^8.0.0-rc.4",
46+
"@angular/compiler-cli": "^8.0.0-rc.4",
47+
"@angular/forms": "^8.0.0-rc.4",
48+
"@angular/material": "^8.0.0-rc.1",
49+
"@angular/platform-browser-dynamic": "^8.0.0-rc.4",
50+
"@angular/platform-server": "^8.0.0-rc.4",
51+
"@angular/router": "^8.0.0-rc.4",
5352
"@google-cloud/storage": "^1.7.0",
5453
"@types/chalk": "^0.4.31",
5554
"@types/fs-extra": "^4.0.5",
@@ -121,7 +120,7 @@
121120
"ts-node": "^3.0.4",
122121
"tsconfig-paths": "^2.3.0",
123122
"tslint": "^5.11.0",
124-
"typescript": "~3.2.2",
123+
"typescript": "~3.4.5",
125124
"uglify-js": "^2.8.14"
126125
}
127126
}

src/apps/demo-app/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
"dependencies": {
1515
"@angular/animations": "file:../../../node_modules/@angular/animations",
1616
"@angular/cdk": "file:../../../node_modules/@angular/cdk",
17-
"@angular/cli": "^7.0.0-rc.2",
17+
"@angular/cli": "^8.0.0-rc.4",
1818
"@angular/common": "file:../../../node_modules/@angular/common",
1919
"@angular/compiler": "file:../../../node_modules/@angular/compiler",
2020
"@angular/core": "file:../../../node_modules/@angular/core",
2121
"@angular/flex-layout": "file:../../../dist/releases/flex-layout/angular-flex-layout.tgz",
2222
"@angular/forms": "file:../../../node_modules/@angular/forms",
23-
"@angular/http": "file:../../../node_modules/@angular/http",
2423
"@angular/material": "file:../../../node_modules/@angular/material",
2524
"@angular/platform-browser": "file:../../../node_modules/@angular/platform-browser",
2625
"@angular/platform-browser-dynamic": "file:../../../node_modules/@angular/platform-browser-dynamic",
@@ -31,13 +30,13 @@
3130
"zone.js": "file:../../../node_modules/zone.js"
3231
},
3332
"devDependencies": {
34-
"@angular-devkit/build-angular": "~0.9.0-rc.1",
33+
"@angular-devkit/build-angular": "~0.800.0-rc.4",
3534
"@angular/compiler-cli": "file:../../../node_modules/@angular/compiler-cli",
36-
"@angular/language-service": "^6.0.0",
35+
"@angular/language-service": "^8.0.0-rc.4",
3736
"@types/jasmine": "~2.8.3",
3837
"@types/jasminewd2": "~2.0.2",
3938
"@types/node": "~6.0.60",
40-
"codelyzer": "^4.5.0",
39+
"codelyzer": "^5.0.1",
4140
"jasmine-core": "~2.8.0",
4241
"jasmine-spec-reporter": "~4.2.1",
4342
"karma": "~2.0.0",

src/apps/hello-world/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
"dependencies": {
1515
"@angular/animations": "file:../../../node_modules/@angular/animations",
1616
"@angular/cdk": "file:../../../node_modules/@angular/cdk",
17-
"@angular/cli": "^7.0.0-rc.2",
17+
"@angular/cli": "^8.0.0-rc.4",
1818
"@angular/common": "file:../../../node_modules/@angular/common",
1919
"@angular/compiler": "file:../../../node_modules/@angular/compiler",
2020
"@angular/core": "file:../../../node_modules/@angular/core",
2121
"@angular/flex-layout": "file:../../../dist/releases/flex-layout/angular-flex-layout.tgz",
2222
"@angular/forms": "file:../../../node_modules/@angular/forms",
23-
"@angular/http": "file:../../../node_modules/@angular/http",
2423
"@angular/material": "file:../../../node_modules/@angular/material",
2524
"@angular/platform-browser": "file:../../../node_modules/@angular/platform-browser",
2625
"@angular/platform-browser-dynamic": "file:../../../node_modules/@angular/platform-browser-dynamic",
@@ -30,9 +29,9 @@
3029
"zone.js": "file:../../../node_modules/zone.js"
3130
},
3231
"devDependencies": {
33-
"@angular-devkit/build-angular": "~0.9.0-rc.1",
32+
"@angular-devkit/build-angular": "~0.800.0-rc.4",
3433
"@angular/compiler-cli": "file:../../../node_modules/@angular/compiler-cli",
35-
"@angular/language-service": "^6.0.0",
34+
"@angular/language-service": "^8.0.0-rc.4",
3635
"typescript": "file:../../../node_modules/typescript"
3736
}
3837
}

src/apps/universal-app/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,22 @@
2222
"@angular/core": "file:../../../node_modules/@angular/core",
2323
"@angular/flex-layout": "file:../../../dist/releases/flex-layout/angular-flex-layout.tgz",
2424
"@angular/forms": "file:../../../node_modules/@angular/forms",
25-
"@angular/http": "file:../../../node_modules/@angular/http",
2625
"@angular/platform-browser": "file:../../../node_modules/@angular/platform-browser",
2726
"@angular/platform-browser-dynamic": "file:../../../node_modules/@angular/platform-browser-dynamic",
2827
"@angular/platform-server": "file:../../../node_modules/@angular/platform-server",
2928
"@angular/router": "file:../../../node_modules/@angular/router",
30-
"@nguniversal/express-engine": "^7.0.2",
29+
"@nguniversal/express-engine": "^8.0.0-rc.0",
3130
"core-js": "^2.5.4",
3231
"express": "^4.16.2",
33-
"rxjs": "~6.3.3",
32+
"rxjs": "~6.5.2",
3433
"tslib": "^1.9.0",
35-
"zone.js": "~0.8.26"
34+
"zone.js": "~0.9.1"
3635
},
3736
"devDependencies": {
38-
"@angular-devkit/build-angular": "~0.11.0",
39-
"@angular/cli": "~7.1.2",
37+
"@angular-devkit/build-angular": "~0.800.0-rc.4",
38+
"@angular/cli": "~8.0.0-rc.4",
4039
"@angular/compiler-cli": "file:../../../node_modules/@angular/compiler-cli",
41-
"@angular/language-service": "~7.1.0",
40+
"@angular/language-service": "~8.0.0-rc.4",
4241
"@types/node": "~8.9.4",
4342
"@types/jasmine": "~2.8.8",
4443
"@types/jasminewd2": "~2.0.3",

src/lib/extended/class/class.ts

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,8 @@
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 {
9-
Directive,
10-
DoCheck,
11-
ElementRef,
12-
Input,
13-
IterableDiffers,
14-
KeyValueDiffers,
15-
Optional,
16-
Renderer2,
17-
Self,
18-
} from '@angular/core';
19-
import {NgClass} from '@angular/common';
8+
import {Directive, DoCheck, ElementRef, Input, Optional, Self} from '@angular/core';
9+
import {NgClass, ɵNgClassImpl, ɵNgClassR2Impl} from '@angular/common';
2010
import {BaseDirective2, StyleUtils, MediaMarshaller} from '@angular/flex-layout/core';
2111

2212
export class ClassDirective extends BaseDirective2 implements DoCheck {
@@ -36,17 +26,13 @@ export class ClassDirective extends BaseDirective2 implements DoCheck {
3626
constructor(protected elementRef: ElementRef,
3727
protected styler: StyleUtils,
3828
protected marshal: MediaMarshaller,
39-
protected iterableDiffers: IterableDiffers,
40-
protected keyValueDiffers: KeyValueDiffers,
41-
protected renderer: Renderer2,
29+
protected delegate: ɵNgClassImpl,
4230
@Optional() @Self() protected readonly ngClassInstance: NgClass) {
4331
super(elementRef, null!, styler, marshal);
4432
if (!this.ngClassInstance) {
4533
// Create an instance NgClass Directive instance only if `ngClass=""` has NOT been defined on
4634
// the same host element; since the responsive variations may be defined...
47-
this.ngClassInstance = new NgClass(
48-
this.iterableDiffers, this.keyValueDiffers, this.elementRef, this.renderer
49-
);
35+
this.ngClassInstance = new NgClass(this.delegate);
5036
}
5137
this.init();
5238
this.setValue('', '');
@@ -81,12 +67,18 @@ const selector = `
8167
[ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]
8268
`;
8369

70+
// tslint:disable-next-line:variable-name
71+
export const LayoutNgClassImplProvider = {
72+
provide: ɵNgClassImpl,
73+
useClass: ɵNgClassR2Impl
74+
};
75+
8476
/**
8577
* Directive to add responsive support for ngClass.
8678
* This maintains the core functionality of 'ngClass' and adds responsive API
8779
* Note: this class is a no-op when rendered on the server
8880
*/
89-
@Directive({selector, inputs})
81+
@Directive({selector, inputs, providers: [LayoutNgClassImplProvider]})
9082
export class DefaultClassDirective extends ClassDirective {
9183
protected inputs = inputs;
9284
}

src/lib/extended/style/style.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@ import {
1010
DoCheck,
1111
ElementRef,
1212
Inject,
13-
KeyValueDiffers,
1413
Optional,
1514
PLATFORM_ID,
16-
Renderer2,
1715
SecurityContext,
1816
Self,
1917
} from '@angular/core';
20-
import {isPlatformServer, NgStyle} from '@angular/common';
18+
import {isPlatformServer, NgStyle, ɵNgStyleImpl, ɵNgStyleR2Impl} from '@angular/common';
2119
import {DomSanitizer} from '@angular/platform-browser';
2220
import {
2321
BaseDirective2,
@@ -48,8 +46,7 @@ export class StyleDirective extends BaseDirective2 implements DoCheck {
4846
constructor(protected elementRef: ElementRef,
4947
protected styler: StyleUtils,
5048
protected marshal: MediaMarshaller,
51-
protected keyValueDiffers: KeyValueDiffers,
52-
protected renderer: Renderer2,
49+
protected delegate: ɵNgStyleImpl,
5350
protected sanitizer: DomSanitizer,
5451
@Optional() @Self() private readonly ngStyleInstance: NgStyle,
5552
@Optional() @Inject(SERVER_TOKEN) serverLoaded: boolean,
@@ -58,7 +55,7 @@ export class StyleDirective extends BaseDirective2 implements DoCheck {
5855
if (!this.ngStyleInstance) {
5956
// Create an instance NgClass Directive instance only if `ngClass=""` has NOT been
6057
// defined on the same host element; since the responsive variations may be defined...
61-
this.ngStyleInstance = new NgStyle(this.keyValueDiffers, this.elementRef, this.renderer);
58+
this.ngStyleInstance = new NgStyle(this.delegate);
6259
}
6360
this.init();
6461
const styles = this.nativeElement.getAttribute('style') || '';
@@ -129,11 +126,17 @@ const selector = `
129126
[ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]
130127
`;
131128

129+
// tslint:disable-next-line:variable-name
130+
export const LayoutNgStyleImplProvider = {
131+
provide: ɵNgStyleImpl,
132+
useClass: ɵNgStyleR2Impl
133+
};
134+
132135
/**
133136
* Directive to add responsive support for ngStyle.
134137
*
135138
*/
136-
@Directive({selector, inputs})
139+
@Directive({selector, inputs, providers: [LayoutNgStyleImplProvider]})
137140
export class DefaultStyleDirective extends StyleDirective implements DoCheck {
138141
protected inputs = inputs;
139142
}

src/lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"homepage": "https://github.com/angular/flex-layout#readme",
2525
"peerDependencies": {
26-
"@angular/cdk": "^7.0.0-rc.0",
26+
"@angular/cdk": "^8.0.0-rc.0",
2727
"@angular/core": "0.0.0-NG",
2828
"@angular/common": "0.0.0-NG",
2929
"@angular/platform-browser": "0.0.0-NG",

0 commit comments

Comments
 (0)