Skip to content
Permalink
Browse files

feat: add support for TypeScript 3.3 (and drop older versions) (#29004)

https://blogs.msdn.microsoft.com/typescript/2019/01/31/announcing-typescript-3-3/

BREAKING CHANGE: TypeScript 3.1 and 3.2 are no longer supported.

Please update your TypeScript version to 3.3

PR Close #29004
  • Loading branch information...
IgorMinar authored and kara committed Feb 2, 2019
1 parent 9a7f560 commit 75748d6044769710a1bbcf6a5e137ad01c4cbc94
@@ -157,7 +157,7 @@
"tree-kill": "^1.1.0",
"ts-node": "^3.3.0",
"tslint": "~5.9.1",
"typescript": "^3.2.2",
"typescript": "~3.3.3333",
"uglify-js": "^3.0.15",
"unist-util-filter": "^0.2.1",
"unist-util-source": "^1.0.1",
@@ -10125,6 +10125,11 @@ typescript@^2.4.1:
version "2.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"

typescript@~3.3.3333:
version "3.3.3333"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3333.tgz#171b2c5af66c59e9431199117a3bcadc66fdcfd6"
integrity sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==

uglify-es@^3.3.4:
version "3.3.9"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
@@ -26,6 +26,11 @@ function testBazel() {
# Create project
ng new demo --collection=@angular/bazel --defaults --skip-git --skip-install --style=scss
cd demo
# Do an initial install to ensure packages like node-sass are built.
yarn
# Force more recent TS version until new Angular CLI projects also use it.
# --ignore-scripts is necessary because there is a postinstall script that uses ngc.
yarn add typescript@3.3.3333 --dev --ignore-scripts
installLocalPackages
yarn webdriver-manager update --gecko=false --standalone=false ${CI_CHROMEDRIVER_VERSION_ARG:---versions.chrome 2.45}
ng generate component widget --style=css
@@ -22,7 +22,7 @@
"@types/jasmine": "2.8.8",
"@types/source-map": "0.5.1",
"protractor": "5.1.2",
"typescript": "3.1.1"
"typescript": "3.3.3333"
},
"scripts": {
"postinstall": "ngc -p ./angular-metadata.tsconfig.json",

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -1,6 +1,6 @@
{
"name": "angular-integration",
"description": "Assert that users with TypeScript 3.2 can type-check an Angular application",
"description": "Assert that users with TypeScript 3.3 can type-check an Angular application",
"version": "0.0.0",
"license": "MIT",
"dependencies": {
@@ -22,7 +22,7 @@
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
"@types/jasmine": "2.5.41",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "3.2.x",
"typescript": "3.3.x",
"zone.js": "file:../../node_modules/zone.js"
},
"scripts": {
File renamed without changes.
@@ -94,9 +94,9 @@
"source-map": "^0.6.1",
"source-map-support": "0.5.9",
"systemjs": "0.18.10",
"tsickle": "0.34.0",
"tsickle": "0.34.3",
"tslib": "^1.9.0",
"typescript": "~3.2.2",
"typescript": "~3.3.3333",
"xhr2": "0.1.4",
"yargs": "9.0.1",
"zone.js": "^0.8.26"
@@ -157,4 +157,4 @@
"resolutions": {
"natives": "1.1.6"
}
}
}
@@ -28,11 +28,11 @@
"@types/node": "6.0.84",
"semver": "^5.6.0",
"shelljs": "0.8.2",
"tsickle": "0.34.0"
"tsickle": "0.34.3"
},
"peerDependencies": {
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
"typescript": ">=3.1.1 <3.3"
"typescript": ">=3.3.3333 <3.4"
},
"repository": {
"type": "git",
@@ -300,7 +300,7 @@ export * from './index';

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
@@ -316,7 +316,7 @@ export { MyModule } from './mymodule';

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
@@ -337,7 +337,7 @@ MyModule.decorators = [

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
@@ -371,7 +371,7 @@ export * from './index';

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
@@ -514,7 +514,7 @@ import { NgModule } from '@angular/core';

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class SecondaryModule {
}
@@ -526,7 +526,7 @@ const a = 1;

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/

/**
@@ -549,7 +549,7 @@ import { NgModule } from '@angular/core';

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
class MyModule {
}
@@ -559,7 +559,7 @@ MyModule.decorators = [

/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/

/**
@@ -24,7 +24,7 @@
},
"peerDependencies": {
"@angular/compiler": "0.0.0-PLACEHOLDER",
"typescript": ">=3.1.1 <3.3"
"typescript": ">=3.3.3333 <3.4"
},
"engines": {
"node": ">=8.0"
@@ -44,6 +44,9 @@ export class GeneratedShimsHostWrapper implements ts.CompilerHost {
if (delegate.directoryExists !== undefined) {
this.directoryExists = (directoryName: string) => delegate.directoryExists !(directoryName);
}
if (delegate.getDirectories !== undefined) {
this.getDirectories = (path: string) => delegate.getDirectories !(path);
}
}

resolveTypeReferenceDirectives?:
@@ -84,7 +87,7 @@ export class GeneratedShimsHostWrapper implements ts.CompilerHost {

getCurrentDirectory(): string { return this.delegate.getCurrentDirectory(); }

getDirectories(path: string): string[] { return this.delegate.getDirectories(path); }
getDirectories?: (path: string) => string[];

getCanonicalFileName(fileName: string): string {
return this.delegate.getCanonicalFileName(fileName);
@@ -41,6 +41,9 @@ export class SyntheticFilesCompilerHost implements PluginCompilerHost {
this.syntheticFiles.set(generated.fileName, generated);
}
}
if (delegate.getDirectories !== undefined) {
this.getDirectories = (path: string) => delegate.getDirectories !(path);
}
}

fileExists(filePath: string): boolean {
@@ -88,7 +91,7 @@ export class SyntheticFilesCompilerHost implements PluginCompilerHost {

getNewLine(): string { return this.delegate.getNewLine(); }

getDirectories(path: string) { return this.delegate.getDirectories(path); }
getDirectories?: (path: string) => string[];

readFile(fileName: string): string|undefined { return this.delegate.readFile(fileName); }

@@ -34,6 +34,10 @@ export class TypeCheckProgramHost implements ts.CompilerHost {
// as efficient as possible. To support both of these requirements, all of the program's
// source files are loaded into the cache up front.
program.getSourceFiles().forEach(file => { this.sfCache.set(file.fileName, file); });

if (delegate.getDirectories !== undefined) {
this.getDirectories = (path: string) => delegate.getDirectories !(path);
}
}

getSourceFile(
@@ -77,7 +81,7 @@ export class TypeCheckProgramHost implements ts.CompilerHost {

getCurrentDirectory(): string { return this.delegate.getCurrentDirectory(); }

getDirectories(path: string): string[] { return this.delegate.getDirectories(path); }
getDirectories?: (path: string) => string[];

getCanonicalFileName(fileName: string): string {
return this.delegate.getCanonicalFileName(fileName);
Oops, something went wrong.

0 comments on commit 75748d6

Please sign in to comment.
You can’t perform that action at this time.