From 9a7f5d580fbb377be39cfaa518f55f4825f20bf5 Mon Sep 17 00:00:00 2001 From: Chuck Jazdzewski Date: Tue, 16 May 2017 13:29:38 -0700 Subject: [PATCH] ci: update build to use TypeScript 2.3.2 (#16707) --- integration/.gitignore | 1 + npm-shrinkwrap.clean.json | 5 ++--- npm-shrinkwrap.json | 13 ++++++------- package.json | 1 + packages/compiler/src/i18n/extractor_merger.ts | 2 +- .../differs/default_iterable_differ.ts | 2 +- packages/core/test/view/component_view_spec.ts | 4 ++-- packages/core/test/view/element_spec.ts | 4 ++-- packages/core/test/view/helper.ts | 7 ++++++- packages/http/test/backends/xhr_backend_spec.ts | 2 +- packages/language-service/src/ts_plugin.ts | 9 ++++++++- 11 files changed, 31 insertions(+), 19 deletions(-) diff --git a/integration/.gitignore b/integration/.gitignore index 636eb80144..297cd21083 100644 --- a/integration/.gitignore +++ b/integration/.gitignore @@ -5,5 +5,6 @@ vendor/ */src/*.js **/*.ngfactory.ts **/*.ngsummary.json +**/*.ngsummary.ts */yarn* */.yarn_local_cache* diff --git a/npm-shrinkwrap.clean.json b/npm-shrinkwrap.clean.json index 584b4fa4d1..aea634bf5d 100644 --- a/npm-shrinkwrap.clean.json +++ b/npm-shrinkwrap.clean.json @@ -1,6 +1,6 @@ { "name": "angular-srcs", - "version": "4.1.0", + "version": "4.2.0-beta.0", "dependencies": { "@types/angularjs": { "version": "1.5.13-alpha", @@ -6279,8 +6279,7 @@ "dev": true }, "typescript": { - "version": "2.1.5", - "dev": true + "version": "2.3.2" }, "ua-parser-js": { "version": "0.7.10", diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d07fd26cf9..2039949d46 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "angular-srcs", - "version": "4.1.0", + "version": "4.2.0-beta.0", "dependencies": { "@types/angularjs": { "version": "1.5.13-alpha", @@ -2741,7 +2741,7 @@ }, "canonical-path": { "version": "0.0.2", - "from": "canonical-path@>=0.0.2 <0.0.3", + "from": "canonical-path@0.0.2", "resolved": "https://registry.npmjs.org/canonical-path/-/canonical-path-0.0.2.tgz", "dev": true }, @@ -3488,7 +3488,7 @@ }, "dgeni-packages": { "version": "0.16.5", - "from": "dgeni-packages@>=0.16.0 <0.17.0", + "from": "dgeni-packages@>=0.16.5 <0.17.0", "resolved": "https://registry.npmjs.org/dgeni-packages/-/dgeni-packages-0.16.5.tgz", "dev": true, "dependencies": { @@ -9183,10 +9183,9 @@ "dev": true }, "typescript": { - "version": "2.1.5", - "from": "typescript@>=2.1.0 <2.2.0", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.1.5.tgz", - "dev": true + "version": "2.3.2", + "from": "typescript@>=2.3.0 <2.4.0", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.3.2.tgz" }, "ua-parser-js": { "version": "0.7.10", diff --git a/package.json b/package.json index 5fdbff3dad..38c38250bd 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "^5.0.1", + "typescript": "^2.3.2", "zone.js": "^0.8.9" }, "optionalDependencies": { diff --git a/packages/compiler/src/i18n/extractor_merger.ts b/packages/compiler/src/i18n/extractor_merger.ts index 56d8fe6b61..1cae8b9464 100644 --- a/packages/compiler/src/i18n/extractor_merger.ts +++ b/packages/compiler/src/i18n/extractor_merger.ts @@ -456,7 +456,7 @@ class _Visitor implements html.Visitor { 0); if (significantChildren == 1) { - for (let i = this._messages.length - 1; i >= startIndex; i--) { + for (let i = this._messages.length - 1; i >= startIndex !; i--) { const ast = this._messages[i].nodes; if (!(ast.length == 1 && ast[0] instanceof i18n.Text)) { this._messages.splice(i, 1); diff --git a/packages/core/src/change_detection/differs/default_iterable_differ.ts b/packages/core/src/change_detection/differs/default_iterable_differ.ts index 72a4963069..8c151aa2d4 100644 --- a/packages/core/src/change_detection/differs/default_iterable_differ.ts +++ b/packages/core/src/change_detection/differs/default_iterable_differ.ts @@ -669,7 +669,7 @@ class _DuplicateItemRecordList { get(trackById: any, afterIndex: number|null): IterableChangeRecord_|null { let record: IterableChangeRecord_|null; for (record = this._head; record !== null; record = record._nextDup) { - if ((afterIndex === null || afterIndex < record.currentIndex) && + if ((afterIndex === null || afterIndex < record.currentIndex !) && looseIdentical(record.trackById, trackById)) { return record; } diff --git a/packages/core/test/view/component_view_spec.ts b/packages/core/test/view/component_view_spec.ts index 07eed2abab..a7e93fd3e4 100644 --- a/packages/core/test/view/component_view_spec.ts +++ b/packages/core/test/view/component_view_spec.ts @@ -10,7 +10,7 @@ import {Injector, RenderComponentType, RootRenderer, Sanitizer, SecurityContext, import {ArgumentType, BindingFlags, NodeCheckFn, NodeDef, NodeFlags, OutputType, RootData, Services, ViewData, ViewDefinition, ViewFlags, ViewHandleEventFn, ViewState, ViewUpdateFn, anchorDef, asElementData, asProviderData, directiveDef, elementDef, rootRenderNodes, textDef, viewDef} from '@angular/core/src/view/index'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; -import {createRootView, isBrowser, removeNodes} from './helper'; +import {createRootView, isBrowser, recordNodeToRemove} from './helper'; export function main() { describe(`Component Views`, () => { @@ -56,7 +56,7 @@ export function main() { beforeEach(() => { rootNode = document.createElement('root'); document.body.appendChild(rootNode); - removeNodes.push(rootNode); + recordNodeToRemove(rootNode); }); it('should select root elements based on a selector', () => { diff --git a/packages/core/test/view/element_spec.ts b/packages/core/test/view/element_spec.ts index ca3b12b65e..babde20bcf 100644 --- a/packages/core/test/view/element_spec.ts +++ b/packages/core/test/view/element_spec.ts @@ -12,7 +12,7 @@ import {ArgumentType, BindingFlags, DebugContext, NodeDef, NodeFlags, OutputType import {TestBed} from '@angular/core/testing'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; -import {ARG_TYPE_VALUES, checkNodeInlineOrDynamic, createRootView, isBrowser, removeNodes} from './helper'; +import {ARG_TYPE_VALUES, checkNodeInlineOrDynamic, createRootView, isBrowser, recordNodeToRemove} from './helper'; export function main() { describe(`View Elements`, () => { @@ -182,7 +182,7 @@ export function main() { // won't work in IE. result.rootNodes.forEach((node) => { document.body.appendChild(node); - removeNodes.push(node); + recordNodeToRemove(node); }); return result; } diff --git a/packages/core/test/view/helper.ts b/packages/core/test/view/helper.ts index cdcf61a2f1..cf6888f8bb 100644 --- a/packages/core/test/view/helper.ts +++ b/packages/core/test/view/helper.ts @@ -41,6 +41,11 @@ export function createEmbeddedView(parent: ViewData, anchorDef: NodeDef, context return Services.createEmbeddedView(parent, anchorDef, anchorDef.element !.template !, context); } -export let removeNodes: Node[]; +let removeNodes: Node[]; + beforeEach(() => { removeNodes = []; }); afterEach(() => { removeNodes.forEach((node) => getDOM().remove(node)); }); + +export function recordNodeToRemove(node: Node) { + removeNodes.push(node); +} \ No newline at end of file diff --git a/packages/http/test/backends/xhr_backend_spec.ts b/packages/http/test/backends/xhr_backend_spec.ts index 8be7db3b00..d56bdfb290 100644 --- a/packages/http/test/backends/xhr_backend_spec.ts +++ b/packages/http/test/backends/xhr_backend_spec.ts @@ -334,7 +334,7 @@ export function main() { it('should use FormData body and detect content type header to the request', () => { const body = new FormData(); body.append('test1', 'val1'); - body.append('test2', 123456); + body.append('test2', '123456'); const blob = createBlob(['body { color: red; }'], 'text/css'); body.append('userfile', blob); const base = new BaseRequestOptions(); diff --git a/packages/language-service/src/ts_plugin.ts b/packages/language-service/src/ts_plugin.ts index f590949505..e28cdab33e 100644 --- a/packages/language-service/src/ts_plugin.ts +++ b/packages/language-service/src/ts_plugin.ts @@ -110,6 +110,13 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS return (fileName, p1, p2, p3) => tryCall(fileName, () => (m.call(ls, fileName, p1, p2, p3))); } + function tryFilenameFourCall( + m: (fileName: string, p1: P1, p2: P2, p3: P3, p4: P4) => + T): (fileName: string, p1: P1, p2: P2, p3: P3, p4: P4) => T { + return (fileName, p1, p2, p3, p4) => + tryCall(fileName, () => (m.call(ls, fileName, p1, p2, p3, p4))); + } + function typescriptOnly(ls: ts.LanguageService): ts.LanguageService { return { cleanupSemanticCache: () => ls.cleanupSemanticCache(), @@ -152,7 +159,7 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS getFormattingEditsAfterKeystroke: tryFilenameThreeCall(ls.getFormattingEditsAfterKeystroke), getDocCommentTemplateAtPosition: tryFilenameOneCall(ls.getDocCommentTemplateAtPosition), isValidBraceCompletionAtPosition: tryFilenameTwoCall(ls.isValidBraceCompletionAtPosition), - getCodeFixesAtPosition: tryFilenameThreeCall(ls.getCodeFixesAtPosition), + getCodeFixesAtPosition: tryFilenameFourCall(ls.getCodeFixesAtPosition), getEmitOutput: tryFilenameCall(ls.getEmitOutput), getProgram: () => ls.getProgram(), dispose: () => ls.dispose()