Skip to content

Commit

Permalink
fix(build): update to TypeScript 2.9 and RxJS 6.3
Browse files Browse the repository at this point in the history
* build: update to TypeScript 2.9 and RxJS 6.3

Fixes #828, Fixes #827.
  • Loading branch information
CaerusKaru authored and ThomasBurleson committed Aug 31, 2018
1 parent 19474ff commit aa8fb8c
Show file tree
Hide file tree
Showing 13 changed files with 3,071 additions and 4,193 deletions.
7,110 changes: 2,994 additions & 4,116 deletions package-lock.json

Large diffs are not rendered by default.

86 changes: 41 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,104 +28,100 @@
"version": "6.0.0-beta.17",
"requiredAngularVersion": ">=6.0.0 <7.0.0",
"dependencies": {
"@angular/cdk": "6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"core-js": "^2.4.1",
"rxjs": "^6.0.0",
"@angular/cdk": "^6.4.7",
"@angular/common": "^6.1.6",
"@angular/compiler": "^6.1.6",
"@angular/core": "^6.1.6",
"@angular/platform-browser": "^6.1.6",
"core-js": "^2.5.7",
"rxjs": "^6.3.0",
"systemjs": "0.19.43",
"tsickle": "^0.27.0",
"tslib": "^1.8.0",
"tsickle": "^0.32.1",
"tslib": "^1.9.3",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/animations": "^6.0.0",
"@angular/compiler-cli": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/material": "6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/platform-server": "^6.0.0",
"@angular/router": "^6.0.0",
"@google-cloud/storage": "^1.4.0",
"@angular/animations": "^6.1.6",
"@angular/compiler-cli": "^6.1.6",
"@angular/forms": "^6.1.6",
"@angular/http": "^6.1.6",
"@angular/material": "^6.4.7",
"@angular/platform-browser-dynamic": "^6.1.6",
"@angular/platform-server": "^6.1.6",
"@angular/router": "^6.1.6",
"@google-cloud/storage": "^1.7.0",
"@types/chalk": "^0.4.31",
"@types/fs-extra": "^4.0.5",
"@types/glob": "^5.0.33",
"@types/gulp": "3.8.32",
"@types/hammerjs": "^2.0.34",
"@types/jasmine": "^2.6.3",
"@types/jasmine": "^2.8.8",
"@types/merge2": "^0.3.30",
"@types/minimist": "^1.2.0",
"@types/node": "^7.0.57",
"@types/node": "^7.0.70",
"@types/run-sequence": "^0.0.29",
"@types/rx": "2.5.33",
"axe-core": "^2.4.2",
"axe-webdriverjs": "^1.1.5",
"chalk": "^1.1.3",
"cli-color": "^1.2.0",
"dgeni": "^0.4.7",
"dgeni-packages": "^0.26.2",
"firebase": "^4.12.0",
"firebase-admin": "^5.11.0",
"firebase-tools": "^3.18.6",
"cli-color": "^1.3.0",
"dgeni": "^0.4.10",
"dgeni-packages": "^0.26.7",
"firebase": "^4.13.1",
"firebase-admin": "^5.13.1",
"firebase-tools": "^4.2.1",
"fs-extra": "^3.0.1",
"git-semver-tags": "^2.0.0",
"glob": "^7.1.2",
"glob": "^7.1.3",
"google-closure-compiler": "20170409.0.0",
"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-clean-css": "^3.9.3",
"gulp-cli": "^1.3.0",
"gulp-connect": "^5.0.0",
"gulp-conventional-changelog": "^1.1.19",
"gulp-clean-css": "^3.10.0",
"gulp-cli": "^2.0.1",
"gulp-connect": "^5.6.1",
"gulp-conventional-changelog": "^1.1.24",
"gulp-dom": "^0.9.17",
"gulp-flatten": "^0.3.1",
"gulp-highlight-files": "^0.0.5",
"gulp-htmlmin": "^3.0.0",
"gulp-if": "^2.0.2",
"gulp-markdown": "^1.2.0",
"gulp-rename": "^1.2.2",
"gulp-rename": "^1.4.0",
"gulp-sass": "^3.2.1",
"gulp-transform": "^2.0.0",
"hammerjs": "^2.0.8",
"highlight.js": "^9.11.0",
"http-rewrite-middleware": "^0.1.6",
"image-diff": "^1.6.3",
"jasmine-core": "^2.8.0",
"jsonwebtoken": "^7.4.1",
"karma": "^2.0.4",
"karma": "^3.0.0",
"karma-browserstack-launcher": "^1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.2",
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "^1.1.1",
"karma-jasmine": "^1.1.2",
"karma-sauce-launcher": "^1.2.0",
"karma-sourcemap-loader": "^0.3.7",
"madge": "^3.1.1",
"madge": "^3.2.0",
"magic-string": "^0.22.5",
"merge2": "^1.2.0",
"merge2": "^1.2.2",
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
"prompt-sync": "^4.1.6",
"protractor": "^5.3.2",
"request": "^2.87.0",
"protractor": "^5.4.0",
"request": "^2.88.0",
"resolve-bin": "^0.4.0",
"rollup": "^0.56.5",
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-node-resolve": "^3.3.0",
"run-sequence": "^1.2.2",
"scss-bundle": "^2.3.2",
"scss-bundle": "^2.4.0",
"selenium-webdriver": "^3.6.0",
"sorcery": "^0.10.0",
"stylelint": "^7.12.0",
"temp": "0.8.3",
"ts-node": "^3.0.4",
"tsconfig-paths": "^2.3.0",
"tslint": "^5.8.0",
"tsutils": "^2.22.2",
"typescript": "~2.7.2",
"tslint": "^5.11.0",
"typescript": "~2.9.2",
"uglify-js": "^2.8.14"
}
}
2 changes: 1 addition & 1 deletion src/lib/core/breakpoints/breakpoint-tools.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {ORIENTATION_BREAKPOINTS} from './data/orientation-break-points';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {FlexLayoutModule} from '../../../module';

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

Expand Down
4 changes: 3 additions & 1 deletion src/lib/core/match-media/mock/mock-match-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export class MockMatchMedia extends MatchMedia {
*/
useOverlaps = false;

protected _registry: Map<string, MockMediaQueryList>;

constructor(_zone: NgZone,
@Inject(PLATFORM_ID) _platformId: Object,
@Inject(DOCUMENT) _document: any,
Expand All @@ -38,7 +40,7 @@ export class MockMatchMedia extends MatchMedia {

/** Easy method to clear all listeners for all mediaQueries */
clearAll() {
this._registry.forEach((mql: MockMediaQueryList, _) => {
this._registry.forEach((mql: MockMediaQueryList) => {
mql.destroy();
});
this._registry.clear();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/observable-media/observable-media.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('observable-media', () => {
let knownBreakPoints: BreakPoint[] = [];
let findMediaQuery: (alias: string) => string = (alias) => {
const NOT_FOUND = `${alias} not found`;
return knownBreakPoints.reduce((mediaQuery, bp) => {
return knownBreakPoints.reduce((mediaQuery: string | null, bp) => {
return mediaQuery || ((bp.alias === alias) ? bp.mediaQuery : null);
}, null) as string || NOT_FOUND;
};
Expand Down
16 changes: 12 additions & 4 deletions src/lib/core/observable-media/observable-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Injectable} from '@angular/core';
import {Observable, Subscribable, Subscription} from 'rxjs';
import {Observable, PartialObserver, Subscribable, Subscription} from 'rxjs';
import {filter, map} from 'rxjs/operators';

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

/**
Expand Down Expand Up @@ -95,10 +96,17 @@ export class MediaService implements ObservableMedia {
/**
* Proxy to the Observable subscribe method
*/
subscribe(next?: (value: MediaChange) => void,
subscribe(observerOrNext?: PartialObserver<MediaChange> | ((value: MediaChange) => void),
error?: (error: any) => void,
complete?: () => void): Subscription {
return this.observable$.subscribe(next, error, complete);
if (observerOrNext) {
if (typeof observerOrNext === 'object') {
return this.observable$.subscribe(observerOrNext.next, observerOrNext.error,
observerOrNext.complete);
}
}

return this.observable$.subscribe(observerOrNext, error, complete);
}

/**
Expand Down Expand Up @@ -178,7 +186,7 @@ export class MediaService implements ObservableMedia {
return bp ? bp.mediaQuery : query;
}

private observable$: Observable<MediaChange>;
private readonly observable$: Observable<MediaChange>;
}

export const ObservableMediaProvider = { // tslint:disable-line:variable-name
Expand Down
4 changes: 3 additions & 1 deletion src/lib/core/style-utils/style-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export class StyleUtils {
/**
* Applies styles given via string pair or object map to the directive element
*/
applyStyleToElement(element: HTMLElement, style: StyleDefinition, value?: string | number) {
applyStyleToElement(element: HTMLElement,
style: StyleDefinition | string,
value?: string | number) {
let styles = {};
if (typeof style === 'string') {
styles[style] = value;
Expand Down
28 changes: 8 additions & 20 deletions src/lib/extended/style/style-transforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export type NgStyleType = string | Set<string> | NgStyleRawList | NgStyleMap;
*/
export type NgStyleSanitizer = (val: any) => string;

/**
* NgStyle allowed inputs
*/
/** NgStyle allowed inputs */
export class NgStyleKeyValue {
constructor(public key: string, public value: string, noQuotes = true) {
this.key = noQuotes ? key.replace(/['"]/g, '').trim() : key.trim();
Expand All @@ -28,9 +26,7 @@ export class NgStyleKeyValue {
}
}

/**
* Transform Operators for @angular/flex-layout NgStyle Directive
*/
/** Transform Operators for @angular/flex-layout NgStyle Directive */
export const ngStyleUtils = {
getType,
buildRawList,
Expand Down Expand Up @@ -59,9 +55,7 @@ function buildRawList(source: any, delimiter = ';'): NgStyleRawList {
.filter(val => val !== '');
}

/**
* Convert array of key:value strings to a iterable map object
*/
/** Convert array of key:value strings to a iterable map object */
function buildMapFromList(styles: NgStyleRawList, sanitize?: NgStyleSanitizer): NgStyleMap {
let sanitizeValue = (it: NgStyleKeyValue) => {
if (sanitize) {
Expand All @@ -77,9 +71,7 @@ function buildMapFromList(styles: NgStyleRawList, sanitize?: NgStyleSanitizer):
.reduce(keyValuesToMap, {});
}

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


/**
* Convert 'key:value' -> [key, value]
*/
function stringToKeyValue(it: string): NgStyleKeyValue|null {
/** Convert 'key:value' -> [key, value] */
function stringToKeyValue(it: string): NgStyleKeyValue {
let [key, val] = it.split(':');
return val ? new NgStyleKeyValue(key, val) : null;
return new NgStyleKeyValue(key, val);
}

/**
* Convert [ [key,value] ] -> { key : value }
*/
/** Convert [ [key,value] ] -> { key : value } */
function keyValuesToMap(map: NgStyleMap, entry: NgStyleKeyValue): NgStyleMap {
if (!!entry.key) {
map[entry.key] = entry.value;
Expand Down
1 change: 1 addition & 0 deletions src/lib/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"experimentalDecorators": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"importHelpers": true,
"newLine": "lf",
"module": "es2015",
Expand Down
1 change: 1 addition & 0 deletions test/karma-system-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ System.config({
'@angular/cdk/bidi': 'node:@angular/cdk/bundles/cdk-bidi.umd.js',
'@angular/cdk/coercion': 'node:@angular/cdk/bundles/cdk-coercion.umd.js',
'@angular/cdk/keycodes': 'node:@angular/cdk/bundles/cdk-keycodes.umd.js',
'@angular/cdk/observers': 'node:@angular/cdk/bundles/cdk-observers.umd.js',
'@angular/cdk/platform': 'node:@angular/cdk/bundles/cdk-platform.umd.js',

// Path mappings for local packages that can be imported inside of tests.
Expand Down
7 changes: 4 additions & 3 deletions tools/gulp/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../../dist/tools/gulp",
"strictNullChecks": false,
"noEmitOnError": false,
"noImplicitAny": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noEmitOnError": true,
"noImplicitAny": true,
"target": "es5",
"removeComments": true,
"types": [
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"moduleResolution": "node",
"noUnusedParameters": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"skipLibCheck": true,
"target": "es2015",
"lib": ["es5", "es2015", "dom"],
Expand Down

0 comments on commit aa8fb8c

Please sign in to comment.