Skip to content

Commit 58ba0d3

Browse files
clydinhansl
authored andcommitted
build: compile with TS 2.7
1 parent 431c4da commit 58ba0d3

File tree

6 files changed

+128
-78
lines changed

6 files changed

+128
-78
lines changed

package-lock.json

Lines changed: 75 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"integration:build-optimizer": "npm run integration:build-optimizer:simple && npm run integration:build-optimizer:aio",
3333
"integration:build-optimizer:simple": "cd tests/@angular_devkit/build_optimizer/webpack/simple-app && npm i -q && npm run reinstall-bo && npm run e2e && npm run benchmark",
3434
"integration:build-optimizer:aio": "cd tests/@angular_devkit/build_optimizer/webpack/aio-app && npm i -q && npm run reinstall-bo && npm run e2e && npm run benchmark",
35+
"postinstall": "npm run admin -- patch-dependencies",
3536
"prepush": "node ./bin/devkit-admin hooks/pre-push"
3637
},
3738
"repository": {
@@ -131,9 +132,9 @@
131132
"tar": "^3.1.5",
132133
"temp": "^0.8.3",
133134
"tree-kill": "^1.2.0",
134-
"ts-node": "^4.1.0",
135-
"tslint": "^5.5.0",
136-
"typescript": "~2.6.1",
135+
"ts-node": "^5.0.0",
136+
"tslint": "^5.9.1",
137+
"typescript": "~2.7.2",
137138
"uglifyjs-webpack-plugin": "^1.1.6",
138139
"url-loader": "^0.6.2",
139140
"webpack": "^3.10.0",

scripts/patch-dependencies.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
import { execSync } from 'child_process';
9+
import { existsSync, writeFileSync } from 'fs';
10+
11+
const PATCH_LOCK = 'node_modules/rxjs/.patched';
12+
13+
export default function () {
14+
if (!existsSync(PATCH_LOCK)) {
15+
execSync('patch -p0 -i scripts/patches/rxjs-ts27.patch');
16+
execSync('patch -p0 -i scripts/patches/rxjs-typings.patch');
17+
writeFileSync(PATCH_LOCK, '');
18+
}
19+
}

scripts/patches/rxjs-ts27.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- node_modules/rxjs/src/observable/dom/AjaxObservable.ts 2017-12-21 16:48:41.000000000 -0500
2+
+++ node_modules/rxjs/src/observable/dom/AjaxObservable.ts 2018-02-20 11:00:21.000000000 -0500
3+
@@ -462,13 +462,13 @@
4+
//IE does not support json as responseType, parse it internally
5+
return xhr.responseType ? xhr.response : JSON.parse(xhr.response || xhr.responseText || 'null');
6+
} else {
7+
- return JSON.parse(xhr.responseText || 'null');
8+
+ return JSON.parse((xhr as any).responseText || 'null');
9+
}
10+
case 'xml':
11+
return xhr.responseXML;
12+
case 'text':
13+
default:
14+
- return ('response' in xhr) ? xhr.response : xhr.responseText;
15+
+ return ('response' in xhr) ? xhr.response : (xhr as any).responseText;
16+
}
17+
}
18+

scripts/patches/rxjs-typings.patch

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- node_modules/rxjs/Observable.d.ts 2018-02-20 11:24:56.000000000 -0500
2+
+++ node_modules/rxjs/Observable.d.ts 2018-02-20 11:25:21.000000000 -0500
3+
@@ -69,6 +69,7 @@
4+
pipe<A, B, C, D, E, F, G>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>): Observable<G>;
5+
pipe<A, B, C, D, E, F, G, H>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>): Observable<H>;
6+
pipe<A, B, C, D, E, F, G, H, I>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>, op4: OperatorFunction<C, D>, op5: OperatorFunction<D, E>, op6: OperatorFunction<E, F>, op7: OperatorFunction<F, G>, op8: OperatorFunction<G, H>, op9: OperatorFunction<H, I>): Observable<I>;
7+
+ pipe<R>(...operations: OperatorFunction<T, R>[]): Observable<R>;
8+
toPromise<T>(this: Observable<T>): Promise<T>;
9+
toPromise<T>(this: Observable<T>, PromiseCtor: typeof Promise): Promise<T>;
10+
toPromise<T>(this: Observable<T>, PromiseCtor: PromiseConstructorLike): Promise<T>;

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// source in devtools.
2323
"inlineSources": true,
2424
"strictNullChecks": true,
25-
"target": "es6",
25+
"target": "es2016",
2626
"lib": [
2727
"es2017"
2828
],
@@ -56,6 +56,7 @@
5656
"node_modules/**/*",
5757
"packages/schematics/*/*/*files/**/*",
5858
"tmp/**/*",
59+
"scripts/patches/**/*",
5960
"tests/**/*"
6061
]
6162
}

0 commit comments

Comments
 (0)