From e3064d5432d5332f54592f405e7e589a3feea18d Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 25 Jun 2018 11:11:22 +0200 Subject: [PATCH] feat: typescript 2.9 support (#24652) PR Close #24652 --- WORKSPACE | 6 +- integration/typings_test_ts29/include-all.ts | 49 +++++++++ integration/typings_test_ts29/package.json | 31 ++++++ integration/typings_test_ts29/tsconfig.json | 24 +++++ modules/benchmarks/src/tree/ng2_next/tree.ts | 6 +- modules/benchmarks/src/tree/render3/tree.ts | 5 +- package.json | 4 +- packages/bazel/package.json | 2 +- packages/bazel/src/ng_package/packager.ts | 2 +- packages/common/locales/BUILD.bazel | 4 + packages/compiler-cli/package.json | 4 +- .../compiler-cli/src/transformers/program.ts | 2 +- .../test/metadata/collector_spec.ts | 33 +----- packages/core/src/core_private_export.ts | 2 +- packages/core/src/render3/definition.ts | 2 +- packages/core/src/render3/instructions.ts | 2 +- .../core/src/render3/interfaces/definition.ts | 4 +- packages/core/src/util.ts | 4 - packages/core/src/zone/ng_zone.ts | 3 - packages/language-service/src/ts_plugin.ts | 26 +++-- .../src/dom/events/dom_events.ts | 4 - .../platform-browser/src/private_export.ts | 1 + .../router/src/directives/router_outlet.ts | 3 +- scripts/ci/test-js.sh | 2 +- test.sh | 2 +- tools/cjs-jasmine/index.ts | 2 + .../animations/animations.d.ts | 10 +- tools/public_api_guard/common/common.d.ts | 26 ++--- tools/public_api_guard/common/http.d.ts | 2 +- tools/public_api_guard/core/core.d.ts | 70 ++++++------ tools/public_api_guard/core/testing.d.ts | 12 +-- tools/public_api_guard/forms/forms.d.ts | 2 +- tools/public_api_guard/http/http.d.ts | 10 +- .../platform-webworker.d.ts | 4 +- tools/public_api_guard/router/router.d.ts | 102 +++++++++--------- tools/public_api_guard/upgrade/static.d.ts | 4 +- tools/tsc-watch/index.ts | 7 +- yarn.lock | 19 ++-- 38 files changed, 293 insertions(+), 204 deletions(-) create mode 100644 integration/typings_test_ts29/include-all.ts create mode 100644 integration/typings_test_ts29/package.json create mode 100644 integration/typings_test_ts29/tsconfig.json diff --git a/WORKSPACE b/WORKSPACE index e1a2722e6a..be1785a0ea 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -20,9 +20,9 @@ http_archive( http_archive( name = "build_bazel_rules_typescript", - url = "https://github.com/bazelbuild/rules_typescript/archive/7c49a0943e7ccca73bee0b8fc5f01ca2c3dcfe8b.zip", - strip_prefix = "rules_typescript-7c49a0943e7ccca73bee0b8fc5f01ca2c3dcfe8b", - sha256 = "9707cdafc0e59f06cf5336b1c68d8f3d04fae9f3471c0eb205a669b8b5fafc81", + url = "https://github.com/rkirov/rules_typescript/archive/v0.16.0.zip", + strip_prefix = "rules_typescript-0.16.0", + sha256 = "f5aedd3a792e5af19cd0c0f0318cb692e2989e816e896e794152d07808fccacd", ) http_archive( diff --git a/integration/typings_test_ts29/include-all.ts b/integration/typings_test_ts29/include-all.ts new file mode 100644 index 0000000000..ca81c56472 --- /dev/null +++ b/integration/typings_test_ts29/include-all.ts @@ -0,0 +1,49 @@ +/** + * @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 elements from '@angular/elements'; +import * as forms from '@angular/forms'; +import * as http from '@angular/http'; +import * as httpTesting from '@angular/http/testing'; +import * as platformBrowser from '@angular/platform-browser'; +import * as platformBrowserTesting from '@angular/platform-browser/testing'; +import * as platformBrowserDynamic from '@angular/platform-browser-dynamic'; +import * as platformServer from '@angular/platform-server'; +import * as platformServerTesting from '@angular/platform-server/testing'; +import * as platformWebworker from '@angular/platform-webworker'; +import * as platformWebworkerDynamic from '@angular/platform-webworker-dynamic'; +import * as router from '@angular/router'; +import * as routerTesting from '@angular/router/testing'; +import * as serviceWorker from '@angular/service-worker'; +import * as upgrade from '@angular/upgrade'; + +export default { + compiler, + compilerTesting, + core, + coreTesting, + elements, + forms, + http, + httpTesting, + platformBrowser, + platformBrowserTesting, + platformBrowserDynamic, + platformServer, + platformServerTesting, + platformWebworker, + platformWebworkerDynamic, + router, + routerTesting, + serviceWorker, + upgrade, +}; diff --git a/integration/typings_test_ts29/package.json b/integration/typings_test_ts29/package.json new file mode 100644 index 0000000000..10a38622bd --- /dev/null +++ b/integration/typings_test_ts29/package.json @@ -0,0 +1,31 @@ +{ + "name": "angular-integration", + "description": "Assert that users with TypeScript 2.8 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/elements": "file:../../dist/packages-dist/elements", + "@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/platform-webworker": "file:../../dist/packages-dist/platform-webworker", + "@angular/platform-webworker-dynamic": "file:../../dist/packages-dist/platform-webworker-dynamic", + "@angular/router": "file:../../dist/packages-dist/router", + "@angular/service-worker": "file:../../dist/packages-dist/service-worker", + "@angular/upgrade": "file:../../dist/packages-dist/upgrade", + "@types/jasmine": "2.5.41", + "rxjs": "file:../../node_modules/rxjs", + "typescript": "2.8.x", + "zone.js": "file:../../node_modules/zone.js" + }, + "scripts": { + "test": "tsc" + } +} diff --git a/integration/typings_test_ts29/tsconfig.json b/integration/typings_test_ts29/tsconfig.json new file mode 100644 index 0000000000..165bd7a957 --- /dev/null +++ b/integration/typings_test_ts29/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "module": "commonjs", + "moduleResolution": "node", + "outDir": "../../dist/typings_test_ts28/", + "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" + ] +} diff --git a/modules/benchmarks/src/tree/ng2_next/tree.ts b/modules/benchmarks/src/tree/ng2_next/tree.ts index 3ed87ed055..ebd8c05e6a 100644 --- a/modules/benchmarks/src/tree/ng2_next/tree.ts +++ b/modules/benchmarks/src/tree/ng2_next/tree.ts @@ -7,10 +7,8 @@ */ import {NgIf} from '@angular/common'; -import {ComponentFactory, ComponentFactoryResolver, ComponentRef, ErrorHandler, Injector, NgModuleRef, RendererFactory2, RootRenderer, Sanitizer, TemplateRef, ViewContainerRef} from '@angular/core'; -import {ArgumentType, BindingFlags, NodeFlags, ViewDefinition, ViewFlags, anchorDef, createComponentFactory, directiveDef, elementDef, initServicesIfNeeded, textDef, viewDef} from '@angular/core/src/view/index'; -import {DomRendererFactory2} from '@angular/platform-browser/src/dom/dom_renderer'; -import {DomSanitizerImpl, SafeStyle} from '@angular/platform-browser/src/security/dom_sanitization_service'; +import {ComponentFactory, ComponentFactoryResolver, ComponentRef, ErrorHandler, Injector, NgModuleRef, RendererFactory2, RootRenderer, Sanitizer, TemplateRef, ViewContainerRef, ɵArgumentType as ArgumentType, ɵBindingFlags as BindingFlags, ɵNodeFlags as NodeFlags, ɵViewDefinition as ViewDefinition, ɵViewFlags as ViewFlags, ɵand as anchorDef, ɵccf as createComponentFactory, ɵdid as directiveDef, ɵeld as elementDef, ɵinitServicesIfNeeded as initServicesIfNeeded, ɵted as textDef, ɵvid as viewDef} from '@angular/core'; +import {SafeStyle, ɵDomRendererFactory2 as DomRendererFactory2, ɵDomSanitizerImpl as DomSanitizerImpl} from '@angular/platform-browser'; import {TreeNode, emptyTree} from '../util'; diff --git a/modules/benchmarks/src/tree/render3/tree.ts b/modules/benchmarks/src/tree/render3/tree.ts index 8b629df4b5..e81f401b4f 100644 --- a/modules/benchmarks/src/tree/render3/tree.ts +++ b/modules/benchmarks/src/tree/render3/tree.ts @@ -7,7 +7,6 @@ */ import {ɵC as C, ɵE as E, ɵRenderFlags as RenderFlags, ɵT as T, ɵV as V, ɵb as b, ɵcR as cR, ɵcr as cr, ɵdefineComponent as defineComponent, ɵdetectChanges as _detectChanges, ɵe as e, ɵi1 as i1, ɵp as p, ɵsn as sn, ɵt as t, ɵv as v} from '@angular/core'; -import {ComponentDefInternal} from '@angular/core/src/render3/interfaces/definition'; import {TreeNode, buildTree, emptyTree} from '../util'; @@ -35,7 +34,7 @@ export class TreeComponent { data: TreeNode = emptyTree; /** @nocollapse */ - static ngComponentDef: ComponentDefInternal = defineComponent({ + static ngComponentDef = defineComponent({ type: TreeComponent, selectors: [['tree']], template: function(rf: RenderFlags, ctx: TreeComponent) { @@ -95,7 +94,7 @@ export class TreeFunction { data: TreeNode = emptyTree; /** @nocollapse */ - static ngComponentDef: ComponentDefInternal = defineComponent({ + static ngComponentDef = defineComponent({ type: TreeFunction, selectors: [['tree']], template: function(rf: RenderFlags, ctx: TreeFunction) { diff --git a/package.json b/package.json index 819ffd023a..a40c4f1e49 100644 --- a/package.json +++ b/package.json @@ -110,11 +110,11 @@ "source-map": "0.5.7", "source-map-support": "0.4.18", "systemjs": "0.18.10", - "tsickle": "^0.29.0", + "tsickle": "0.32", "tslint": "5.7.0", "tslint-eslint-rules": "4.1.1", "tsutils": "2.20.0", - "typescript": "2.8.x", + "typescript": "2.9.x", "uglify-es": "^3.3.9", "universal-analytics": "0.4.15", "vlq": "0.2.2", diff --git a/packages/bazel/package.json b/packages/bazel/package.json index 2b6744cadf..72464fafba 100644 --- a/packages/bazel/package.json +++ b/packages/bazel/package.json @@ -13,7 +13,7 @@ }, "peerDependencies": { "@angular/compiler-cli": "0.0.0-PLACEHOLDER", - "typescript": ">=2.7.2 <2.9" + "typescript": ">=2.7.2 <2.10" }, "repository": { "type": "git", diff --git a/packages/bazel/src/ng_package/packager.ts b/packages/bazel/src/ng_package/packager.ts index 65733c52fe..59358020e0 100644 --- a/packages/bazel/src/ng_package/packager.ts +++ b/packages/bazel/src/ng_package/packager.ts @@ -152,7 +152,7 @@ function main(args: string[]): number { allsrcs.filter(hasFileExtension('.d.ts')).forEach((f: string) => { const content = fs.readFileSync(f, 'utf-8') // Strip the named AMD module for compatibility with non-bazel users - .replace(/^\/\/\/ \n/, ''); + .replace(/^\/\/\/ \n/gm, ''); writeFileFromInputPath(f, content); }); diff --git a/packages/common/locales/BUILD.bazel b/packages/common/locales/BUILD.bazel index 2ee8afc3a1..07be1c9fc1 100644 --- a/packages/common/locales/BUILD.bazel +++ b/packages/common/locales/BUILD.bazel @@ -22,6 +22,10 @@ npm_package( # We don't actually import anything in the locale code so we can # null out the require reference passed into the module. "factory\(require, exports\)": "factory(null, exports)", + + # Workaround for `.d.ts`` containing `/// ` + # which are generated in TypeScript v2.9, but not before. + "/// ": "", }, deps = [":locales"], ) diff --git a/packages/compiler-cli/package.json b/packages/compiler-cli/package.json index 07fcee7d02..ac7f6bdc07 100644 --- a/packages/compiler-cli/package.json +++ b/packages/compiler-cli/package.json @@ -11,11 +11,11 @@ "dependencies": { "reflect-metadata": "^0.1.2", "minimist": "^1.2.0", - "tsickle": "^0.29.0", + "tsickle": "^0.30.0", "chokidar": "^1.4.2" }, "peerDependencies": { - "typescript": ">=2.7.2 <2.9", + "typescript": ">=2.7.2 <2.10", "@angular/compiler": "0.0.0-PLACEHOLDER" }, "engines" : { diff --git a/packages/compiler-cli/src/transformers/program.ts b/packages/compiler-cli/src/transformers/program.ts index a21fb7bf3d..d5de233924 100644 --- a/packages/compiler-cli/src/transformers/program.ts +++ b/packages/compiler-cli/src/transformers/program.ts @@ -109,7 +109,7 @@ const MIN_TS_VERSION = '2.7.2'; * ∀ supported typescript version v, v < MAX_TS_VERSION * MAX_TS_VERSION is not considered as a supported TypeScript version */ -const MAX_TS_VERSION = '2.9.0'; +const MAX_TS_VERSION = '2.10.0'; class AngularCompilerProgram implements Program { private rootNames: string[]; diff --git a/packages/compiler-cli/test/metadata/collector_spec.ts b/packages/compiler-cli/test/metadata/collector_spec.ts index 8be8f40b12..e49149569d 100644 --- a/packages/compiler-cli/test/metadata/collector_spec.ts +++ b/packages/compiler-cli/test/metadata/collector_spec.ts @@ -974,7 +974,7 @@ describe('Collector', () => { }); }); - describe('regerssion', () => { + describe('regression', () => { it('should be able to collect a short-hand property value', () => { const metadata = collectSource(` const children = { f1: 1 }; @@ -1040,37 +1040,6 @@ describe('Collector', () => { .not.toBeUndefined('typeGuard was not collected'); }); - it('should be able to collect an invalid access expression', () => { - const source = createSource(` - import {Component} from '@angular/core'; - - const value = []; - @Component({ - provider: [{provide: 'some token', useValue: value[]}] - }) - export class MyComponent {} - `); - const metadata = collector.getMetadata(source) !; - expect(metadata.metadata.MyComponent).toEqual({ - __symbolic: 'class', - decorators: [{ - __symbolic: 'call', - expression: { - __symbolic: 'reference', - module: '@angular/core', - name: 'Component', - line: 4, - character: 9 - }, - arguments: [{ - __symbolic: 'error', - message: 'Expression form not supported', - line: 5, - character: 55 - }] - }] - }); - }); }); describe('references', () => { diff --git a/packages/core/src/core_private_export.ts b/packages/core/src/core_private_export.ts index 24cddeb5e6..f5e015b94e 100644 --- a/packages/core/src/core_private_export.ts +++ b/packages/core/src/core_private_export.ts @@ -28,5 +28,5 @@ export {_sanitizeUrl as ɵ_sanitizeUrl} from './sanitization/url_sanitizer'; export {global as ɵglobal, looseIdentical as ɵlooseIdentical, stringify as ɵstringify} from './util'; export {makeDecorator as ɵmakeDecorator} from './util/decorators'; export {isObservable as ɵisObservable, isPromise as ɵisPromise} from './util/lang'; -export {clearOverrides as ɵclearOverrides, overrideComponentView as ɵoverrideComponentView, overrideProvider as ɵoverrideProvider} from './view/index'; +export {clearOverrides as ɵclearOverrides, initServicesIfNeeded as ɵinitServicesIfNeeded, overrideComponentView as ɵoverrideComponentView, overrideProvider as ɵoverrideProvider} from './view/index'; export {NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR} from './view/provider'; diff --git a/packages/core/src/render3/definition.ts b/packages/core/src/render3/definition.ts index e671928716..2cda88b570 100644 --- a/packages/core/src/render3/definition.ts +++ b/packages/core/src/render3/definition.ts @@ -209,7 +209,7 @@ export function defineComponent(componentDefinition: { const type = componentDefinition.type; const pipeTypes = componentDefinition.pipes !; const directiveTypes = componentDefinition.directives !; - const declaredInputs: {[P in keyof T]: P} = {} as any; + const declaredInputs: {[key: string]: string} = {} as any; const def: ComponentDefInternal = { type: type, diPublic: null, diff --git a/packages/core/src/render3/instructions.ts b/packages/core/src/render3/instructions.ts index 39777958b4..938d97516f 100644 --- a/packages/core/src/render3/instructions.ts +++ b/packages/core/src/render3/instructions.ts @@ -1525,7 +1525,7 @@ export function baseDirectiveCreate( * @param tNode The static data for this node */ function setInputsFromAttrs( - directiveIndex: number, instance: T, inputs: {[key: string]: string}, tNode: TNode): void { + directiveIndex: number, instance: T, inputs: {[P in keyof T]: string;}, tNode: TNode): void { let initialInputData = tNode.initialInputs as InitialInputData | undefined; if (initialInputData === undefined || directiveIndex >= initialInputData.length) { initialInputData = generateInitialInputs(directiveIndex, inputs, tNode); diff --git a/packages/core/src/render3/interfaces/definition.ts b/packages/core/src/render3/interfaces/definition.ts index cfcb79e308..8df6820645 100644 --- a/packages/core/src/render3/interfaces/definition.ts +++ b/packages/core/src/render3/interfaces/definition.ts @@ -84,7 +84,7 @@ export interface DirectiveDef { type: Type; /** Function that makes a directive public to the DI system. */ - diPublic: ((def: DirectiveDef) => void)|null; + diPublic: ((def: DirectiveDef) => void)|null; /** The selectors that will be used to match nodes to this directive. */ selectors: CssSelectorList; @@ -94,7 +94,7 @@ export interface DirectiveDef { * are their aliases if any, or their original unminified property names * (as in `@Input('alias') propertyName: any;`). */ - readonly inputs: {[P in keyof T]: P}; + readonly inputs: {[P in keyof T]: string}; /** * @deprecated This is only here because `NgOnChanges` incorrectly uses declared name instead of diff --git a/packages/core/src/util.ts b/packages/core/src/util.ts index df27d9a748..4c0011dbb4 100644 --- a/packages/core/src/util.ts +++ b/packages/core/src/util.ts @@ -6,10 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ -// Import zero symbols from zone.js. This causes the zone ambient type to be -// added to the type-checker, without emitting any runtime module load statement -import {} from 'zone.js'; - // TODO(jteplitz602): Load WorkerGlobalScope from lib.webworker.d.ts file #3492 declare var WorkerGlobalScope: any /** TODO #9100 */; // CommonJS / Node have global context exposed as "global" variable. diff --git a/packages/core/src/zone/ng_zone.ts b/packages/core/src/zone/ng_zone.ts index 17b68225d8..222254d2c8 100644 --- a/packages/core/src/zone/ng_zone.ts +++ b/packages/core/src/zone/ng_zone.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ -// Import zero symbols from zone.js. This causes the zone ambient type to be -// added to the type-checker, without emitting any runtime module load statement -import {} from 'zone.js'; import {EventEmitter} from '../event_emitter'; /** diff --git a/packages/language-service/src/ts_plugin.ts b/packages/language-service/src/ts_plugin.ts index 6457c4ef52..00853dc8ad 100644 --- a/packages/language-service/src/ts_plugin.ts +++ b/packages/language-service/src/ts_plugin.ts @@ -63,6 +63,14 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS tryCall(fileName, () => (m.call(ls, fileName, p1, p2, p3, p4))); } + function tryFilenameFiveCall( + m: (fileName: string, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5) => + T): (fileName: string, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5) => T { + return (fileName, p1, p2, p3, p4, p5) => + tryCall(fileName, () => (m.call(ls, fileName, p1, p2, p3, p4, p5))); + } + + function typescriptOnly(ls: ts.LanguageService): ts.LanguageService { const languageService: ts.LanguageService = { cleanupSemanticCache: () => ls.cleanupSemanticCache(), @@ -74,7 +82,7 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS getEncodedSyntacticClassifications: tryFilenameOneCall(ls.getEncodedSyntacticClassifications), getEncodedSemanticClassifications: tryFilenameOneCall(ls.getEncodedSemanticClassifications), getCompletionsAtPosition: tryFilenameTwoCall(ls.getCompletionsAtPosition), - getCompletionEntryDetails: tryFilenameFourCall(ls.getCompletionEntryDetails), + getCompletionEntryDetails: tryFilenameFiveCall(ls.getCompletionEntryDetails), getCompletionEntrySymbol: tryFilenameThreeCall(ls.getCompletionEntrySymbol), getQuickInfoAtPosition: tryFilenameOneCall(ls.getQuickInfoAtPosition), getNameOrDottedNameSpan: tryFilenameTwoCall(ls.getNameOrDottedNameSpan), @@ -106,22 +114,28 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS getDocCommentTemplateAtPosition: tryFilenameOneCall(ls.getDocCommentTemplateAtPosition), isValidBraceCompletionAtPosition: tryFilenameTwoCall(ls.isValidBraceCompletionAtPosition), getSpanOfEnclosingComment: tryFilenameTwoCall(ls.getSpanOfEnclosingComment), - getCodeFixesAtPosition: tryFilenameFourCall(ls.getCodeFixesAtPosition), + getCodeFixesAtPosition: tryFilenameFiveCall(ls.getCodeFixesAtPosition), applyCodeActionCommand: ((action: any) => tryCall(undefined, () => ls.applyCodeActionCommand(action))), getEmitOutput: tryFilenameCall(ls.getEmitOutput), getProgram: () => ls.getProgram(), dispose: () => ls.dispose(), - getApplicableRefactors: tryFilenameOneCall(ls.getApplicableRefactors), - getEditsForRefactor: tryFilenameFourCall(ls.getEditsForRefactor), + getApplicableRefactors: tryFilenameTwoCall(ls.getApplicableRefactors), + getEditsForRefactor: tryFilenameFiveCall(ls.getEditsForRefactor), getDefinitionAndBoundSpan: tryFilenameOneCall(ls.getDefinitionAndBoundSpan), getCombinedCodeFix: - (scope: ts.CombinedCodeFixScope, fixId: {}, formatOptions: ts.FormatCodeSettings) => - tryCall(undefined, () => ls.getCombinedCodeFix(scope, fixId, formatOptions)), + (scope: ts.CombinedCodeFixScope, fixId: {}, formatOptions: ts.FormatCodeSettings, + preferences: ts.UserPreferences) => + tryCall( + undefined, () => ls.getCombinedCodeFix(scope, fixId, formatOptions, preferences)), // TODO(kyliau): dummy implementation to compile with ts 2.8, create real one getSuggestionDiagnostics: (fileName: string) => [], // TODO(kyliau): dummy implementation to compile with ts 2.8, create real one organizeImports: (scope: ts.CombinedCodeFixScope, formatOptions: ts.FormatCodeSettings) => [], + // TODO: dummy implementation to compile with ts 2.9, create a real one + getEditsForFileRename: + (oldFilePath: string, newFilePath: string, formatOptions: ts.FormatCodeSettings, + preferences: ts.UserPreferences | undefined) => [] } as ts.LanguageService; return languageService; } diff --git a/packages/platform-browser/src/dom/events/dom_events.ts b/packages/platform-browser/src/dom/events/dom_events.ts index 5b4c6acaac..4e1895adba 100644 --- a/packages/platform-browser/src/dom/events/dom_events.ts +++ b/packages/platform-browser/src/dom/events/dom_events.ts @@ -10,10 +10,6 @@ import {isPlatformServer} from '@angular/common'; import {Inject, Injectable, NgZone, Optional, PLATFORM_ID} from '@angular/core'; -// Import zero symbols from zone.js. This causes the zone ambient type to be -// added to the type-checker, without emitting any runtime module load statement -import {} from 'zone.js'; - import {DOCUMENT} from '../dom_tokens'; import {EventManagerPlugin} from './event_manager'; diff --git a/packages/platform-browser/src/private_export.ts b/packages/platform-browser/src/private_export.ts index 0355d5e248..0deb396d77 100644 --- a/packages/platform-browser/src/private_export.ts +++ b/packages/platform-browser/src/private_export.ts @@ -19,3 +19,4 @@ export {DomEventsPlugin as ɵDomEventsPlugin} from './dom/events/dom_events'; export {HammerGesturesPlugin as ɵHammerGesturesPlugin} from './dom/events/hammer_gestures'; export {KeyEventsPlugin as ɵKeyEventsPlugin} from './dom/events/key_events'; export {DomSharedStylesHost as ɵDomSharedStylesHost, SharedStylesHost as ɵSharedStylesHost} from './dom/shared_styles_host'; +export {DomSanitizerImpl as ɵDomSanitizerImpl} from './security/dom_sanitization_service'; diff --git a/packages/router/src/directives/router_outlet.ts b/packages/router/src/directives/router_outlet.ts index 92ea3cd362..77d6283fc8 100644 --- a/packages/router/src/directives/router_outlet.ts +++ b/packages/router/src/directives/router_outlet.ts @@ -8,6 +8,7 @@ import {Attribute, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, Injector, OnDestroy, OnInit, Output, ViewContainerRef} from '@angular/core'; +import {Data} from '../config'; import {ChildrenOutletContexts} from '../router_outlet_context'; import {ActivatedRoute} from '../router_state'; import {PRIMARY_OUTLET} from '../shared'; @@ -83,7 +84,7 @@ export class RouterOutlet implements OnDestroy, OnInit { return this._activatedRoute as ActivatedRoute; } - get activatedRouteData() { + get activatedRouteData(): Data { if (this._activatedRoute) { return this._activatedRoute.snapshot.data; } diff --git a/scripts/ci/test-js.sh b/scripts/ci/test-js.sh index 67db3eafcf..ba83077c92 100755 --- a/scripts/ci/test-js.sh +++ b/scripts/ci/test-js.sh @@ -21,7 +21,7 @@ travisFoldEnd "test.unit.tools" # Run unit tests in node travisFoldStart "test.unit.node" - node ./dist/tools/tsc-watch/ node runCmdsOnly + node --harmony ./dist/tools/tsc-watch/ node runCmdsOnly travisFoldEnd "test.unit.node" diff --git a/test.sh b/test.sh index 5eb7fa9964..812448f086 100755 --- a/test.sh +++ b/test.sh @@ -27,5 +27,5 @@ else echo "Creating packages .metadata.json files..." node --max-old-space-size=3000 dist/tools/@angular/compiler-cli/src/main -p packages/tsconfig-metadata.json fi - node dist/tools/tsc-watch/ $1 watch $2 + node --harmony dist/tools/tsc-watch/ $1 watch $2 fi diff --git a/tools/cjs-jasmine/index.ts b/tools/cjs-jasmine/index.ts index 9c61e12cbd..4508806380 100644 --- a/tools/cjs-jasmine/index.ts +++ b/tools/cjs-jasmine/index.ts @@ -60,6 +60,8 @@ var specFiles: any = '@angular/examples/**', '@angular/platform-browser/**', '@angular/platform-browser-dynamic/**', + '@angular/compiler/test/aot/**', + '@angular/compiler/test/render3/**', '@angular/core/test/bundling/**', '@angular/core/test/zone/**', '@angular/core/test/render3/**', diff --git a/tools/public_api_guard/animations/animations.d.ts b/tools/public_api_guard/animations/animations.d.ts index 2f85467bdc..8835462f46 100644 --- a/tools/public_api_guard/animations/animations.d.ts +++ b/tools/public_api_guard/animations/animations.d.ts @@ -2,7 +2,7 @@ export declare function animate(timings: string | number, styles?: AnimationStyl export declare function animateChild(options?: AnimateChildOptions | null): AnimationAnimateChildMetadata; -export interface AnimateChildOptions extends AnimationOptions { +export declare interface AnimateChildOptions extends AnimationOptions { duration?: number | string; } @@ -75,10 +75,10 @@ export declare const enum AnimationMetadataType { AnimateChild = 9, AnimateRef = 10, Query = 11, - Stagger = 12, + Stagger = 12 } -export interface AnimationOptions { +export declare interface AnimationOptions { delay?: number | string; params?: { [name: string]: any; @@ -102,7 +102,7 @@ export interface AnimationPlayer { play(): void; reset(): void; restart(): void; - setPosition(p: any): void; + setPosition(p: any /** TODO #9100 */): void; } export interface AnimationQueryMetadata extends AnimationMetadata { @@ -111,7 +111,7 @@ export interface AnimationQueryMetadata extends AnimationMetadata { selector: string; } -export interface AnimationQueryOptions extends AnimationOptions { +export declare interface AnimationQueryOptions extends AnimationOptions { limit?: number; optional?: boolean; } diff --git a/tools/public_api_guard/common/common.d.ts b/tools/public_api_guard/common/common.d.ts index 9c77a29a94..7d2c87b652 100644 --- a/tools/public_api_guard/common/common.d.ts +++ b/tools/public_api_guard/common/common.d.ts @@ -3,8 +3,8 @@ export declare const APP_BASE_HREF: InjectionToken; export declare class AsyncPipe implements OnDestroy, PipeTransform { constructor(_ref: ChangeDetectorRef); ngOnDestroy(): void; - transform(obj: Promise | null | undefined): T | null; transform(obj: Observable | null | undefined): T | null; + transform(obj: Promise | null | undefined): T | null; transform(obj: undefined): undefined; transform(obj: null): null; } @@ -66,13 +66,13 @@ export declare enum FormatWidth { Short = 0, Medium = 1, Long = 2, - Full = 3, + Full = 3 } /** @experimental */ export declare enum FormStyle { Format = 0, - Standalone = 1, + Standalone = 1 } /** @experimental */ @@ -291,10 +291,10 @@ export declare class NgIfContext { /** @experimental */ export declare class NgLocaleLocalization extends NgLocalization { - /** @deprecated */ protected deprecatedPluralFn: ((locale: string, value: string | number) => Plural) | null | undefined; + /** @deprecated */ protected deprecatedPluralFn?: ((locale: string, value: string | number) => Plural) | null | undefined; protected locale: string; constructor(locale: string, - /** @deprecated */ deprecatedPluralFn?: ((locale: string, value: string | number) => Plural) | null | undefined); + /** @deprecated */ deprecatedPluralFn?: ((locale: string, value: string | number) => Plural) | null | undefined); getPluralCategory(value: any, locale?: string): string; } @@ -350,7 +350,7 @@ export declare enum NumberFormatStyle { Decimal = 0, Percent = 1, Currency = 2, - Scientific = 3, + Scientific = 3 } /** @experimental */ @@ -368,7 +368,7 @@ export declare enum NumberSymbol { NaN = 10, TimeSeparator = 11, CurrencyDecimal = 12, - CurrencyGroup = 13, + CurrencyGroup = 13 } export declare class PathLocationStrategy extends LocationStrategy { @@ -389,9 +389,9 @@ export declare class PercentPipe implements PipeTransform { } export declare abstract class PlatformLocation { - readonly abstract hash: string; - readonly abstract pathname: string; - readonly abstract search: string; + abstract readonly hash: string; + abstract readonly pathname: string; + abstract readonly search: string; abstract back(): void; abstract forward(): void; abstract getBaseHrefFromDOM(): string; @@ -408,7 +408,7 @@ export declare enum Plural { Two = 2, Few = 3, Many = 4, - Other = 5, + Other = 5 } /** @experimental */ @@ -441,7 +441,7 @@ export declare enum TranslationWidth { Narrow = 0, Abbreviated = 1, Wide = 2, - Short = 3, + Short = 3 } export declare class UpperCasePipe implements PipeTransform { @@ -467,5 +467,5 @@ export declare enum WeekDay { Wednesday = 3, Thursday = 4, Friday = 5, - Saturday = 6, + Saturday = 6 } diff --git a/tools/public_api_guard/common/http.d.ts b/tools/public_api_guard/common/http.d.ts index 3c3aad3ad8..fc444dfab6 100644 --- a/tools/public_api_guard/common/http.d.ts +++ b/tools/public_api_guard/common/http.d.ts @@ -1516,7 +1516,7 @@ export declare enum HttpEventType { ResponseHeader = 2, DownloadProgress = 3, Response = 4, - User = 5, + User = 5 } export declare abstract class HttpHandler { diff --git a/tools/public_api_guard/core/core.d.ts b/tools/public_api_guard/core/core.d.ts index a24304599d..04893d869f 100644 --- a/tools/public_api_guard/core/core.d.ts +++ b/tools/public_api_guard/core/core.d.ts @@ -59,7 +59,7 @@ export declare const Attribute: AttributeDecorator; export declare enum ChangeDetectionStrategy { OnPush = 0, - Default = 1, + Default = 1 } export declare abstract class ChangeDetectorRef { @@ -114,17 +114,17 @@ export interface ComponentDecorator { } export declare abstract class ComponentFactory { - readonly abstract componentType: Type; - readonly abstract inputs: { + abstract readonly componentType: Type; + abstract readonly inputs: { propName: string; templateName: string; }[]; - readonly abstract ngContentSelectors: string[]; - readonly abstract outputs: { + abstract readonly ngContentSelectors: string[]; + abstract readonly outputs: { propName: string; templateName: string; }[]; - readonly abstract selector: string; + abstract readonly selector: string; abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, ngModule?: NgModuleRef): ComponentRef; } @@ -134,12 +134,12 @@ export declare abstract class ComponentFactoryResolver { } export declare abstract class ComponentRef { - readonly abstract changeDetectorRef: ChangeDetectorRef; - readonly abstract componentType: Type; - readonly abstract hostView: ViewRef; - readonly abstract injector: Injector; - readonly abstract instance: C; - readonly abstract location: ElementRef; + abstract readonly changeDetectorRef: ChangeDetectorRef; + abstract readonly componentType: Type; + abstract readonly hostView: ViewRef; + abstract readonly injector: Injector; + abstract readonly instance: C; + abstract readonly location: ElementRef; abstract destroy(): void; abstract onDestroy(callback: Function): void; } @@ -280,8 +280,8 @@ export declare class ElementRef { /** @experimental */ export declare abstract class EmbeddedViewRef extends ViewRef { - readonly abstract context: C; - readonly abstract rootNodes: any[]; + abstract readonly context: C; + abstract readonly rootNodes: any[]; } export declare function enableProdMode(): void; @@ -378,7 +378,7 @@ export declare const enum InjectFlags { Host = 1, Self = 2, SkipSelf = 4, - Optional = 8, + Optional = 8 } export declare class InjectionToken { @@ -494,7 +494,7 @@ export declare const LOCALE_ID: InjectionToken; export declare enum MissingTranslationStrategy { Error = 0, Warning = 1, - Ignore = 2, + Ignore = 2 } /** @experimental */ @@ -515,7 +515,7 @@ export declare const NgModule: NgModuleDecorator; /** @experimental */ export declare abstract class NgModuleFactory { - readonly abstract moduleType: Type; + abstract readonly moduleType: Type; abstract create(parentInjector: Injector | null): NgModuleRef; } @@ -524,9 +524,9 @@ export declare abstract class NgModuleFactoryLoader { } export declare abstract class NgModuleRef { - readonly abstract componentFactoryResolver: ComponentFactoryResolver; - readonly abstract injector: Injector; - readonly abstract instance: T; + abstract readonly componentFactoryResolver: ComponentFactoryResolver; + abstract readonly injector: Injector; + abstract readonly instance: T; abstract destroy(): void; abstract onDestroy(callback: () => void): void; } @@ -547,7 +547,7 @@ export declare class NgZone { readonly onMicrotaskEmpty: EventEmitter; readonly onStable: EventEmitter; readonly onUnstable: EventEmitter; - constructor({enableLongStackTrace}: { + constructor({ enableLongStackTrace }: { enableLongStackTrace?: boolean; }); run(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T; @@ -642,7 +642,7 @@ export declare class QueryList { /** @deprecated */ export declare abstract class ReflectiveInjector implements Injector { - readonly abstract parent: Injector | null; + abstract readonly parent: Injector | null; abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector; abstract get(token: any, notFoundValue?: any): any; abstract instantiateResolved(provider: ResolvedReflectiveProvider): any; @@ -699,7 +699,7 @@ export declare abstract class Renderer { /** @experimental */ export declare abstract class Renderer2 { - readonly abstract data: { + abstract readonly data: { [key: string]: any; }; destroyNode: ((node: any) => void) | null; @@ -735,7 +735,7 @@ export declare abstract class RendererFactory2 { /** @experimental */ export declare enum RendererStyleFlags2 { Important = 1, - DashCase = 2, + DashCase = 2 } /** @experimental */ @@ -753,8 +753,8 @@ export declare class ResolvedReflectiveFactory { dependencies: ReflectiveDependency[]; factory: Function; constructor( - factory: Function, - dependencies: ReflectiveDependency[]); + factory: Function, + dependencies: ReflectiveDependency[]); } /** @experimental */ @@ -787,7 +787,7 @@ export declare enum SecurityContext { STYLE = 2, SCRIPT = 3, URL = 4, - RESOURCE_URL = 5, + RESOURCE_URL = 5 } export declare const Self: SelfDecorator; @@ -834,7 +834,7 @@ export declare abstract class SystemJsNgModuleLoaderConfig { } export declare abstract class TemplateRef { - readonly abstract elementRef: ElementRef; + abstract readonly elementRef: ElementRef; abstract createEmbeddedView(context: C): EmbeddedViewRef; } @@ -919,10 +919,10 @@ export interface ViewChildrenDecorator { } export declare abstract class ViewContainerRef { - readonly abstract element: ElementRef; - readonly abstract injector: Injector; - readonly abstract length: number; - readonly abstract parentInjector: Injector; + abstract readonly element: ElementRef; + abstract readonly injector: Injector; + abstract readonly length: number; + abstract readonly parentInjector: Injector; abstract clear(): void; abstract createComponent(componentFactory: ComponentFactory, index?: number, injector?: Injector, projectableNodes?: any[][], ngModule?: NgModuleRef): ComponentRef; abstract createEmbeddedView(templateRef: TemplateRef, context?: C, index?: number): EmbeddedViewRef; @@ -938,13 +938,13 @@ export declare enum ViewEncapsulation { Emulated = 0, Native = 1, None = 2, - ShadowDom = 3, + ShadowDom = 3 } export declare abstract class ViewRef extends ChangeDetectorRef { - readonly abstract destroyed: boolean; + abstract readonly destroyed: boolean; abstract destroy(): void; - abstract onDestroy(callback: Function): any; + abstract onDestroy(callback: Function): any /** TODO #9100 */; } export declare class WrappedValue { diff --git a/tools/public_api_guard/core/testing.d.ts b/tools/public_api_guard/core/testing.d.ts index 5759b364f6..ce962ef4bb 100644 --- a/tools/public_api_guard/core/testing.d.ts +++ b/tools/public_api_guard/core/testing.d.ts @@ -78,13 +78,13 @@ export declare class TestBed implements Injector { }): void; configureTestingModule(moduleDef: TestModuleMetadata): void; createComponent(component: Type): ComponentFixture; - deprecatedOverrideProvider(token: any, provider: { - useValue: any; - }): void; /** @deprecated */ deprecatedOverrideProvider(token: any, provider: { useFactory: Function; deps: any[]; }): void; + deprecatedOverrideProvider(token: any, provider: { + useValue: any; + }): void; execute(tokens: any[], fn: Function, context?: any): any; get(token: any, notFoundValue?: any): any; /** @experimental */ initTestEnvironment(ngModule: Type | Type[], platform: PlatformRef, aotSummaries?: () => any[]): void; @@ -123,11 +123,11 @@ export declare class TestBed implements Injector { static overrideModule(ngModule: Type, override: MetadataOverride): typeof TestBed; static overridePipe(pipe: Type, override: MetadataOverride): typeof TestBed; static overrideProvider(token: any, provider: { - useFactory: Function; - deps: any[]; + useValue: any; }): typeof TestBed; static overrideProvider(token: any, provider: { - useValue: any; + useFactory: Function; + deps: any[]; }): typeof TestBed; static overrideTemplate(component: Type, template: string): typeof TestBed; static overrideTemplateUsingTestingModule(component: Type, template: string): typeof TestBed; diff --git a/tools/public_api_guard/forms/forms.d.ts b/tools/public_api_guard/forms/forms.d.ts index dcb2921f8e..4af0d6af73 100644 --- a/tools/public_api_guard/forms/forms.d.ts +++ b/tools/public_api_guard/forms/forms.d.ts @@ -64,7 +64,7 @@ export declare abstract class AbstractControl { } export declare abstract class AbstractControlDirective { - readonly abstract control: AbstractControl | null; + abstract readonly control: AbstractControl | null; readonly dirty: boolean | null; readonly disabled: boolean | null; readonly enabled: boolean | null; diff --git a/tools/public_api_guard/http/http.d.ts b/tools/public_api_guard/http/http.d.ts index 8c87d94618..dc419ff40a 100644 --- a/tools/public_api_guard/http/http.d.ts +++ b/tools/public_api_guard/http/http.d.ts @@ -108,7 +108,7 @@ export declare enum ReadyState { HeadersReceived = 2, Loading = 3, Done = 4, - Cancelled = 5, + Cancelled = 5 } /** @deprecated */ @@ -132,7 +132,7 @@ export declare enum RequestMethod { Delete = 3, Options = 4, Head = 5, - Patch = 6, + Patch = 6 } /** @deprecated */ @@ -184,7 +184,7 @@ export declare enum ResponseContentType { Text = 0, Json = 1, ArrayBuffer = 2, - Blob = 3, + Blob = 3 } /** @deprecated */ @@ -213,7 +213,7 @@ export declare enum ResponseType { Cors = 1, Default = 2, Error = 3, - Opaque = 4, + Opaque = 4 } /** @deprecated */ @@ -249,7 +249,7 @@ export declare class XHRConnection implements Connection { request: Request; response: Observable; constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions); - setDetectedContentType(req: any, _xhr: any): void; + setDetectedContentType(req: any /** TODO Request */, _xhr: any /** XMLHttpRequest */): void; } /** @deprecated */ diff --git a/tools/public_api_guard/platform-webworker/platform-webworker.d.ts b/tools/public_api_guard/platform-webworker/platform-webworker.d.ts index c239f471cf..78f321e3f4 100644 --- a/tools/public_api_guard/platform-webworker/platform-webworker.d.ts +++ b/tools/public_api_guard/platform-webworker/platform-webworker.d.ts @@ -58,7 +58,7 @@ export interface ReceivedMessage { export declare const enum SerializerTypes { RENDERER_TYPE_2 = 0, PRIMITIVE = 1, - RENDER_STORE_OBJECT = 2, + RENDER_STORE_OBJECT = 2 } /** @experimental */ @@ -73,7 +73,7 @@ export declare class ServiceMessageBrokerFactory { /** @experimental */ export declare class UiArguments { - args: FnArg[] | undefined; + args?: FnArg[] | undefined; method: string; constructor(method: string, args?: FnArg[] | undefined); } diff --git a/tools/public_api_guard/router/router.d.ts b/tools/public_api_guard/router/router.d.ts index 3c635c50a5..91b0190edd 100644 --- a/tools/public_api_guard/router/router.d.ts +++ b/tools/public_api_guard/router/router.d.ts @@ -41,7 +41,7 @@ export declare class ActivatedRouteSnapshot { export declare class ActivationEnd { snapshot: ActivatedRouteSnapshot; constructor( - snapshot: ActivatedRouteSnapshot); + snapshot: ActivatedRouteSnapshot); toString(): string; } @@ -49,7 +49,7 @@ export declare class ActivationEnd { export declare class ActivationStart { snapshot: ActivatedRouteSnapshot; constructor( - snapshot: ActivatedRouteSnapshot); + snapshot: ActivatedRouteSnapshot); toString(): string; } @@ -73,7 +73,7 @@ export interface CanLoad { export declare class ChildActivationEnd { snapshot: ActivatedRouteSnapshot; constructor( - snapshot: ActivatedRouteSnapshot); + snapshot: ActivatedRouteSnapshot); toString(): string; } @@ -81,7 +81,7 @@ export declare class ChildActivationEnd { export declare class ChildActivationStart { snapshot: ActivatedRouteSnapshot; constructor( - snapshot: ActivatedRouteSnapshot); + snapshot: ActivatedRouteSnapshot); toString(): string; } @@ -129,11 +129,11 @@ export declare class GuardsCheckEnd extends RouterEvent { state: RouterStateSnapshot; urlAfterRedirects: string; constructor( - id: number, - url: string, - urlAfterRedirects: string, - state: RouterStateSnapshot, - shouldActivate: boolean); + id: number, + url: string, + urlAfterRedirects: string, + state: RouterStateSnapshot, + shouldActivate: boolean); toString(): string; } @@ -142,10 +142,10 @@ export declare class GuardsCheckStart extends RouterEvent { state: RouterStateSnapshot; urlAfterRedirects: string; constructor( - id: number, - url: string, - urlAfterRedirects: string, - state: RouterStateSnapshot); + id: number, + url: string, + urlAfterRedirects: string, + state: RouterStateSnapshot); toString(): string; } @@ -156,27 +156,27 @@ export declare type LoadChildrenCallback = () => Type | NgModuleFactory; readonly activatedRoute: ActivatedRoute; - readonly activatedRouteData: { - [name: string]: any; - }; + readonly activatedRouteData: Data; readonly component: Object; deactivateEvents: EventEmitter; readonly isActivated: boolean; @@ -458,10 +456,10 @@ export declare class RoutesRecognized extends RouterEvent { state: RouterStateSnapshot; urlAfterRedirects: string; constructor( - id: number, - url: string, - urlAfterRedirects: string, - state: RouterStateSnapshot); + id: number, + url: string, + urlAfterRedirects: string, + state: RouterStateSnapshot); toString(): string; } @@ -473,9 +471,9 @@ export declare class Scroll { readonly position: [number, number] | null; readonly routerEvent: NavigationEnd; constructor( - routerEvent: NavigationEnd, - position: [number, number] | null, - anchor: string | null); + routerEvent: NavigationEnd, + position: [number, number] | null, + anchor: string | null); toString(): string; } @@ -504,8 +502,8 @@ export declare class UrlSegment { }; path: string; constructor( - path: string, - parameters: { + path: string, + parameters: { [name: string]: string; }); toString(): string; @@ -519,8 +517,8 @@ export declare class UrlSegmentGroup { parent: UrlSegmentGroup | null; segments: UrlSegment[]; constructor( - segments: UrlSegment[], - children: { + segments: UrlSegment[], + children: { [key: string]: UrlSegmentGroup; }); hasChildren(): boolean; diff --git a/tools/public_api_guard/upgrade/static.d.ts b/tools/public_api_guard/upgrade/static.d.ts index 435cfbd851..3cfdbc7d07 100644 --- a/tools/public_api_guard/upgrade/static.d.ts +++ b/tools/public_api_guard/upgrade/static.d.ts @@ -38,8 +38,8 @@ export declare class UpgradeModule { injector: Injector; ngZone: NgZone; constructor( - injector: Injector, - ngZone: NgZone); + injector: Injector, + ngZone: NgZone); bootstrap(element: Element, modules?: string[], config?: any): void; } diff --git a/tools/tsc-watch/index.ts b/tools/tsc-watch/index.ts index a9d2befd1e..26080d13ab 100644 --- a/tools/tsc-watch/index.ts +++ b/tools/tsc-watch/index.ts @@ -32,8 +32,11 @@ const runMode: string = process.argv.length >= 4 ? process.argv[3] : null; const debugMode = process.argv.some(arg => arg === '--debug'); const BaseConfig = { start: 'File change detected. Starting incremental compilation...', - error: 'error', - complete: 'Compilation complete. Watching for file changes.' + // This regex uses a negative lookbehind group (?