refactor: update angular to support TypeScript 2.4

Detailed updates:
- rxjs@5.0.x
- tsickle@0.24.x
- typescript@2.4.x
- @bazel/typescript@0.10.0
- protractor@5.1.x
- selenium-webdriver@3.0.x

BREAKING CHANGE:
- the Angular compiler now requires TypeScript 2.4.x.
This commit is contained in:
Tobias Bosch 2017-09-08 18:40:32 -07:00 committed by Matias Niemelä
parent 112e777b90
commit ca5aebaa6b
49 changed files with 429 additions and 363 deletions

View File

@ -8,12 +8,15 @@ payloadLimits["hello_world__closure", "gzip7", "bundle"]=35000
payloadLimits["hello_world__closure", "gzip9", "bundle"]=35000
payloadLimits["cli-hello-world", "uncompressed", "inline"]=1500
payloadLimits["cli-hello-world", "uncompressed", "main"]=183000
# TODO(tbosch): find out why this increased, see https://github.com/angular/angular/issues/19113
payloadLimits["cli-hello-world", "uncompressed", "main"]=205000
payloadLimits["cli-hello-world", "uncompressed", "polyfills"]=64000
payloadLimits["cli-hello-world", "gzip7", "inline"]=900
payloadLimits["cli-hello-world", "gzip7", "main"]=48000
# TODO(tbosch): find out why this increased, see https://github.com/angular/angular/issues/19113
payloadLimits["cli-hello-world", "gzip7", "main"]=56000
payloadLimits["cli-hello-world", "gzip7", "polyfills"]=22000
payloadLimits["cli-hello-world", "gzip9", "inline"]=900
payloadLimits["cli-hello-world", "gzip9", "main"]=48000
# TODO(tbosch): find out why this increased, see https://github.com/angular/angular/issues/19113
payloadLimits["cli-hello-world", "gzip9", "main"]=56000
payloadLimits["cli-hello-world", "gzip9", "polyfills"]=22000

View File

@ -9,13 +9,13 @@
"@angular/compiler": "file:../../dist/packages-dist/compiler",
"@angular/core": "file:../../dist/packages-dist/core",
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
"rxjs": "5.3.1",
"zone.js": "0.8.6"
"rxjs": "file:../../node_modules/rxjs",
"zone.js": "file:../../node_modules/zone.js"
},
"devDependencies": {
"@angular/bazel": "file:../../dist/packages-dist/bazel",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"typescript": "~2.3.1",
"typescript": "file:../../node_modules/typescript",
"@types/source-map": "0.5.1"
},
"scripts": {

View File

@ -12,9 +12,9 @@
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
"@angular/tsc-wrapped": "file:../../dist/packages-dist/tsc-wrapped",
"google-closure-compiler": "git+https://github.com/alexeagle/closure-compiler.git#packagejson.dist",
"rxjs": "5.3.1",
"typescript": "~2.3.1",
"zone.js": "0.8.6"
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
},
"devDependencies": {
"@types/jasmine": "2.5.41",

View File

@ -19,8 +19,8 @@
"plugin-typescript": "6.0.4",
"rxjs": "file:../../node_modules/rxjs",
"systemjs": "0.20.2",
"typescript": "2.1.6",
"zone.js": "0.7.6"
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
},
"devDependencies": {
"@types/jasmine": "2.5.41",

View File

@ -12,9 +12,9 @@
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
"@angular/tsc-wrapped": "file:../../dist/packages-dist/tsc-wrapped",
"google-closure-compiler": "git+https://github.com/alexeagle/closure-compiler.git#packagejson.dist",
"rxjs": "5.3.1",
"typescript": "~2.3.1",
"zone.js": "0.8.6"
"rxjs": "file:../../node_modules/rxjs",
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
},
"devDependencies": {
"@types/jasmine": "2.5.41",

View File

@ -17,8 +17,8 @@
"@types/node": "^7.0.5",
"minimist": "^1.2.0",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "^2.1.5",
"zone.js": "0.7.6"
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
},
"scripts": {
"postinstall": "scripts/install.sh",

View File

@ -1,41 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as compiler from '@angular/compiler';
import * as compilerTesting from '@angular/compiler/testing';
import * as core from '@angular/core';
import * as coreTesting from '@angular/core/testing';
import * as forms from '@angular/forms';
import * as http from '@angular/http';
import * as httpTesting from '@angular/http/testing';
import * as platformBrowserDynamic from '@angular/platform-browser-dynamic';
import * as platformBrowser from '@angular/platform-browser';
import * as platformBrowserTesting from '@angular/platform-browser/testing';
import * as platformServer from '@angular/platform-server';
import * as platformServerTesting from '@angular/platform-server/testing';
import * as router from '@angular/router';
import * as routerTesting from '@angular/router/testing';
import * as upgrade from '@angular/upgrade';
export default {
compiler,
compilerTesting,
core,
coreTesting,
forms,
http,
httpTesting,
platformBrowser,
platformBrowserTesting,
platformBrowserDynamic,
platformServer,
platformServerTesting,
router,
routerTesting,
upgrade
};

View File

@ -1,28 +0,0 @@
{
"name": "angular-integration",
"description": "Assert that users with TypeScript 2.2 can type-check an Angular application",
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"@angular/animations": "file:../../dist/packages-dist/animations",
"@angular/common": "file:../../dist/packages-dist/common",
"@angular/compiler": "file:../../dist/packages-dist/compiler",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"@angular/core": "file:../../dist/packages-dist/core",
"@angular/forms": "file:../../dist/packages-dist/forms",
"@angular/http": "file:../../dist/packages-dist/http",
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
"@angular/router": "file:../../dist/packages-dist/router",
"@angular/tsc-wrapped": "file:../../dist/packages-dist/tsc-wrapped",
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
"@types/jasmine": "2.5.41",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "2.3.2",
"zone.js": "0.7.6"
},
"scripts": {
"test": "tsc"
}
}

View File

@ -1,24 +0,0 @@
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "../../dist/typing-test/",
"rootDir": ".",
"target": "es5",
"lib": [
"es5",
"dom",
"es2015.collection",
"es2015.iterable",
"es2015.promise"
],
"types": [],
"strictNullChecks": true
},
"files": [
"include-all.ts",
"node_modules/@types/jasmine/index.d.ts"
]
}

View File

@ -19,8 +19,8 @@
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
"@types/jasmine": "2.5.41",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "2.2.1",
"zone.js": "0.7.6"
"typescript": "file:../../node_modules/typescript",
"zone.js": "file:../../node_modules/zone.js"
},
"scripts": {
"test": "tsc"

View File

@ -25,9 +25,6 @@ describe('Model-Driven Forms', function() {
input.sendKeys('invalid');
firstName.click();
// TODO: getInnerHtml has been deprecated by selenium-webdriver in the
// upcoming release of 3.0.0. Protractor has removed this method from
// ElementFinder but can still be accessed via WebElement.
expect(form.getWebElement().getInnerHtml()).toContain('is invalid credit card number');
expect(form.getAttribute('innerHTML')).toContain('is invalid credit card number');
});
});

View File

@ -25,9 +25,6 @@ describe('Template-Driven Forms', function() {
input.sendKeys('invalid');
firstName.click();
// TODO: getInnerHtml has been deprecated by selenium-webdriver in the
// upcoming release of 3.0.0. Protractor has removed this method from
// ElementFinder but can still be accessed via WebElement.
expect(form.getWebElement().getInnerHtml()).toContain('is invalid credit card number');
expect(form.getAttribute('innerHTML')).toContain('is invalid credit card number');
});
});

View File

@ -1,9 +1,9 @@
{
"name": "angular-srcs",
"version": "5.0.0-beta.5",
"version": "5.0.0-beta.6",
"dependencies": {
"@bazel/typescript": {
"version": "0.0.9",
"version": "0.1.0",
"dependencies": {
"@types/node": {
"version": "7.0.18"
@ -294,7 +294,7 @@
"version": "0.0.32"
},
"@types/selenium-webdriver": {
"version": "2.53.35"
"version": "3.0.6"
},
"@types/systemjs": {
"version": "0.19.32"
@ -568,6 +568,9 @@
"block-stream": {
"version": "0.0.9"
},
"blocking-proxy": {
"version": "0.0.5"
},
"bluebird": {
"version": "2.10.2"
},
@ -3740,8 +3743,17 @@
"globby": {
"version": "5.0.0",
"dependencies": {
"balanced-match": {
"version": "1.0.0"
},
"brace-expansion": {
"version": "1.1.8"
},
"glob": {
"version": "7.1.1"
"version": "7.1.2"
},
"minimatch": {
"version": "3.0.4"
}
}
},
@ -5221,7 +5233,7 @@
"version": "2.4.1"
},
"jasminewd2": {
"version": "0.0.10"
"version": "2.1.0"
},
"jetpack-id": {
"version": "0.0.4"
@ -6316,31 +6328,40 @@
"version": "1.0.5"
},
"protractor": {
"version": "4.0.14",
"version": "5.1.2",
"dependencies": {
"@types/jasmine": {
"version": "2.5.47"
},
"@types/node": {
"version": "6.0.68"
},
"@types/selenium-webdriver": {
"version": "2.53.37"
"version": "2.53.42"
},
"balanced-match": {
"version": "1.0.0"
},
"brace-expansion": {
"version": "1.1.8"
},
"caseless": {
"version": "0.12.0"
},
"glob": {
"version": "7.1.1"
"version": "7.1.2"
},
"har-validator": {
"version": "4.2.1"
},
"jasmine": {
"version": "2.8.0"
},
"jasmine-core": {
"version": "2.8.0"
},
"mime-db": {
"version": "1.27.0"
"version": "1.30.0"
},
"mime-types": {
"version": "2.1.15"
"version": "2.1.17"
},
"minimatch": {
"version": "3.0.4"
},
"qs": {
"version": "6.4.0"
@ -6355,7 +6376,7 @@
"version": "1.3.0"
},
"semver": {
"version": "5.3.0"
"version": "5.4.1"
},
"tough-cookie": {
"version": "2.3.2"
@ -6364,10 +6385,16 @@
"version": "0.6.0"
},
"uuid": {
"version": "3.0.1"
"version": "3.1.0"
},
"webdriver-manager": {
"version": "10.3.0"
"version": "12.0.6"
},
"xml2js": {
"version": "0.4.19"
},
"xmlbuilder": {
"version": "9.0.4"
}
}
},
@ -6743,7 +6770,7 @@
"version": "3.1.2"
},
"rxjs": {
"version": "5.0.1"
"version": "5.4.3"
},
"safe-buffer": {
"version": "5.0.1"
@ -6789,19 +6816,31 @@
"version": "1.0.0"
},
"selenium-webdriver": {
"version": "2.53.3",
"version": "3.0.1",
"dependencies": {
"adm-zip": {
"version": "0.4.4"
"balanced-match": {
"version": "1.0.0"
},
"sax": {
"version": "0.6.1"
"brace-expansion": {
"version": "1.1.8"
},
"glob": {
"version": "7.1.2"
},
"minimatch": {
"version": "3.0.4"
},
"rimraf": {
"version": "2.6.1"
},
"tmp": {
"version": "0.0.24"
"version": "0.0.30"
},
"xml2js": {
"version": "0.4.4"
"version": "0.4.19"
},
"xmlbuilder": {
"version": "9.0.4"
}
}
},
@ -7429,7 +7468,7 @@
}
},
"tsickle": {
"version": "0.23.6"
"version": "0.24.1"
},
"tslib": {
"version": "1.7.1"
@ -7489,7 +7528,7 @@
"version": "0.0.6"
},
"typescript": {
"version": "2.3.4"
"version": "2.4.2"
},
"ua-parser-js": {
"version": "0.7.10"
@ -7766,6 +7805,29 @@
}
}
},
"webdriver-js-extender": {
"version": "1.0.0",
"dependencies": {
"@types/selenium-webdriver": {
"version": "2.53.42"
},
"adm-zip": {
"version": "0.4.4"
},
"sax": {
"version": "0.6.1"
},
"selenium-webdriver": {
"version": "2.53.3"
},
"tmp": {
"version": "0.0.24"
},
"xml2js": {
"version": "0.4.4"
}
}
},
"webpack": {
"version": "1.12.9",
"dependencies": {
@ -7873,7 +7935,7 @@
}
},
"ws": {
"version": "1.1.1"
"version": "1.1.4"
},
"xdg-basedir": {
"version": "2.0.0"

242
npm-shrinkwrap.json generated
View File

@ -1,11 +1,11 @@
{
"name": "angular-srcs",
"version": "5.0.0-beta.5",
"version": "5.0.0-beta.6",
"dependencies": {
"@bazel/typescript": {
"version": "0.0.9",
"from": "@bazel/typescript@latest",
"resolved": "https://registry.npmjs.org/@bazel/typescript/-/typescript-0.0.9.tgz",
"version": "0.1.0",
"from": "@bazel/typescript@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/@bazel/typescript/-/typescript-0.1.0.tgz",
"dependencies": {
"@types/node": {
"version": "7.0.18",
@ -476,9 +476,9 @@
"resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz"
},
"@types/selenium-webdriver": {
"version": "2.53.35",
"from": "@types/selenium-webdriver@latest",
"resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-2.53.35.tgz"
"version": "3.0.6",
"from": "@types/selenium-webdriver@>=3.0.0 <3.1.0",
"resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-3.0.6.tgz"
},
"@types/systemjs": {
"version": "0.19.32",
@ -924,6 +924,11 @@
"from": "block-stream@*",
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz"
},
"blocking-proxy": {
"version": "0.0.5",
"from": "blocking-proxy@0.0.5",
"resolved": "https://registry.npmjs.org/blocking-proxy/-/blocking-proxy-0.0.5.tgz"
},
"bluebird": {
"version": "2.10.2",
"from": "bluebird@>=2.9.27 <3.0.0",
@ -5960,10 +5965,25 @@
"from": "globby@>=5.0.0 <6.0.0",
"resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz",
"dependencies": {
"balanced-match": {
"version": "1.0.0",
"from": "balanced-match@^1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz"
},
"brace-expansion": {
"version": "1.1.8",
"from": "brace-expansion@^1.1.7",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz"
},
"glob": {
"version": "7.1.1",
"version": "7.1.2",
"from": "glob@^7.0.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz"
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz"
},
"minimatch": {
"version": "3.0.4",
"from": "minimatch@^3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz"
}
}
},
@ -8333,9 +8353,9 @@
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.4.1.tgz"
},
"jasminewd2": {
"version": "0.0.10",
"from": "jasminewd2@0.0.10",
"resolved": "https://registry.npmjs.org/jasminewd2/-/jasminewd2-0.0.10.tgz"
"version": "2.1.0",
"from": "jasminewd2@>=2.1.0 <3.0.0",
"resolved": "https://registry.npmjs.org/jasminewd2/-/jasminewd2-2.1.0.tgz"
},
"jetpack-id": {
"version": "0.0.4",
@ -10098,24 +10118,24 @@
"resolved": "https://registry.npmjs.org/protochain/-/protochain-1.0.5.tgz"
},
"protractor": {
"version": "4.0.14",
"from": "protractor@4.0.14",
"resolved": "https://registry.npmjs.org/protractor/-/protractor-4.0.14.tgz",
"version": "5.1.2",
"from": "protractor@>=5.1.0 <5.2.0",
"resolved": "https://registry.npmjs.org/protractor/-/protractor-5.1.2.tgz",
"dependencies": {
"@types/jasmine": {
"version": "2.5.47",
"from": "@types/jasmine@>=2.5.36 <3.0.0",
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.5.47.tgz"
},
"@types/node": {
"version": "6.0.68",
"from": "@types/node@>=6.0.46 <7.0.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.68.tgz"
},
"@types/selenium-webdriver": {
"version": "2.53.37",
"from": "@types/selenium-webdriver@2.53.37",
"resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-2.53.37.tgz"
"version": "2.53.42",
"from": "@types/selenium-webdriver@>=2.53.39 <2.54.0",
"resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-2.53.42.tgz"
},
"balanced-match": {
"version": "1.0.0",
"from": "balanced-match@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz"
},
"brace-expansion": {
"version": "1.1.8",
"from": "brace-expansion@>=1.1.7 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz"
},
"caseless": {
"version": "0.12.0",
@ -10123,24 +10143,39 @@
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz"
},
"glob": {
"version": "7.1.1",
"version": "7.1.2",
"from": "glob@>=7.0.3 <8.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz"
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz"
},
"har-validator": {
"version": "4.2.1",
"from": "har-validator@>=4.2.1 <4.3.0",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz"
},
"jasmine": {
"version": "2.8.0",
"from": "jasmine@>=2.5.3 <3.0.0",
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz"
},
"jasmine-core": {
"version": "2.8.0",
"from": "jasmine-core@>=2.8.0 <2.9.0",
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz"
},
"mime-db": {
"version": "1.27.0",
"from": "mime-db@>=1.27.0 <1.28.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.27.0.tgz"
"version": "1.30.0",
"from": "mime-db@>=1.30.0 <1.31.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz"
},
"mime-types": {
"version": "2.1.15",
"version": "2.1.17",
"from": "mime-types@>=2.1.7 <2.2.0",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.15.tgz"
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz"
},
"minimatch": {
"version": "3.0.4",
"from": "minimatch@>=3.0.4 <4.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz"
},
"qs": {
"version": "6.4.0",
@ -10163,9 +10198,9 @@
"resolved": "https://registry.npmjs.org/saucelabs/-/saucelabs-1.3.0.tgz"
},
"semver": {
"version": "5.3.0",
"version": "5.4.1",
"from": "semver@>=5.3.0 <6.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz"
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz"
},
"tough-cookie": {
"version": "2.3.2",
@ -10178,14 +10213,24 @@
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz"
},
"uuid": {
"version": "3.0.1",
"version": "3.1.0",
"from": "uuid@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz"
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz"
},
"webdriver-manager": {
"version": "10.3.0",
"from": "webdriver-manager@>=10.3.0 <11.0.0",
"resolved": "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-10.3.0.tgz"
"version": "12.0.6",
"from": "webdriver-manager@>=12.0.6 <13.0.0",
"resolved": "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-12.0.6.tgz"
},
"xml2js": {
"version": "0.4.19",
"from": "xml2js@>=0.4.17 <0.5.0",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz"
},
"xmlbuilder": {
"version": "9.0.4",
"from": "xmlbuilder@>=9.0.1 <9.1.0",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz"
}
}
},
@ -10791,9 +10836,9 @@
"resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz"
},
"rxjs": {
"version": "5.0.1",
"from": "rxjs@5.0.1",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.0.1.tgz"
"version": "5.4.3",
"from": "rxjs@>=5.0.0 <6.0.0",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.4.3.tgz"
},
"safe-buffer": {
"version": "5.0.1",
@ -10865,29 +10910,49 @@
"resolved": "https://registry.npmjs.org/scmp/-/scmp-1.0.0.tgz"
},
"selenium-webdriver": {
"version": "2.53.3",
"from": "selenium-webdriver@2.53.3",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-2.53.3.tgz",
"version": "3.0.1",
"from": "selenium-webdriver@>=3.0.0 <3.1.0",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.0.1.tgz",
"dependencies": {
"adm-zip": {
"version": "0.4.4",
"from": "adm-zip@0.4.4",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz"
"balanced-match": {
"version": "1.0.0",
"from": "balanced-match@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz"
},
"sax": {
"version": "0.6.1",
"from": "sax@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz"
"brace-expansion": {
"version": "1.1.8",
"from": "brace-expansion@>=1.1.7 <2.0.0",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz"
},
"glob": {
"version": "7.1.2",
"from": "glob@>=7.0.5 <8.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz"
},
"minimatch": {
"version": "3.0.4",
"from": "minimatch@>=3.0.4 <4.0.0",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz"
},
"rimraf": {
"version": "2.6.1",
"from": "rimraf@>=2.5.4 <3.0.0",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz"
},
"tmp": {
"version": "0.0.24",
"from": "tmp@0.0.24",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.24.tgz"
"version": "0.0.30",
"from": "tmp@0.0.30",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz"
},
"xml2js": {
"version": "0.4.4",
"from": "xml2js@0.4.4",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.4.tgz"
"version": "0.4.19",
"from": "xml2js@>=0.4.17 <0.5.0",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz"
},
"xmlbuilder": {
"version": "9.0.4",
"from": "xmlbuilder@>=9.0.1 <9.1.0",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz"
}
}
},
@ -11897,9 +11962,9 @@
}
},
"tsickle": {
"version": "0.23.6",
"from": "tsickle@0.23.6",
"resolved": "https://registry.npmjs.org/tsickle/-/tsickle-0.23.6.tgz"
"version": "0.24.1",
"from": "tsickle@>=0.24.0 <0.25.0",
"resolved": "https://registry.npmjs.org/tsickle/-/tsickle-0.24.1.tgz"
},
"tslib": {
"version": "1.7.1",
@ -11993,9 +12058,9 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
},
"typescript": {
"version": "2.3.4",
"from": "typescript@2.3.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.3.4.tgz"
"version": "2.4.2",
"from": "typescript@>=2.4.0 <2.5.0",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.2.tgz"
},
"ua-parser-js": {
"version": "0.7.10",
@ -12442,6 +12507,43 @@
}
}
},
"webdriver-js-extender": {
"version": "1.0.0",
"from": "webdriver-js-extender@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-1.0.0.tgz",
"dependencies": {
"@types/selenium-webdriver": {
"version": "2.53.42",
"from": "@types/selenium-webdriver@>=2.53.35 <3.0.0",
"resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-2.53.42.tgz"
},
"adm-zip": {
"version": "0.4.4",
"from": "adm-zip@0.4.4",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz"
},
"sax": {
"version": "0.6.1",
"from": "sax@>=0.6.0 <0.7.0",
"resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz"
},
"selenium-webdriver": {
"version": "2.53.3",
"from": "selenium-webdriver@>=2.53.2 <3.0.0",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-2.53.3.tgz"
},
"tmp": {
"version": "0.0.24",
"from": "tmp@0.0.24",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.24.tgz"
},
"xml2js": {
"version": "0.4.4",
"from": "xml2js@0.4.4",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.4.tgz"
}
}
},
"webpack": {
"version": "1.12.9",
"from": "webpack@>=1.12.6 <2.0.0",
@ -12613,9 +12715,9 @@
}
},
"ws": {
"version": "1.1.1",
"version": "1.1.4",
"from": "ws@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-1.1.1.tgz"
"resolved": "https://registry.npmjs.org/ws/-/ws-1.1.4.tgz"
},
"xdg-basedir": {
"version": "2.0.0",

View File

@ -23,7 +23,7 @@
"dependencies": {
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.3",
"rxjs": "^5.0.1",
"rxjs": "5.x",
"tslib": "^1.7.1",
"zone.js": "^0.8.12"
},
@ -31,7 +31,7 @@
"fsevents": "^1.0.14"
},
"devDependencies": {
"@bazel/typescript": "0.0.7",
"@bazel/typescript": "0.1.x",
"@types/angularjs": "^1.5.13-alpha",
"@types/base64-js": "^1.2.5",
"@types/chokidar": "^1.1.0",
@ -39,7 +39,7 @@
"@types/hammerjs": "^2.0.33",
"@types/jasmine": "^2.2.22-alpha",
"@types/node": "^6.0.84",
"@types/selenium-webdriver": "^2.53.35",
"@types/selenium-webdriver": "^3.0.6",
"@types/systemjs": "^0.19.32",
"angular": "^1.5.0",
"angular-animate": "^1.5.0",
@ -83,7 +83,7 @@
"minimist": "^1.2.0",
"nan": "^2.4.0",
"node-uuid": "1.4.x",
"protractor": "^4.0.14",
"protractor": "5.1.x",
"react": "^0.14.0",
"rewire": "^2.3.3",
"rho": "^0.3.0",
@ -91,17 +91,17 @@
"rollup-plugin-commonjs": "^8.1.0",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"selenium-webdriver": "^2.53.3",
"selenium-webdriver": "3.0.x",
"semver": "^5.1.0",
"sorcery": "^0.10.0",
"source-map": "^0.5.6",
"source-map-support": "^0.4.2",
"systemjs": "0.18.10",
"ts-api-guardian": "^0.2.2",
"tsickle": "^0.23.6",
"tsickle": "0.24.x",
"tslint": "^4.1.1",
"tslint-eslint-rules": "^3.1.0",
"typescript": "^2.3.4",
"typescript": "^2.4.2",
"universal-analytics": "^0.3.9",
"vrsource-tslint-rules": "^4.0.0",
"webpack": "^1.12.6",

View File

@ -6,10 +6,10 @@
"license": "MIT",
"peerDependencies": {
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
"typescript": "~2.3"
"typescript": "^2.4.2"
},
"dependencies": {
"@bazel/typescript": "0.0.9"
"@bazel/typescript": "0.1.x"
},
"repository": {
"type": "git",

View File

@ -155,15 +155,6 @@ export function compile(
ngHost.toSummaryFileName = (fileName: string, referringSrcFileName: string) =>
ngHost.fileNameToModuleName(fileName, referringSrcFileName);
const tsickleOpts = {
googmodule: bazelOpts.googmodule,
es5Mode: bazelOpts.es5Mode,
prelude: bazelOpts.prelude,
untyped: bazelOpts.untyped,
typeBlackListPaths: new Set(bazelOpts.typeBlackListPaths),
transformDecorators: bazelOpts.tsickle,
transformTypesToClosure: bazelOpts.tsickle,
};
const emitCallback: ng.TsEmitCallback = ({
program,
targetSourceFile,
@ -173,7 +164,7 @@ export function compile(
customTransformers = {},
}) =>
tsickle.emitWithTsickle(
program, bazelHost, tsickleOpts, bazelHost, compilerOpts, targetSourceFile, writeFile,
program, bazelHost, bazelHost, compilerOpts, targetSourceFile, writeFile,
cancellationToken, emitOnlyDtsFiles, {
beforeTs: customTransformers.before,
afterTs: customTransformers.after,

View File

@ -12,11 +12,11 @@
"@angular/tsc-wrapped": "5.0.0-beta.6",
"reflect-metadata": "^0.1.2",
"minimist": "^1.2.0",
"tsickle": "^0.23.6",
"tsickle": "^0.24.0",
"chokidar": "^1.4.2"
},
"peerDependencies": {
"typescript": "^2.0.2",
"typescript": "^2.4.2",
"@angular/compiler": "0.0.0-PLACEHOLDER"
},
"repository": {

View File

@ -137,23 +137,25 @@ export class TypeChecker {
if (this._currentCancellationToken.isCancellationRequested()) return result;
const sourceFile = program.getSourceFile(factoryName);
for (const diagnostic of this.diagnosticProgram.getSemanticDiagnostics(sourceFile)) {
const span = this.sourceSpanOf(diagnostic.file, diagnostic.start, diagnostic.length);
if (span) {
const fileName = span.start.file.url;
const diagnosticsList = diagnosticsFor(fileName);
diagnosticsList.push({
messageText: diagnosticMessageToString(diagnostic.messageText),
category: diagnostic.category, span,
source: SOURCE,
code: DEFAULT_ERROR_CODE
});
if (diagnostic.file && diagnostic.start) {
const span = this.sourceSpanOf(diagnostic.file, diagnostic.start);
if (span) {
const fileName = span.start.file.url;
const diagnosticsList = diagnosticsFor(fileName);
diagnosticsList.push({
messageText: diagnosticMessageToString(diagnostic.messageText),
category: diagnostic.category, span,
source: SOURCE,
code: DEFAULT_ERROR_CODE
});
}
}
}
}
return result;
}
private sourceSpanOf(source: ts.SourceFile, start: number, length: number): ParseSourceSpan|null {
private sourceSpanOf(source: ts.SourceFile, start: number): ParseSourceSpan|null {
// Find the corresponding TypeScript node
const info = this.factories.get(source.fileName);
if (info) {

View File

@ -193,7 +193,7 @@ class TypeScriptSymbolQuery implements SymbolQuery {
const type = this.checker.getTypeAtLocation(parameter.type !);
if (type.symbol !.name == 'TemplateRef' && isReferenceType(type)) {
const typeReference = type as ts.TypeReference;
if (typeReference.typeArguments.length === 1) {
if (typeReference.typeArguments && typeReference.typeArguments.length === 1) {
return typeReference.typeArguments[0].symbol;
}
}
@ -261,7 +261,10 @@ class TypeWrapper implements Symbol {
return this.context.checker.getNonNullableType(this.tsType) != this.tsType;
}
get definition(): Definition { return definitionFromTsSymbol(this.tsType.getSymbol()); }
get definition(): Definition|undefined {
const symbol = this.tsType.getSymbol();
return symbol ? definitionFromTsSymbol(symbol) : undefined;
}
members(): SymbolTable {
return new SymbolTableWrapper(this.tsType.getProperties(), this.context);
@ -528,7 +531,10 @@ class PipeSymbol implements Symbol {
get public(): boolean { return true; }
get definition(): Definition { return definitionFromTsSymbol(this.tsType.getSymbol()); }
get definition(): Definition|undefined {
const symbol = this.tsType.getSymbol();
return symbol ? definitionFromTsSymbol(symbol) : undefined;
}
members(): SymbolTable { return EmptyTable.instance; }

View File

@ -55,7 +55,11 @@ export function mainSync(
}
function createEmitCallback(options: api.CompilerOptions): api.TsEmitCallback {
const tsickleOptions: tsickle.TransformerOptions = {
const tsickleHost: tsickle.TsickleHost = {
shouldSkipTsickleProcessing: (fileName) => /\.d\.ts$/.test(fileName),
pathToModuleName: (context, importPath) => '',
shouldIgnoreWarningsForPath: (filePath) => false,
fileNameToModuleId: (fileName) => fileName,
googmodule: false,
untyped: true,
convertIndexImportShorthand: true,
@ -63,13 +67,6 @@ function createEmitCallback(options: api.CompilerOptions): api.TsEmitCallback {
transformTypesToClosure: options.annotateForClosureCompiler,
};
const tsickleHost: tsickle.TransformerHost = {
shouldSkipTsickleProcessing: (fileName) => /\.d\.ts$/.test(fileName),
pathToModuleName: (context, importPath) => '',
shouldIgnoreWarningsForPath: (filePath) => false,
fileNameToModuleId: (fileName) => fileName,
};
return ({
program,
targetSourceFile,
@ -81,7 +78,7 @@ function createEmitCallback(options: api.CompilerOptions): api.TsEmitCallback {
options
}) =>
tsickle.emitWithTsickle(
program, tsickleHost, tsickleOptions, host, options, targetSourceFile, writeFile,
program, tsickleHost, host, options, targetSourceFile, writeFile,
cancellationToken, emitOnlyDtsFiles, {
beforeTs: customTransformers.before,
afterTs: customTransformers.after,

View File

@ -142,8 +142,8 @@ export function performCompilation({rootNames, options, host, oldProgram, emitCa
}): PerformCompilationResult {
const [major, minor] = ts.version.split('.');
if (Number(major) < 2 || (Number(major) === 2 && Number(minor) < 3)) {
throw new Error('Must use TypeScript > 2.3 to have transformer support');
if (Number(major) < 2 || (Number(major) === 2 && Number(minor) < 4)) {
throw new Error('The Angular Compiler requires TypeScript >= 2.4.');
}
let program: api.Program|undefined;

View File

@ -190,7 +190,7 @@ class _NodeEmitterVisitor implements StatementVisitor, ExpressionVisitor {
// TODO {chuckj}: Determine what should be done for a method with a null name.
const methods = stmt.methods.filter(method => method.name)
.map(
method => ts.createMethodDeclaration(
method => ts.createMethod(
/* decorators */ undefined, /* modifiers */ undefined,
/* astriskToken */ undefined, method.name !/* guarded by filter */,
/* questionToken */ undefined, /* typeParameters */ undefined,

View File

@ -70,8 +70,10 @@ describe('ng type checker', () => {
it('should accept a safe property access of a nullable person',
() => { a('{{maybePerson?.name}}'); });
it('should accept a function call', () => { a('{{getName()}}'); });
it('should reject an invalid method',
() => { r('{{getFame()}}', `Property 'getFame' does not exist on type 'AppComponent'.`); });
it('should reject an invalid method', () => {
r('{{getFame()}}',
`Property 'getFame' does not exist on type 'AppComponent'. Did you mean 'getName'?`);
});
it('should accept a field access of a method result', () => { a('{{getPerson().name}}'); });
it('should reject an invalid field reference of a method result',
() => { r('{{getPerson().fame}}', `Property 'fame' does not exist on type 'Person'.`); });

View File

@ -63,8 +63,9 @@ export interface IterableChanges<V> {
* of the item, after applying the operations up to this point.
*/
forEachOperation(
fn: (record: IterableChangeRecord<V>, previousIndex: number, currentIndex: number) => void):
void;
fn:
(record: IterableChangeRecord<V>, previousIndex: number|null,
currentIndex: number|null) => void): void;
/**
* Iterate over changes in the order of original `Iterable` showing where the original items

View File

@ -647,9 +647,9 @@ function commonTests() {
it('should call onUnstable and onMicrotaskEmpty before and after each turn, respectively',
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
let aResolve: (result: string | null) => void;
let aPromise: Promise<string>;
let aPromise: Promise<string|null>;
let bResolve: (result: string | null) => void;
let bPromise: Promise<string>;
let bPromise: Promise<string|null>;
runNgZoneNoLog(() => {
macroTask(() => {

View File

@ -140,7 +140,7 @@ ng1AppModule.factory(
// #docregion downgrade-ng2-heroes-service
// Register an AngularJS service, whose value is the "downgraded" Angular injectable.
ng1AppModule.factory('heroesService', downgradeInjectable(HeroesService));
ng1AppModule.factory('heroesService', downgradeInjectable(HeroesService) as any);
// #enddocregion
// #docregion ng2-heroes-wrapper

View File

@ -67,7 +67,10 @@ function angularOnlyFilter(ls: ts.LanguageService): ts.LanguageService {
getCodeFixesAtPosition: (fileName, start, end, errorCodes) => <ts.CodeAction[]>[],
getEmitOutput: fileName => <ts.EmitOutput><any>undefined,
getProgram: () => ls.getProgram(),
dispose: () => ls.dispose()
dispose: () => ls.dispose(),
getApplicableRefactors: (fileName, positionOrRaneg) => <ts.ApplicableRefactorInfo[]>[],
getEditsForRefactor: (fileName, formatOptions, positionOrRange, refactorName, actionName) =>
undefined,
};
}
@ -162,7 +165,10 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
getCodeFixesAtPosition: tryFilenameFourCall(ls.getCodeFixesAtPosition),
getEmitOutput: tryFilenameCall(ls.getEmitOutput),
getProgram: () => ls.getProgram(),
dispose: () => ls.dispose()
dispose: () => ls.dispose(),
getApplicableRefactors: (fileName, positionOrRaneg) => <ts.ApplicableRefactorInfo[]>[],
getEditsForRefactor: (fileName, formatOptions, positionOrRange, refactorName, actionName) =>
undefined,
};
}

View File

@ -147,6 +147,8 @@ export class MockTypescriptHost implements ts.LanguageServiceHost {
return fs.existsSync(effectiveName);
}
fileExists(fileName: string): boolean { return this.getRawFileContent(fileName) != null; }
getMarkerLocations(fileName: string): {[name: string]: number}|undefined {
let content = this.getRawFileContent(fileName);
if (content) {

View File

@ -259,7 +259,7 @@ function expectEntries(locationMarker: string, info: ts.CompletionInfo, ...names
function expectNoDiagnostics(diagnostics: ts.Diagnostic[]) {
for (const diagnostic of diagnostics) {
let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
if (diagnostic.start) {
if (diagnostic.file && diagnostic.start) {
let {line, character} = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
console.error(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
} else {

View File

@ -12,6 +12,7 @@
"@angular/common": "file:../../../dist/packages-dist/common",
"@angular/compiler": "file:../../../dist/packages-dist/compiler",
"@angular/compiler-cli": "file:../../../dist/packages-dist/compiler-cli",
"@angular/tsc-wrapped": "file:../../../dist/packages-dist/tsc-wrapped",
"@angular/core": "file:../../../dist/packages-dist/core",
"@angular/http": "file:../../../dist/packages-dist/http",
"@angular/platform-browser": "file:../../../dist/packages-dist/platform-browser",
@ -19,8 +20,8 @@
"@angular/platform-server": "file:../../../dist/packages-dist/platform-server",
"express": "^4.14.1",
"rxjs": "file:../../../node_modules/rxjs",
"typescript": "2.3.x",
"zone.js": "^0.8.10"
"typescript": "file:../../../node_modules/typescript",
"zone.js": "file:../../../node_modules/zone.js"
},
"devDependencies": {
"@types/jasmine": "2.5.41",
@ -33,7 +34,7 @@
"webpack": "^2.2.1"
},
"scripts": {
"postinstall": "webdriver-manager update",
"postinstall": "webdriver-manager update --gecko false",
"build": "./build.sh",
"test": "npm run build && concurrently \"npm run serve\" \"npm run protractor\" --kill-others --success first",
"serve": "node built/server-bundle.js",

View File

@ -11,9 +11,9 @@
"license": "MIT",
"repository": {"type":"git","url":"https://github.com/angular/angular.git"},
"dependencies": {
"tsickle": "^0.23.5"
"tsickle": "^0.24.0"
},
"peerDependencies": {
"typescript": "^2.1.5"
"typescript": "^2.4.2"
}
}

View File

@ -54,6 +54,9 @@ export function main(
if (diagnostics) (ts as any).performance.enable();
let host = ts.createCompilerHost(parsed.options, true);
// Make sure we do not `host.realpath()` from TS as we do not want to resolve symlinks.
// https://github.com/Microsoft/TypeScript/issues/9552
host.realpath = (fileName: string) => fileName;
// If the compilation is a flat module index then produce the flat module index
// metadata and the synthetic flat module index.
@ -65,20 +68,19 @@ export function main(
host = bundleHost;
}
const tsickleCompilerHostOptions:
tsickle.Options = {googmodule: false, untyped: true, convertIndexImportShorthand: false};
const tsickleHost: tsickle.TsickleHost = {
shouldSkipTsickleProcessing: (fileName) => /\.d\.ts$/.test(fileName),
pathToModuleName: (context, importPath) => '',
shouldIgnoreWarningsForPath: (filePath) => false,
fileNameToModuleId: (fileName) => fileName,
googmodule: false,
untyped: true,
convertIndexImportShorthand: false,
transformDecorators: ngOptions.annotationsAs !== 'decorators',
transformTypesToClosure: ngOptions.annotateForClosureCompiler,
};
const tsickleCompilerHost =
new tsickle.TsickleCompilerHost(host, ngOptions, tsickleCompilerHostOptions, tsickleHost);
const program = createProgram(tsickleCompilerHost);
const program = createProgram(host);
const errors = program.getOptionsDiagnostics();
check(errors);
@ -95,48 +97,19 @@ export function main(
if (ngOptions.alwaysCompileGeneratedCode) {
genFiles.forEach(genFileName => addGeneratedFileName(genFileName));
}
let definitionsHost: ts.CompilerHost = tsickleCompilerHost;
if (!ngOptions.skipMetadataEmit) {
// if tsickle is not not used for emitting, but we do use the MetadataWriterHost,
// it also needs to emit the js files.
const emitJsFiles =
ngOptions.annotationsAs === 'decorators' && !ngOptions.annotateForClosureCompiler;
definitionsHost = new MetadataWriterHost(tsickleCompilerHost, ngOptions, emitJsFiles);
host = new MetadataWriterHost(host, ngOptions, true);
}
// Create a new program since codegen files were created after making the old program
let programWithCodegen = createProgram(definitionsHost, program);
let programWithCodegen = createProgram(host, program);
tsc.typeCheck(host, programWithCodegen);
let programForJsEmit = programWithCodegen;
if (ngOptions.annotationsAs !== 'decorators') {
if (diagnostics) console.time('NG downlevel');
tsickleCompilerHost.reconfigureForRun(programForJsEmit, tsickle.Pass.DECORATOR_DOWNLEVEL);
// A program can be re-used only once; save the programWithCodegen to be reused by
// metadataWriter
programForJsEmit = createProgram(tsickleCompilerHost);
check(tsickleCompilerHost.diagnostics);
if (diagnostics) console.timeEnd('NG downlevel');
}
if (ngOptions.annotateForClosureCompiler) {
if (diagnostics) console.time('NG JSDoc');
tsickleCompilerHost.reconfigureForRun(programForJsEmit, tsickle.Pass.CLOSURIZE);
programForJsEmit = createProgram(tsickleCompilerHost);
check(tsickleCompilerHost.diagnostics);
if (diagnostics) console.timeEnd('NG JSDoc');
}
// Emit *.js and *.js.map
tsc.emit(programForJsEmit);
// Emit *.d.ts and maybe *.metadata.json
// Not in the same emit pass with above, because tsickle erases
// decorators which we want to read or document.
// Do this emit second since TypeScript will create missing directories for us
// in the standard emit.
tsc.emit(programWithCodegen);
if (diagnostics) console.time('Emit');
const {diagnostics: emitDiags} =
tsickle.emitWithTsickle(programWithCodegen, tsickleHost, host, ngOptions);
if (diagnostics) console.timeEnd('Emit');
check(emitDiags);
if (diagnostics) {
(ts as any).performance.forEachMeasure(

View File

@ -67,8 +67,10 @@ export function formatDiagnostics(diags: ts.Diagnostic[]): string {
let res = ts.DiagnosticCategory[d.category];
if (d.file) {
res += ' at ' + d.file.fileName + ':';
const {line, character} = d.file.getLineAndCharacterOfPosition(d.start);
res += (line + 1) + ':' + (character + 1) + ':';
if (d.start !== undefined) {
const {line, character} = d.file.getLineAndCharacterOfPosition(d.start);
res += (line + 1) + ':' + (character + 1) + ':';
}
}
res += ' ' + ts.flattenDiagnosticMessageText(d.messageText, '\n');
return res;

View File

@ -75,7 +75,7 @@ describe('tsc-wrapped', () => {
// No helpers since decorators were lowered
expect(out).not.toContain('__decorate');
// Expand `export *` and fix index import
expect(out).toContain(`export { A, B } from './dep'`);
expect(out).toContain(`export { A, B } from "./dep"`);
// Annotated for Closure compiler
expect(out).toContain('* @param {?} x');
// Comments should stay multi-line
@ -112,7 +112,7 @@ describe('tsc-wrapped', () => {
.then(() => {
const out = readOut('js');
// Expand `export *` and fix index import
expect(out).toContain(`export { A, B } from './dep'`);
expect(out).toContain(`export { A, B } from "./dep"`);
// Annotated for Closure compiler
expect(out).toContain('* @param {?} x');
done();
@ -327,7 +327,7 @@ describe('tsc-wrapped', () => {
main(basePath, {basePath})
.then(() => {
const out = readOut('js.map');
expect(out).toContain('"sources":["other_test.ts","../test.ts"]');
expect(out).toContain('"sources":["other_test.ts"]');
done();
})
.catch(e => done.fail(e));
@ -361,7 +361,7 @@ describe('tsc-wrapped', () => {
main(basePath, {basePath})
.then(() => {
const out = readOut('js.map');
expect(out).toContain('"sources":["other_test.ts","../test.ts"]');
expect(out).toContain('"sources":["other_test.ts"]');
done();
})
.catch(e => done.fail(e));
@ -387,7 +387,7 @@ describe('tsc-wrapped', () => {
main(basePath, {basePath})
.then(() => {
const fileOutput = readOut('js');
expect(fileOutput).toContain(`export { A, B } from './dep'`);
expect(fileOutput).toContain(`export { A, B } from "./dep"`);
done();
})
.catch(e => done.fail(e));

View File

@ -97,7 +97,7 @@ describe('Symbols', () => {
switch (node.kind) {
case ts.SyntaxKind.VariableStatement:
case ts.SyntaxKind.VariableDeclarationList:
return ts.forEachChild(node, visit);
return !!ts.forEachChild(node, visit);
case ts.SyntaxKind.VariableDeclaration:
const variableDeclaration = <ts.VariableDeclaration>node;
const nameNode = <ts.Identifier>variableDeclaration.name;

View File

@ -34,6 +34,8 @@ export class Host implements ts.LanguageServiceHost {
if (content) return ts.ScriptSnapshot.fromString(content);
}
fileExists(fileName: string): boolean { return this.getFileContent(fileName) != null; }
getCurrentDirectory(): string { return '/'; }
getDefaultLibFileName(options: ts.CompilerOptions): string { return 'lib.d.ts'; }
@ -91,8 +93,10 @@ export class MockNode implements ts.Node {
getText(sourceFile?: ts.SourceFile): string { return ''; }
getFirstToken(sourceFile?: ts.SourceFile): ts.Node { return null as any as ts.Node; }
getLastToken(sourceFile?: ts.SourceFile): ts.Node { return null as any as ts.Node; }
forEachChild<T>(cbNode: (node: ts.Node) => T, cbNodeArray?: (nodes: ts.Node[]) => T): T {
return null as any as T;
forEachChild<T>(
cbNode: (node: ts.Node) => T | undefined,
cbNodeArray?: (nodes: ts.NodeArray<ts.Node>) => T | undefined): T|undefined {
return undefined;
}
}
@ -105,6 +109,7 @@ export class MockIdentifier extends MockNode implements ts.Identifier {
public _incrementExpressionBrand: any;
public _unaryExpressionBrand: any;
public _expressionBrand: any;
public _updateExpressionBrand: any;
// tslint:enable
constructor(
@ -149,9 +154,11 @@ export class MockSymbol implements ts.Symbol {
export function expectNoDiagnostics(diagnostics: ts.Diagnostic[]) {
for (const diagnostic of diagnostics) {
const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
const {line, character} = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
// tslint:disable-next-line:no-console
console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
if (diagnostic.file && diagnostic.start) {
const {line, character} = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
// tslint:disable-next-line:no-console
console.log(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
}
}
expect(diagnostics.length).toBe(0);
}
@ -164,14 +171,8 @@ export function expectValidSources(service: ts.LanguageService, program: ts.Prog
}
}
export function allChildren<T>(node: ts.Node, cb: (node: ts.Node) => T): T {
return ts.forEachChild(node, child => {
const result = cb(node);
if (result) {
return result;
}
return allChildren(child, cb);
});
export function allChildren<T>(node: ts.Node, cb: (node: ts.Node) => T | undefined): T|undefined {
return ts.forEachChild(node, child => cb(node) || allChildren(child, cb));
}
export function findClass(sourceFile: ts.SourceFile, name: string): ts.ClassDeclaration|undefined {

View File

@ -18,6 +18,9 @@
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": [],
"experimentalDecorators": true,
// This is needed due to https://github.com/Microsoft/TypeScript/issues/17516.
// As tsickle will lower decorators before TS, this is not a problem for our build.
"emitDecoratorMetadata": true,
"sourceMap": true,
"inlineSources": true
}

View File

@ -550,9 +550,10 @@ export class UpgradeAdapter {
(ng1Injector: angular.IInjectorService, rootScope: angular.IRootScopeService) => {
UpgradeNg1ComponentAdapterBuilder.resolve(this.ng1ComponentsToBeUpgraded, ng1Injector)
.then(() => {
// At this point we have ng1 injector and we have prepared
// ng1 components to be upgraded, we now can bootstrap ng2.
@NgModule({
// Note: There is a bug in TS 2.4 that prevents us from
// inlining this into @NgModule
// TODO(tbosch): find or file a bug against TypeScript for this.
const ngModule = {
providers: [
{provide: $INJECTOR, useFactory: () => ng1Injector},
{provide: $COMPILE, useFactory: () => ng1Injector.get($COMPILE)},
@ -560,7 +561,10 @@ export class UpgradeAdapter {
],
imports: [this.ng2AppModule],
entryComponents: this.downgradedComponents
})
};
// At this point we have ng1 injector and we have prepared
// ng1 components to be upgraded, we now can bootstrap ng2.
@NgModule(ngModule)
class DynamicNgUpgradeModule {
constructor() {}
ngDoBootstrap() {}

View File

@ -38,7 +38,12 @@ export class UpgradeNg1ComponentAdapterBuilder {
name.replace(CAMEL_CASE, (all: string, next: string) => '-' + next.toLowerCase());
const self = this;
@Directive({selector: selector, inputs: this.inputsRename, outputs: this.outputsRename})
// Note: There is a bug in TS 2.4 that prevents us from
// inlining this into @Directive
// TODO(tbosch): find or file a bug against TypeScript for this.
const directive = {selector: selector, inputs: this.inputsRename, outputs: this.outputsRename};
@Directive(directive)
class MyClass {
directive: angular.IDirective;
constructor(

View File

@ -42,7 +42,9 @@ travisFoldEnd "npm-install"
# Install Selenium WebDriver
travisFoldStart "webdriver-manager-update"
$(npm bin)/webdriver-manager update
# --gecko false prevents webdriver-manager to ping Github for updates
# which can hit the Github api limit.
$(npm bin)/webdriver-manager update --gecko false
travisFoldEnd "webdriver-manager-update"

View File

@ -8,11 +8,11 @@ LINKABLE_PKGS=(
$(pwd)/dist/packages-dist/{common,forms,core,compiler,compiler-cli,platform-{browser,server},platform-browser-dynamic,router,http,animations,tsc-wrapped}
)
TYPESCRIPT_2_3=typescript@2.3.x
TYPESCRIPT_2_4=typescript@2.4.x
PKGS=(
reflect-metadata@0.1.8
zone.js@0.6.25
rxjs@5.0.1
zone.js@0.8.7
rxjs@5.4.2
@types/{node@6.0.38,jasmine@2.2.33}
jasmine@2.4.1
webpack@2.1.0-beta.21
@ -33,7 +33,7 @@ cp -v package.json $TMP
(
cd $TMP
set -ex -o pipefail
npm install ${PKGS[*]} $TYPESCRIPT_2_3
npm install ${PKGS[*]} $TYPESCRIPT_2_4
# TODO(alexeagle): allow this to be npm link instead
npm install ${LINKABLE_PKGS[*]}

View File

@ -287,8 +287,8 @@ export declare class NgIfContext {
/** @experimental */
export declare class NgLocaleLocalization extends NgLocalization {
protected locale: string;
protected useV4Plurals: boolean;
constructor(locale: string, useV4Plurals?: boolean);
protected useV4Plurals: boolean | undefined;
constructor(locale: string, useV4Plurals?: boolean | undefined);
getPluralCategory(value: any, locale?: string): string;
}

View File

@ -500,7 +500,7 @@ export interface IterableChanges<V> {
forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;
forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;
forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number, currentIndex: number) => void): void;
forEachOperation(fn: (record: IterableChangeRecord<V>, previousIndex: number | null, currentIndex: number | null) => void): void;
forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void;
forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;
}

View File

@ -73,9 +73,9 @@ export declare abstract class ServiceMessageBrokerFactory {
/** @experimental */
export declare class UiArguments {
args: FnArg[];
args: FnArg[] | undefined;
method: string;
constructor(method: string, args?: FnArg[]);
constructor(method: string, args?: FnArg[] | undefined);
}
/** @stable */

View File

@ -1,6 +1,6 @@
/** @deprecated */
export declare class UpgradeAdapter {
constructor(ng2AppModule: Type<any>, compilerOptions?: CompilerOptions);
constructor(ng2AppModule: Type<any>, compilerOptions?: CompilerOptions | undefined);
bootstrap(element: Element, modules?: any[], config?: angular.IAngularBootstrapConfig): UpgradeAdapterRef;
downgradeNg2Component(component: Type<any>): Function;
downgradeNg2Provider(token: any): Function;

View File

@ -35,8 +35,8 @@ class TypedefWalker extends RuleWalker {
return comment.indexOf('@internal') >= 0;
}
private assertInternalAnnotationPresent(node: ts.Declaration) {
if (node.name.getText().charAt(0) !== '_') return;
private assertInternalAnnotationPresent(node: ts.NamedDeclaration) {
if (node.name && node.name.getText().charAt(0) !== '_') return;
if (ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Private) return;
const ranges = ts.getLeadingCommentRanges(this.getSourceFile().text, node.pos);