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

Commit aa8fb8c

Browse files
CaerusKaruThomasBurleson
authored andcommitted
fix(build): update to TypeScript 2.9 and RxJS 6.3
* build: update to TypeScript 2.9 and RxJS 6.3 Fixes #828, Fixes #827.
1 parent 19474ff commit aa8fb8c

13 files changed

+3071
-4193
lines changed

package-lock.json

+2,994-4,116
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+41-45
Original file line numberDiff line numberDiff line change
@@ -28,104 +28,100 @@
2828
"version": "6.0.0-beta.17",
2929
"requiredAngularVersion": ">=6.0.0 <7.0.0",
3030
"dependencies": {
31-
"@angular/cdk": "6.0.0",
32-
"@angular/common": "^6.0.0",
33-
"@angular/compiler": "^6.0.0",
34-
"@angular/core": "^6.0.0",
35-
"@angular/platform-browser": "^6.0.0",
36-
"core-js": "^2.4.1",
37-
"rxjs": "^6.0.0",
31+
"@angular/cdk": "^6.4.7",
32+
"@angular/common": "^6.1.6",
33+
"@angular/compiler": "^6.1.6",
34+
"@angular/core": "^6.1.6",
35+
"@angular/platform-browser": "^6.1.6",
36+
"core-js": "^2.5.7",
37+
"rxjs": "^6.3.0",
3838
"systemjs": "0.19.43",
39-
"tsickle": "^0.27.0",
40-
"tslib": "^1.8.0",
39+
"tsickle": "^0.32.1",
40+
"tslib": "^1.9.3",
4141
"zone.js": "^0.8.26"
4242
},
4343
"devDependencies": {
44-
"@angular/animations": "^6.0.0",
45-
"@angular/compiler-cli": "^6.0.0",
46-
"@angular/forms": "^6.0.0",
47-
"@angular/http": "^6.0.0",
48-
"@angular/material": "6.0.0",
49-
"@angular/platform-browser-dynamic": "^6.0.0",
50-
"@angular/platform-server": "^6.0.0",
51-
"@angular/router": "^6.0.0",
52-
"@google-cloud/storage": "^1.4.0",
44+
"@angular/animations": "^6.1.6",
45+
"@angular/compiler-cli": "^6.1.6",
46+
"@angular/forms": "^6.1.6",
47+
"@angular/http": "^6.1.6",
48+
"@angular/material": "^6.4.7",
49+
"@angular/platform-browser-dynamic": "^6.1.6",
50+
"@angular/platform-server": "^6.1.6",
51+
"@angular/router": "^6.1.6",
52+
"@google-cloud/storage": "^1.7.0",
5353
"@types/chalk": "^0.4.31",
5454
"@types/fs-extra": "^4.0.5",
5555
"@types/glob": "^5.0.33",
5656
"@types/gulp": "3.8.32",
5757
"@types/hammerjs": "^2.0.34",
58-
"@types/jasmine": "^2.6.3",
58+
"@types/jasmine": "^2.8.8",
5959
"@types/merge2": "^0.3.30",
6060
"@types/minimist": "^1.2.0",
61-
"@types/node": "^7.0.57",
61+
"@types/node": "^7.0.70",
6262
"@types/run-sequence": "^0.0.29",
6363
"@types/rx": "2.5.33",
64-
"axe-core": "^2.4.2",
6564
"axe-webdriverjs": "^1.1.5",
6665
"chalk": "^1.1.3",
67-
"cli-color": "^1.2.0",
68-
"dgeni": "^0.4.7",
69-
"dgeni-packages": "^0.26.2",
70-
"firebase": "^4.12.0",
71-
"firebase-admin": "^5.11.0",
72-
"firebase-tools": "^3.18.6",
66+
"cli-color": "^1.3.0",
67+
"dgeni": "^0.4.10",
68+
"dgeni-packages": "^0.26.7",
69+
"firebase": "^4.13.1",
70+
"firebase-admin": "^5.13.1",
71+
"firebase-tools": "^4.2.1",
7372
"fs-extra": "^3.0.1",
7473
"git-semver-tags": "^2.0.0",
75-
"glob": "^7.1.2",
74+
"glob": "^7.1.3",
7675
"google-closure-compiler": "20170409.0.0",
7776
"gulp": "^3.9.1",
7877
"gulp-clean": "^0.3.2",
79-
"gulp-clean-css": "^3.9.3",
80-
"gulp-cli": "^1.3.0",
81-
"gulp-connect": "^5.0.0",
82-
"gulp-conventional-changelog": "^1.1.19",
78+
"gulp-clean-css": "^3.10.0",
79+
"gulp-cli": "^2.0.1",
80+
"gulp-connect": "^5.6.1",
81+
"gulp-conventional-changelog": "^1.1.24",
8382
"gulp-dom": "^0.9.17",
8483
"gulp-flatten": "^0.3.1",
8584
"gulp-highlight-files": "^0.0.5",
8685
"gulp-htmlmin": "^3.0.0",
8786
"gulp-if": "^2.0.2",
8887
"gulp-markdown": "^1.2.0",
89-
"gulp-rename": "^1.2.2",
88+
"gulp-rename": "^1.4.0",
9089
"gulp-sass": "^3.2.1",
9190
"gulp-transform": "^2.0.0",
9291
"hammerjs": "^2.0.8",
9392
"highlight.js": "^9.11.0",
9493
"http-rewrite-middleware": "^0.1.6",
95-
"image-diff": "^1.6.3",
9694
"jasmine-core": "^2.8.0",
97-
"jsonwebtoken": "^7.4.1",
98-
"karma": "^2.0.4",
95+
"karma": "^3.0.0",
9996
"karma-browserstack-launcher": "^1.3.0",
10097
"karma-chrome-launcher": "^2.2.0",
10198
"karma-coverage": "^1.1.2",
10299
"karma-firefox-launcher": "^1.0.1",
103-
"karma-jasmine": "^1.1.1",
100+
"karma-jasmine": "^1.1.2",
104101
"karma-sauce-launcher": "^1.2.0",
105102
"karma-sourcemap-loader": "^0.3.7",
106-
"madge": "^3.1.1",
103+
"madge": "^3.2.0",
107104
"magic-string": "^0.22.5",
108-
"merge2": "^1.2.0",
105+
"merge2": "^1.2.2",
109106
"minimatch": "^3.0.4",
110107
"minimist": "^1.2.0",
111108
"prompt-sync": "^4.1.6",
112-
"protractor": "^5.3.2",
113-
"request": "^2.87.0",
109+
"protractor": "^5.4.0",
110+
"request": "^2.88.0",
114111
"resolve-bin": "^0.4.0",
115112
"rollup": "^0.56.5",
116113
"rollup-plugin-alias": "^1.4.0",
117114
"rollup-plugin-node-resolve": "^3.3.0",
118115
"run-sequence": "^1.2.2",
119-
"scss-bundle": "^2.3.2",
116+
"scss-bundle": "^2.4.0",
120117
"selenium-webdriver": "^3.6.0",
121118
"sorcery": "^0.10.0",
122119
"stylelint": "^7.12.0",
123120
"temp": "0.8.3",
124121
"ts-node": "^3.0.4",
125122
"tsconfig-paths": "^2.3.0",
126-
"tslint": "^5.8.0",
127-
"tsutils": "^2.22.2",
128-
"typescript": "~2.7.2",
123+
"tslint": "^5.11.0",
124+
"typescript": "~2.9.2",
129125
"uglify-js": "^2.8.14"
130126
}
131127
}

src/lib/core/breakpoints/breakpoint-tools.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {ORIENTATION_BREAKPOINTS} from './data/orientation-break-points';
1414

1515
describe('breakpoint-tools', () => {
1616
let all: BreakPoint[];
17-
let findByAlias = (alias): BreakPoint|null => all.reduce((pos, it) => {
17+
let findByAlias = (alias): BreakPoint|null => all.reduce((pos: BreakPoint | null, it) => {
1818
return pos || ((it.alias == alias) ? it : null);
1919
}, null);
2020

src/lib/core/breakpoints/data/orientation-break-points.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {FlexLayoutModule} from '../../../module';
1616

1717
describe('break-point-provider', () => {
1818
let breakPoints: BreakPoint[];
19-
let findByAlias = (alias): BreakPoint|null => breakPoints.reduce((pos, it) => {
19+
let findByAlias = (alias): BreakPoint|null => breakPoints.reduce((pos: BreakPoint | null, it) => {
2020
return pos || ((it.alias == alias) ? it : null);
2121
}, null);
2222

src/lib/core/match-media/mock/mock-match-media.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export class MockMatchMedia extends MatchMedia {
2828
*/
2929
useOverlaps = false;
3030

31+
protected _registry: Map<string, MockMediaQueryList>;
32+
3133
constructor(_zone: NgZone,
3234
@Inject(PLATFORM_ID) _platformId: Object,
3335
@Inject(DOCUMENT) _document: any,
@@ -38,7 +40,7 @@ export class MockMatchMedia extends MatchMedia {
3840

3941
/** Easy method to clear all listeners for all mediaQueries */
4042
clearAll() {
41-
this._registry.forEach((mql: MockMediaQueryList, _) => {
43+
this._registry.forEach((mql: MockMediaQueryList) => {
4244
mql.destroy();
4345
});
4446
this._registry.clear();

src/lib/core/observable-media/observable-media.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('observable-media', () => {
2222
let knownBreakPoints: BreakPoint[] = [];
2323
let findMediaQuery: (alias: string) => string = (alias) => {
2424
const NOT_FOUND = `${alias} not found`;
25-
return knownBreakPoints.reduce((mediaQuery, bp) => {
25+
return knownBreakPoints.reduce((mediaQuery: string | null, bp) => {
2626
return mediaQuery || ((bp.alias === alias) ? bp.mediaQuery : null);
2727
}, null) as string || NOT_FOUND;
2828
};

src/lib/core/observable-media/observable-media.ts

+12-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import {Injectable} from '@angular/core';
9-
import {Observable, Subscribable, Subscription} from 'rxjs';
9+
import {Observable, PartialObserver, Subscribable, Subscription} from 'rxjs';
1010
import {filter, map} from 'rxjs/operators';
1111

1212
import {BreakPointRegistry} from '../breakpoints/break-point-registry';
@@ -26,6 +26,7 @@ export abstract class ObservableMedia implements Subscribable<MediaChange> {
2626
abstract subscribe(next?: (value: MediaChange) => void,
2727
error?: (error: any) => void,
2828
complete?: () => void): Subscription;
29+
abstract subscribe(observer?: PartialObserver<MediaChange>): Subscription;
2930
}
3031

3132
/**
@@ -95,10 +96,17 @@ export class MediaService implements ObservableMedia {
9596
/**
9697
* Proxy to the Observable subscribe method
9798
*/
98-
subscribe(next?: (value: MediaChange) => void,
99+
subscribe(observerOrNext?: PartialObserver<MediaChange> | ((value: MediaChange) => void),
99100
error?: (error: any) => void,
100101
complete?: () => void): Subscription {
101-
return this.observable$.subscribe(next, error, complete);
102+
if (observerOrNext) {
103+
if (typeof observerOrNext === 'object') {
104+
return this.observable$.subscribe(observerOrNext.next, observerOrNext.error,
105+
observerOrNext.complete);
106+
}
107+
}
108+
109+
return this.observable$.subscribe(observerOrNext, error, complete);
102110
}
103111

104112
/**
@@ -178,7 +186,7 @@ export class MediaService implements ObservableMedia {
178186
return bp ? bp.mediaQuery : query;
179187
}
180188

181-
private observable$: Observable<MediaChange>;
189+
private readonly observable$: Observable<MediaChange>;
182190
}
183191

184192
export const ObservableMediaProvider = { // tslint:disable-line:variable-name

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export class StyleUtils {
2424
/**
2525
* Applies styles given via string pair or object map to the directive element
2626
*/
27-
applyStyleToElement(element: HTMLElement, style: StyleDefinition, value?: string | number) {
27+
applyStyleToElement(element: HTMLElement,
28+
style: StyleDefinition | string,
29+
value?: string | number) {
2830
let styles = {};
2931
if (typeof style === 'string') {
3032
styles[style] = value;

src/lib/extended/style/style-transforms.ts

+8-20
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ export type NgStyleType = string | Set<string> | NgStyleRawList | NgStyleMap;
1616
*/
1717
export type NgStyleSanitizer = (val: any) => string;
1818

19-
/**
20-
* NgStyle allowed inputs
21-
*/
19+
/** NgStyle allowed inputs */
2220
export class NgStyleKeyValue {
2321
constructor(public key: string, public value: string, noQuotes = true) {
2422
this.key = noQuotes ? key.replace(/['"]/g, '').trim() : key.trim();
@@ -28,9 +26,7 @@ export class NgStyleKeyValue {
2826
}
2927
}
3028

31-
/**
32-
* Transform Operators for @angular/flex-layout NgStyle Directive
33-
*/
29+
/** Transform Operators for @angular/flex-layout NgStyle Directive */
3430
export const ngStyleUtils = {
3531
getType,
3632
buildRawList,
@@ -59,9 +55,7 @@ function buildRawList(source: any, delimiter = ';'): NgStyleRawList {
5955
.filter(val => val !== '');
6056
}
6157

62-
/**
63-
* Convert array of key:value strings to a iterable map object
64-
*/
58+
/** Convert array of key:value strings to a iterable map object */
6559
function buildMapFromList(styles: NgStyleRawList, sanitize?: NgStyleSanitizer): NgStyleMap {
6660
let sanitizeValue = (it: NgStyleKeyValue) => {
6761
if (sanitize) {
@@ -77,9 +71,7 @@ function buildMapFromList(styles: NgStyleRawList, sanitize?: NgStyleSanitizer):
7771
.reduce(keyValuesToMap, {});
7872
}
7973

80-
/**
81-
* Convert Set<string> or raw Object to an iterable NgStyleMap
82-
*/
74+
/** Convert Set<string> or raw Object to an iterable NgStyleMap */
8375
function buildMapFromSet(source: any, sanitize?: NgStyleSanitizer): NgStyleMap {
8476
let list = new Array<string>();
8577
if (getType(source) == 'set') {
@@ -93,17 +85,13 @@ function buildMapFromSet(source: any, sanitize?: NgStyleSanitizer): NgStyleMap {
9385
}
9486

9587

96-
/**
97-
* Convert 'key:value' -> [key, value]
98-
*/
99-
function stringToKeyValue(it: string): NgStyleKeyValue|null {
88+
/** Convert 'key:value' -> [key, value] */
89+
function stringToKeyValue(it: string): NgStyleKeyValue {
10090
let [key, val] = it.split(':');
101-
return val ? new NgStyleKeyValue(key, val) : null;
91+
return new NgStyleKeyValue(key, val);
10292
}
10393

104-
/**
105-
* Convert [ [key,value] ] -> { key : value }
106-
*/
94+
/** Convert [ [key,value] ] -> { key : value } */
10795
function keyValuesToMap(map: NgStyleMap, entry: NgStyleKeyValue): NgStyleMap {
10896
if (!!entry.key) {
10997
map[entry.key] = entry.value;

src/lib/tsconfig-build.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"experimentalDecorators": true,
77
"noUnusedParameters": true,
88
"strictNullChecks": true,
9+
"strictFunctionTypes": true,
910
"importHelpers": true,
1011
"newLine": "lf",
1112
"module": "es2015",

test/karma-system-config.js

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ System.config({
4141
'@angular/cdk/bidi': 'node:@angular/cdk/bundles/cdk-bidi.umd.js',
4242
'@angular/cdk/coercion': 'node:@angular/cdk/bundles/cdk-coercion.umd.js',
4343
'@angular/cdk/keycodes': 'node:@angular/cdk/bundles/cdk-keycodes.umd.js',
44+
'@angular/cdk/observers': 'node:@angular/cdk/bundles/cdk-observers.umd.js',
4445
'@angular/cdk/platform': 'node:@angular/cdk/bundles/cdk-platform.umd.js',
4546

4647
// Path mappings for local packages that can be imported inside of tests.

tools/gulp/tsconfig.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
"module": "commonjs",
77
"moduleResolution": "node",
88
"outDir": "../../dist/tools/gulp",
9-
"strictNullChecks": false,
10-
"noEmitOnError": false,
11-
"noImplicitAny": false,
9+
"strictNullChecks": true,
10+
"strictFunctionTypes": true,
11+
"noEmitOnError": true,
12+
"noImplicitAny": true,
1213
"target": "es5",
1314
"removeComments": true,
1415
"types": [

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"moduleResolution": "node",
99
"noUnusedParameters": true,
1010
"strictNullChecks": true,
11+
"strictFunctionTypes": true,
1112
"skipLibCheck": true,
1213
"target": "es2015",
1314
"lib": ["es5", "es2015", "dom"],

0 commit comments

Comments
 (0)