Skip to content

Commit ef85336

Browse files
filipesilvaIgorMinar
authored andcommittedApr 10, 2019
build: update to TypeScript 3.4 (#29372)
PR Close #29372
1 parent 138ca5a commit ef85336

File tree

17 files changed

+34
-29
lines changed

17 files changed

+34
-29
lines changed
 

‎aio/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"ts-node": "^3.3.0",
158158
"tslib": "^1.9.0",
159159
"tslint": "~5.9.1",
160-
"typescript": "~3.3.3333",
160+
"typescript": "~3.4.2",
161161
"uglify-js": "^3.0.15",
162162
"unist-util-filter": "^0.2.1",
163163
"unist-util-source": "^1.0.1",

‎aio/src/app/shared/reporting-error-handler.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ export class ReportingErrorHandler extends ErrorHandler {
2828
}
2929

3030
private reportError(error: string | Error) {
31-
if (typeof error === 'string') {
32-
this.window.onerror(error);
33-
} else {
34-
this.window.onerror(error.message, undefined, undefined, undefined, error);
31+
if (this.window.onerror) {
32+
if (typeof error === 'string') {
33+
this.window.onerror(error);
34+
} else {
35+
this.window.onerror(error.message, undefined, undefined, undefined, error);
36+
}
3537
}
3638
}
3739
}

‎aio/tests/e2e/onerror.e2e-spec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ createViewNodes@???`);
190190
// reset the ga queue
191191
(window as any).ga.q.length = 0;
192192
// post the error to the handler
193-
window.onerror(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
193+
if (window.onerror) {
194+
window.onerror(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
195+
}
194196
}, message, url, line, column, error);
195197
const gaCalls = await page.ga();
196198
const exceptionCall = gaCalls.find(call => call[0] === 'send' && call[1] === 'exception');

‎aio/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -10576,10 +10576,10 @@ typescript@^2.4.1:
1057610576
version "2.6.2"
1057710577
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"
1057810578

10579-
typescript@^3.2.2, typescript@~3.3.3333:
10580-
version "3.3.3333"
10581-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3333.tgz#171b2c5af66c59e9431199117a3bcadc66fdcfd6"
10582-
integrity sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==
10579+
typescript@^3.2.2, typescript@~3.4.2:
10580+
version "3.4.2"
10581+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.2.tgz#9ed4e6475d906f589200193be056f5913caed481"
10582+
integrity sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==
1058310583

1058410584
uglify-js@^3.0.15, uglify-js@^3.1.4:
1058510585
version "3.4.9"

‎integration/bazel-schematics/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function testBazel() {
3030
yarn
3131
# Force more recent TS version until new Angular CLI projects also use it.
3232
# --ignore-scripts is necessary because there is a postinstall script that uses ngc.
33-
yarn add typescript@3.3.3333 --dev --ignore-scripts
33+
yarn add typescript@3.4.2 --dev --ignore-scripts
3434
installLocalPackages
3535
yarn webdriver-manager update --gecko=false --standalone=false ${CI_CHROMEDRIVER_VERSION_ARG:---versions.chrome 2.45}
3636
ng generate component widget --style=css

‎integration/bazel/src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@types/jasmine": "2.8.8",
2525
"@types/source-map": "0.5.1",
2626
"protractor": "5.1.2",
27-
"typescript": "3.3.3333"
27+
"typescript": "3.4.2"
2828
},
2929
"scripts": {
3030
"postinstall": "ngc -p ./angular-metadata.tsconfig.json",

‎integration/dynamic-compiler/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"build": "npm run clean && npm run ngc && npm run rollup && npm run rollup:lazy && npm run es5 && npm run es5:lazy",
77
"clean": "rm -rf dist",
8-
"es5": "tsc --target es5 --skipLibCheck --allowJs dist/bundle.es2015.js --out dist/bundle.js",
8+
"//es5-note": "`--typeRoots ./dummy_folder_name/@types` is a workaround for https://github.com/Microsoft/TypeScript/issues/30845",
9+
"es5": "tsc --target es5 --skipLibCheck --allowJs dist/bundle.es2015.js --out dist/bundle.js --typeRoots ./dummy_folder_name/@types",
910
"es5:lazy": "tsc --target es5 --skipLibCheck --allowJs dist/lazy.bundle.es2015.js --out dist/lazy.bundle.js",
1011
"ngc": "ngc -p tsconfig.json",
1112
"rollup": "rollup -f iife -c rollup.config.js -o dist/bundle.es2015.js",

‎integration/typings_test_ts33/package.json renamed to ‎integration/typings_test_ts34/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
2222
"@types/jasmine": "2.5.41",
2323
"rxjs": "file:../../node_modules/rxjs",
24-
"typescript": "3.3.x",
24+
"typescript": "3.4.2",
2525
"zone.js": "file:../../node_modules/zone.js"
2626
},
2727
"scripts": {
2828
"test": "tsc"
2929
}
30-
}
30+
}

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"tsickle": "0.34.3",
100100
"tslib": "^1.9.0",
101101
"tslint": "5.7.0",
102-
"typescript": "~3.3.3333",
102+
"typescript": "~3.4.2",
103103
"xhr2": "0.1.4",
104104
"yargs": "9.0.1",
105105
"zone.js": "^0.9.0"

‎packages/bazel/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"peerDependencies": {
4040
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
4141
"@bazel/typescript": "0.27.10",
42-
"typescript": ">=3.3.3333 <3.4"
42+
"typescript": ">=3.4 <3.5"
4343
},
4444
"repository": {
4545
"type": "git",

‎packages/compiler-cli/ngcc/src/rendering/renderer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export abstract class Renderer {
9191
const renderedFiles: FileInfo[] = [];
9292

9393
// Transform the source files.
94-
this.bundle.src.program.getSourceFiles().map(sourceFile => {
94+
this.bundle.src.program.getSourceFiles().forEach(sourceFile => {
9595
const compiledFile = decorationAnalyses.get(sourceFile);
9696
const switchMarkerAnalysis = switchMarkerAnalyses.get(sourceFile);
9797

‎packages/compiler-cli/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"peerDependencies": {
2626
"@angular/compiler": "0.0.0-PLACEHOLDER",
27-
"typescript": ">=3.3.3333 <3.4"
27+
"typescript": ">=3.4 <3.5"
2828
},
2929
"engines": {
3030
"node": ">=8.0"
@@ -45,4 +45,4 @@
4545
"ng-update": {
4646
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
4747
}
48-
}
48+
}

‎packages/compiler-cli/src/transformers/program.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ const defaultEmitCallback: TsEmitCallback =
7272
* Minimum supported TypeScript version
7373
* ∀ supported typescript version v, v >= MIN_TS_VERSION
7474
*/
75-
const MIN_TS_VERSION = '3.3.3333';
75+
const MIN_TS_VERSION = '3.4.0';
7676

7777
/**
7878
* Supremum of supported TypeScript versions
7979
* ∀ supported typescript version v, v < MAX_TS_VERSION
8080
* MAX_TS_VERSION is not considered as a supported TypeScript version
8181
*/
82-
const MAX_TS_VERSION = '3.4.0';
82+
const MAX_TS_VERSION = '3.5.0';
8383

8484
class AngularCompilerProgram implements Program {
8585
private rootNames: string[];

‎tools/ts-api-guardian/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"test": "test"
1212
},
1313
"peerDependencies": {
14-
"typescript": "~3.2.2"
14+
"typescript": "~3.4.0"
1515
},
1616
"dependencies": {
1717
"chalk": "^2.3.1",
@@ -27,7 +27,7 @@
2727
"chai": "^4.1.2",
2828
"jasmine": "^3.1.0",
2929
"source-map-support": "^0.5.9",
30-
"typescript": "~3.3.3333"
30+
"typescript": "~3.4.2"
3131
},
3232
"repository": {},
3333
"keywords": [
@@ -45,4 +45,4 @@
4545
"url": "https://github.com/angular/angular/issues"
4646
},
4747
"homepage": "https://github.com/angular/angular/tools/ts-api-guardian"
48-
}
48+
}

‎yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -10640,10 +10640,10 @@ typescript@~3.1.6:
1064010640
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68"
1064110641
integrity sha512-tDMYfVtvpb96msS1lDX9MEdHrW4yOuZ4Kdc4Him9oU796XldPYF/t2+uKoX0BBa0hXXwDlqYQbXY5Rzjzc5hBA==
1064210642

10643-
typescript@~3.3.3333:
10644-
version "3.3.3333"
10645-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3333.tgz#171b2c5af66c59e9431199117a3bcadc66fdcfd6"
10646-
integrity sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==
10643+
typescript@~3.4.2:
10644+
version "3.4.2"
10645+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.2.tgz#9ed4e6475d906f589200193be056f5913caed481"
10646+
integrity sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==
1064710647

1064810648
uglify-js@1.2.6, uglify-js@~1.2.5:
1064910649
version "1.2.6"

0 commit comments

Comments
 (0)
Please sign in to comment.