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

Commit 8099fca

Browse files
authored
build: upgrade to latest Angular and CDK RC (#1177)
1 parent 7fecbfe commit 8099fca

File tree

27 files changed

+209
-254
lines changed

27 files changed

+209
-254
lines changed

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
"postinstall": "ngcc --properties es2015 browser module main --create-ivy-entry-points"
2929
},
3030
"version": "8.0.0-beta.27",
31-
"requiredAngularVersion": ">=9.0.0-rc.6",
31+
"requiredAngularVersion": ">=9.0.0-rc.11",
3232
"dependencies": {
33-
"@angular/cdk": "^9.0.0-rc.5",
34-
"@angular/common": "^9.0.0-rc.6",
35-
"@angular/compiler": "^9.0.0-rc.6",
36-
"@angular/core": "^9.0.0-rc.6",
37-
"@angular/platform-browser": "^9.0.0-rc.6",
33+
"@angular/cdk": "^9.0.0-rc.8",
34+
"@angular/common": "^9.0.0-rc.11",
35+
"@angular/compiler": "^9.0.0-rc.11",
36+
"@angular/core": "^9.0.0-rc.11",
37+
"@angular/platform-browser": "^9.0.0-rc.11",
3838
"core-js": "^2.5.7",
3939
"karma-parallel": "^0.3.1",
4040
"rxjs": "^6.5.1",
@@ -44,13 +44,13 @@
4444
"zone.js": "~0.10.2"
4545
},
4646
"devDependencies": {
47-
"@angular/animations": "^9.0.0-rc.6",
48-
"@angular/compiler-cli": "^9.0.0-rc.6",
49-
"@angular/forms": "^9.0.0-rc.6",
50-
"@angular/material": "^9.0.0-rc.5",
51-
"@angular/platform-browser-dynamic": "^9.0.0-rc.6",
52-
"@angular/platform-server": "^9.0.0-rc.6",
53-
"@angular/router": "^9.0.0-rc.6",
47+
"@angular/animations": "^9.0.0-rc.11",
48+
"@angular/compiler-cli": "^9.0.0-rc.11",
49+
"@angular/forms": "^9.0.0-rc.11",
50+
"@angular/material": "^9.0.0-rc.8",
51+
"@angular/platform-browser-dynamic": "^9.0.0-rc.11",
52+
"@angular/platform-server": "^9.0.0-rc.11",
53+
"@angular/router": "^9.0.0-rc.11",
5454
"@firebase/app-types": "^0.3.2",
5555
"@types/chalk": "^0.4.31",
5656
"@types/fs-extra": "^4.0.5",
@@ -120,7 +120,7 @@
120120
"ts-node": "^3.0.4",
121121
"tsconfig-paths": "^2.3.0",
122122
"tslint": "^5.11.0",
123-
"typescript": "~3.6.4",
123+
"typescript": "~3.7.5",
124124
"uglify-js": "^2.8.14"
125125
},
126126
"// Gulp": "Overwrite graceful-fs to a version that does not rely on the 'natives' package. This fixes gulp for >= 10.13, more information: angular/angular#28213",

src/lib/core/style-utils/style-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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 {Inject, Injectable, Optional, PLATFORM_ID} from '@angular/core';
8+
import {Inject, Injectable, PLATFORM_ID} from '@angular/core';
99
import {isPlatformBrowser, isPlatformServer} from '@angular/common';
1010

1111
import {applyCssPrefixes} from '../../utils/auto-prefixer';
@@ -16,8 +16,8 @@ import {LAYOUT_CONFIG, LayoutConfigOptions} from '../tokens/library-config';
1616
@Injectable({providedIn: 'root'})
1717
export class StyleUtils {
1818

19-
constructor(@Optional() private _serverStylesheet: StylesheetMap,
20-
@Optional() @Inject(SERVER_TOKEN) private _serverModuleLoaded: boolean,
19+
constructor(private _serverStylesheet: StylesheetMap,
20+
@Inject(SERVER_TOKEN) private _serverModuleLoaded: boolean,
2121
@Inject(PLATFORM_ID) private _platformId: Object,
2222
@Inject(LAYOUT_CONFIG) private layoutConfig: LayoutConfigOptions) {}
2323

src/lib/extended/class/class.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@
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 {Directive, DoCheck, ElementRef, Input, Optional, Self} from '@angular/core';
9-
import {NgClass, ɵNgClassImpl, ɵNgClassR2Impl} from '@angular/common';
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';
1020
import {BaseDirective2, StyleUtils, MediaMarshaller} from '@angular/flex-layout/core';
1121

1222
@Directive()
@@ -24,16 +34,18 @@ export class ClassDirective extends BaseDirective2 implements DoCheck {
2434
this.setValue(val, '');
2535
}
2636

27-
constructor(protected elementRef: ElementRef,
28-
protected styler: StyleUtils,
29-
protected marshal: MediaMarshaller,
30-
protected delegate: ɵNgClassImpl,
37+
constructor(elementRef: ElementRef,
38+
styler: StyleUtils,
39+
marshal: MediaMarshaller,
40+
iterableDiffers: IterableDiffers,
41+
keyValueDiffers: KeyValueDiffers,
42+
renderer2: Renderer2,
3143
@Optional() @Self() protected readonly ngClassInstance: NgClass) {
3244
super(elementRef, null!, styler, marshal);
3345
if (!this.ngClassInstance) {
3446
// Create an instance NgClass Directive instance only if `ngClass=""` has NOT been defined on
3547
// the same host element; since the responsive variations may be defined...
36-
this.ngClassInstance = new NgClass(this.delegate);
48+
this.ngClassInstance = new NgClass(iterableDiffers, keyValueDiffers, elementRef, renderer2);
3749
}
3850
this.init();
3951
this.setValue('', '');
@@ -68,18 +80,12 @@ const selector = `
6880
[ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]
6981
`;
7082

71-
// tslint:disable-next-line:variable-name
72-
export const LayoutNgClassImplProvider = {
73-
provide: ɵNgClassImpl,
74-
useClass: ɵNgClassR2Impl
75-
};
76-
7783
/**
7884
* Directive to add responsive support for ngClass.
7985
* This maintains the core functionality of 'ngClass' and adds responsive API
8086
* Note: this class is a no-op when rendered on the server
8187
*/
82-
@Directive({selector, inputs, providers: [LayoutNgClassImplProvider]})
88+
@Directive({selector, inputs})
8389
export class DefaultClassDirective extends ClassDirective {
8490
protected inputs = inputs;
8591
}

src/lib/extended/img-src/img-src.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ export class ImgSrcDirective extends BaseDirective2 {
3434
this.setValue(this.defaultSrc, '');
3535
}
3636

37-
constructor(protected elementRef: ElementRef,
38-
protected styleBuilder: ImgSrcStyleBuilder,
39-
protected styler: StyleUtils,
40-
protected marshal: MediaMarshaller,
37+
constructor(elementRef: ElementRef,
38+
styleBuilder: ImgSrcStyleBuilder,
39+
styler: StyleUtils,
40+
marshal: MediaMarshaller,
4141
@Inject(PLATFORM_ID) protected platformId: Object,
4242
@Inject(SERVER_TOKEN) protected serverModuleLoaded: boolean) {
4343
super(elementRef, styleBuilder, styler, marshal);

src/lib/extended/show-hide/show-hide.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
ElementRef,
1111
OnChanges,
1212
SimpleChanges,
13-
Optional,
1413
Inject,
1514
PLATFORM_ID,
1615
Injectable,
@@ -50,13 +49,13 @@ export class ShowHideDirective extends BaseDirective2 implements AfterViewInit,
5049
protected hasLayout = false;
5150
protected hasFlexChild = false;
5251

53-
constructor(protected elementRef: ElementRef,
54-
protected styleBuilder: ShowHideStyleBuilder,
55-
protected styler: StyleUtils,
56-
protected marshal: MediaMarshaller,
52+
constructor(elementRef: ElementRef,
53+
styleBuilder: ShowHideStyleBuilder,
54+
styler: StyleUtils,
55+
marshal: MediaMarshaller,
5756
@Inject(LAYOUT_CONFIG) protected layoutConfig: LayoutConfigOptions,
5857
@Inject(PLATFORM_ID) protected platformId: Object,
59-
@Optional() @Inject(SERVER_TOKEN) protected serverModuleLoaded: boolean) {
58+
@Inject(SERVER_TOKEN) protected serverModuleLoaded: boolean) {
6059
super(elementRef, styleBuilder, styler, marshal);
6160
}
6261

src/lib/extended/style/style.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ import {
1010
DoCheck,
1111
ElementRef,
1212
Inject,
13+
KeyValueDiffers,
1314
Optional,
1415
PLATFORM_ID,
16+
Renderer2,
1517
SecurityContext,
1618
Self,
1719
} from '@angular/core';
18-
import {isPlatformServer, NgStyle, ɵNgStyleImpl, ɵNgStyleR2Impl} from '@angular/common';
20+
import {isPlatformServer, NgStyle} from '@angular/common';
1921
import {DomSanitizer} from '@angular/platform-browser';
2022
import {
2123
BaseDirective2,
@@ -44,19 +46,20 @@ export class StyleDirective extends BaseDirective2 implements DoCheck {
4446
protected fallbackStyles: NgStyleMap;
4547
protected isServer: boolean;
4648

47-
constructor(protected elementRef: ElementRef,
48-
protected styler: StyleUtils,
49-
protected marshal: MediaMarshaller,
50-
protected delegate: ɵNgStyleImpl,
49+
constructor(elementRef: ElementRef,
50+
styler: StyleUtils,
51+
marshal: MediaMarshaller,
5152
protected sanitizer: DomSanitizer,
53+
differs: KeyValueDiffers,
54+
renderer2: Renderer2,
5255
@Optional() @Self() private readonly ngStyleInstance: NgStyle,
53-
@Optional() @Inject(SERVER_TOKEN) serverLoaded: boolean,
56+
@Inject(SERVER_TOKEN) serverLoaded: boolean,
5457
@Inject(PLATFORM_ID) platformId: Object) {
5558
super(elementRef, null!, styler, marshal);
5659
if (!this.ngStyleInstance) {
5760
// Create an instance NgStyle Directive instance only if `ngStyle=""` has NOT been
5861
// defined on the same host element; since the responsive variations may be defined...
59-
this.ngStyleInstance = new NgStyle(this.delegate);
62+
this.ngStyleInstance = new NgStyle(elementRef, differs, renderer2);
6063
}
6164
this.init();
6265
const styles = this.nativeElement.getAttribute('style') || '';
@@ -127,17 +130,11 @@ const selector = `
127130
[ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]
128131
`;
129132

130-
// tslint:disable-next-line:variable-name
131-
export const LayoutNgStyleImplProvider = {
132-
provide: ɵNgStyleImpl,
133-
useClass: ɵNgStyleR2Impl
134-
};
135-
136133
/**
137134
* Directive to add responsive support for ngStyle.
138135
*
139136
*/
140-
@Directive({selector, inputs, providers: [LayoutNgStyleImplProvider]})
137+
@Directive({selector, inputs})
141138
export class DefaultStyleDirective extends StyleDirective implements DoCheck {
142139
protected inputs = inputs;
143140
}

src/lib/flex/flex-align/flex-align.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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 {Directive, ElementRef, Injectable, Optional} from '@angular/core';
8+
import {Directive, ElementRef, Injectable} from '@angular/core';
99
import {
1010
MediaMarshaller,
1111
BaseDirective2,
@@ -60,12 +60,10 @@ export class FlexAlignDirective extends BaseDirective2 {
6060

6161
protected DIRECTIVE_KEY = 'flex-align';
6262

63-
constructor(protected elRef: ElementRef,
64-
protected styleUtils: StyleUtils,
65-
// NOTE: not actually optional, but we need to force DI without a
66-
// constructor call
67-
@Optional() protected styleBuilder: FlexAlignStyleBuilder,
68-
protected marshal: MediaMarshaller) {
63+
constructor(elRef: ElementRef,
64+
styleUtils: StyleUtils,
65+
styleBuilder: FlexAlignStyleBuilder,
66+
marshal: MediaMarshaller) {
6967
super(elRef, styleBuilder, styleUtils, marshal);
7068
this.init();
7169
}

src/lib/flex/flex-fill/flex-fill.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export class FlexFillStyleBuilder extends StyleBuilder {
3737
*/
3838
@Directive({selector: `[fxFill], [fxFlexFill]`})
3939
export class FlexFillDirective extends BaseDirective2 {
40-
constructor(protected elRef: ElementRef,
41-
protected styleUtils: StyleUtils,
42-
protected styleBuilder: FlexFillStyleBuilder,
43-
protected marshal: MediaMarshaller) {
40+
constructor(elRef: ElementRef,
41+
styleUtils: StyleUtils,
42+
styleBuilder: FlexFillStyleBuilder,
43+
marshal: MediaMarshaller) {
4444
super(elRef, styleBuilder, styleUtils, marshal);
4545
this.addStyles('');
4646
}

src/lib/flex/flex-offset/flex-offset.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
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-
ElementRef,
11-
OnChanges,
12-
Optional,
13-
Injectable,
14-
} from '@angular/core';
8+
import {Directive, ElementRef, OnChanges, Injectable} from '@angular/core';
159
import {Directionality} from '@angular/cdk/bidi';
1610
import {
1711
MediaMarshaller,
@@ -69,13 +63,11 @@ const selector = `
6963
export class FlexOffsetDirective extends BaseDirective2 implements OnChanges {
7064
protected DIRECTIVE_KEY = 'flex-offset';
7165

72-
constructor(protected elRef: ElementRef,
66+
constructor(elRef: ElementRef,
7367
protected directionality: Directionality,
74-
// NOTE: not actually optional, but we need to force DI without a
75-
// constructor call
76-
@Optional() protected styleBuilder: FlexOffsetStyleBuilder,
77-
protected marshal: MediaMarshaller,
78-
protected styler: StyleUtils) {
68+
styleBuilder: FlexOffsetStyleBuilder,
69+
marshal: MediaMarshaller,
70+
styler: StyleUtils) {
7971
super(elRef, styleBuilder, styler, marshal);
8072
this.init([this.directionality.change]);
8173
// Parent DOM `layout-gap` with affect the nested child with `flex-offset`

src/lib/flex/flex-order/flex-order.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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 {Directive, ElementRef, OnChanges, Injectable, Optional} from '@angular/core';
8+
import {Directive, ElementRef, OnChanges, Injectable} from '@angular/core';
99
import {
1010
BaseDirective2,
1111
StyleBuilder,
@@ -44,12 +44,10 @@ export class FlexOrderDirective extends BaseDirective2 implements OnChanges {
4444

4545
protected DIRECTIVE_KEY = 'flex-order';
4646

47-
constructor(protected elRef: ElementRef,
48-
protected styleUtils: StyleUtils,
49-
// NOTE: not actually optional, but we need to force DI without a
50-
// constructor call
51-
@Optional() protected styleBuilder: FlexOrderStyleBuilder,
52-
protected marshal: MediaMarshaller) {
47+
constructor(elRef: ElementRef,
48+
styleUtils: StyleUtils,
49+
styleBuilder: FlexOrderStyleBuilder,
50+
marshal: MediaMarshaller) {
5351
super(elRef, styleBuilder, styleUtils, marshal);
5452
this.init();
5553
}

0 commit comments

Comments
 (0)