Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,6 @@ do
${TSC} -p ${SRCDIR}/tsconfig-2015.json
fi

echo "====== TSC 1.8 d.ts compat for ${DESTDIR} ====="
# safely strips 'readonly' specifier from d.ts files to make them compatible with tsc 1.8
if [ "$(uname)" == "Darwin" ]; then
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\(^ *(static |private )*\)*readonly */\1/g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\/\/\/ <reference types="node" \/>//g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
else
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\(^ *(static |private )*\)*readonly */\1/g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\/\/\/ <reference types="node" \/>//g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
fi

if [[ ${PACKAGE} == benchpress ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this is a breaking change. can you please update the commit message to contain the "BREAKING CHANGE: " section per https://github.com/angular/angular/blob/master/CONTRIBUTING.md#footer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

cp ${SRCDIR}/*.md ${DESTDIR}
cp -r ${SRCDIR}/docs ${DESTDIR}
Expand Down
2 changes: 1 addition & 1 deletion integration/hello_world__closure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"google-closure-compiler": "^20161201.0.0",
"rxjs": "file:../../node_modules/rxjs",
"source-map-explorer": "^1.3.3",
"typescript": "~2.0",
"typescript": "~2.1",
"zone.js": "^0.7.6"
},
"devDependencies": {
Expand Down
11 changes: 6 additions & 5 deletions integration/rxjs.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
"annotateForClosureCompiler": true
},

/**
* Remaining options are copied from
* https://github.com/ReactiveX/rxjs/blob/cba74135810a8e6bbe0b3c7732e8544b0869589e/tsconfig.json
* TODO(alexeagle): use "extends" instead when Angular is on TS 2.1
*/
"compilerOptions": {
"types": [],
/**
* Remaining options are copied from
* https://github.com/ReactiveX/rxjs/blob/cba74135810a8e6bbe0b3c7732e8544b0869589e/tsconfig.json
* TODO(alexeagle): use "extends" instead when Angular is on TS 2.1
*/
"removeComments": false,
"preserveConstEnums": true,
"sourceMap": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/jasmine": "^2.5.41",
"rxjs": "file:../../node_modules/rxjs",
"source-map-explorer": "^1.3.3",
"typescript": "~2.0",
"typescript": "~2.1",
"zone.js": "^0.7.6"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class ChromeDriverExtension extends WebDriverExtension {
.then((_) => this._driver.logs('performance'))
.then((entries) => {
const events: PerfLogEvent[] = [];
entries.forEach(entry => {
entries.forEach((entry: any) => {
const message = JSON.parse(entry['message'])['message'];
if (message['method'] === 'Tracing.dataCollected') {
events.push(message['params']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class IOsDriverExtension extends WebDriverExtension {
.then((_) => this._driver.logs('performance'))
.then((entries) => {
const records: any[] = [];
entries.forEach(entry => {
entries.forEach((entry: any) => {
const message = JSON.parse(entry['message'])['message'];
if (message['method'] === 'Timeline.eventRecorded') {
records.push(message['params']['record']);
Expand Down
4 changes: 3 additions & 1 deletion modules/@angular/benchpress/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"sourceRoot": ".",
"outDir": "../../../dist/packages-dist/benchpress",
"declaration": true,
"skipLibCheck": true
"skipLibCheck": true,
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"exclude": ["integrationtest"],
"files": [
Expand Down
4 changes: 3 additions & 1 deletion modules/@angular/common/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": [ "es2015", "dom" ]
"lib": [ "es2015", "dom" ],
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
"moduleResolution": "node",
"rootDir": "",
"declaration": true,
"lib": ["es6", "dom"],
"baseUrl": "."
"lib": [
"es6",
"dom"
],
"baseUrl": ".",
// don't auto-discover @types/fs-extra
"types": []
}
}
3 changes: 2 additions & 1 deletion modules/@angular/compiler-cli/test/main_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ describe('compiler-cli', () => {
expect(mockConsole.error)
.toHaveBeenCalledWith(
'Error at ' + path.join(basePath, 'test.ts') +
':3:7: Cannot invoke an expression whose type lacks a call signature.');
':3:7: Cannot invoke an expression whose type lacks a call signature. ' +
'Type \'String\' has no compatible call signatures.');
expect(mockConsole.error).not.toHaveBeenCalledWith('Compilation failed');
expect(exitCode).toEqual(1);
done();
Expand Down
2 changes: 2 additions & 0 deletions modules/@angular/compiler/src/expression_parser/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ class _Scanner {
buffer += input.substring(marker, this.index);
this.advance();
let unescapedCode: number;
// Workaround for TS2.1-introduced type strictness
this.peek = this.peek;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this do some kind of type casting or what?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misko just hit this in g3 and we cherry-picked this hunk into his error unclassing PR

if (this.peek == chars.$u) {
// 4 character hex code for unicode character.
const hex: string = input.substring(this.index + 1, this.index + 5);
Expand Down
4 changes: 3 additions & 1 deletion modules/@angular/compiler/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"lib": ["es2015", "dom"],
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {GetterFn, MethodFn, SetterFn} from './types';
* Attention: This regex has to hold even if the code is minified!
*/
export const DELEGATE_CTOR =
/^function\s+\S+\(\)\s*{\s*("use strict";)?\s*(return\s+)?\S+\.apply\(this,\s*arguments\)/;
/^function\s+\S+\(\)\s*{\s*("use strict";)?\s*(return\s+)?(\S+\s+!==\s+null\s+&&\s+)?\S+\.apply\(this,\s*arguments\)/;

export class ReflectionCapabilities implements PlatformReflectionCapabilities {
private _reflect: any;
Expand Down
4 changes: 3 additions & 1 deletion modules/@angular/core/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"inlineSources": true,
"target": "es5",
"lib": ["es2015", "dom"],
"skipLibCheck": true
"skipLibCheck": true,
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
1 change: 1 addition & 0 deletions modules/@angular/examples/upgrade/static/ts/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class Ng2AppModule {
// #docregion Angular 1 Stuff
// #docregion ng1-module
// This Angular 1 module represents the AngularJS pieces of the application
declare var angular: ng.IAngularStatic;
const ng1AppModule = angular.module('ng1AppModule', []);
// #enddocregion

Expand Down
4 changes: 3 additions & 1 deletion modules/@angular/forms/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"lib": ["es2015", "dom"],
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
10 changes: 8 additions & 2 deletions modules/@angular/language-service/src/ts_plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
const results = ls.getCompletionsAt(fileName, position);
if (results && results.length) {
if (base === undefined) {
base = {isMemberCompletion: false, isNewIdentifierLocation: false, entries: []};
base = {
isGlobalCompletion: false,
isMemberCompletion: false,
isNewIdentifierLocation: false,
entries: []
};
}
for (const entry of results) {
base.entries.push(completionToEntry(entry));
Expand All @@ -78,7 +83,8 @@ export function create(info: any /* ts.server.PluginCreateInfo */): ts.LanguageS
documentation: [],
kind: 'angular',
kindModifiers: 'what does this do?',
textSpan: {start: ours.span.start, length: ours.span.end - ours.span.start}
textSpan: {start: ours.span.start, length: ours.span.end - ours.span.start},
tags: [],
};
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"lib": ["es2015", "dom"],
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
4 changes: 3 additions & 1 deletion modules/@angular/platform-browser/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"lib": ["es2015", "dom"],
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
4 changes: 3 additions & 1 deletion modules/@angular/platform-server/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"lib": ["es2015", "dom"],
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"lib": ["es2015", "dom"],
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
4 changes: 3 additions & 1 deletion modules/@angular/platform-webworker/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
"lib": ["es2015", "dom"],
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
4 changes: 2 additions & 2 deletions modules/@angular/router/src/apply_redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {EmptyError} from 'rxjs/util/EmptyError';

import {Route, Routes} from './config';
import {LoadedRouterConfig, RouterConfigLoader} from './router_config_loader';
import {NavigationCancelingError, PRIMARY_OUTLET, Params, defaultUrlMatcher} from './shared';
import {PRIMARY_OUTLET, Params, defaultUrlMatcher, navigationCancelingError} from './shared';
import {UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree} from './url_tree';
import {andObservables, forEach, merge, waitForMap, wrapIntoObservable} from './utils/collection';

Expand Down Expand Up @@ -50,7 +50,7 @@ function namedOutletsRedirect(redirectTo: string): Observable<any> {

function canLoadFails(route: Route): Observable<LoadedRouterConfig> {
return new Observable<LoadedRouterConfig>(
(obs: Observer<LoadedRouterConfig>) => obs.error(new NavigationCancelingError(
(obs: Observer<LoadedRouterConfig>) => obs.error(navigationCancelingError(
`Cannot load children because the guard of the route "path: '${route.path}'" returned false`)));
}

Expand Down
4 changes: 2 additions & 2 deletions modules/@angular/router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {DetachedRouteHandle, DetachedRouteHandleInternal, RouteReuseStrategy} fr
import {LoadedRouterConfig, RouterConfigLoader} from './router_config_loader';
import {RouterOutletMap} from './router_outlet_map';
import {ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot, advanceActivatedRoute, createEmptyState, equalParamsAndUrlSegments, inheritedParamsDataResolve} from './router_state';
import {NavigationCancelingError, PRIMARY_OUTLET, Params} from './shared';
import {PRIMARY_OUTLET, Params, isNavigationCancelingError} from './shared';
import {DefaultUrlHandlingStrategy, UrlHandlingStrategy} from './url_handling_strategy';
import {UrlSerializer, UrlTree, containsTree, createEmptyUrlTree} from './url_tree';
import {andObservables, forEach, merge, waitForMap, wrapIntoObservable} from './utils/collection';
Expand Down Expand Up @@ -802,7 +802,7 @@ export class Router {
}
},
(e: any) => {
if (e instanceof NavigationCancelingError) {
if (isNavigationCancelingError(e)) {
this.resetUrlToCurrentUrlTree();
this.navigated = true;
this.routerEvents.next(
Expand Down
17 changes: 10 additions & 7 deletions modules/@angular/router/src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ export type Params = {
[key: string]: any
};

export class NavigationCancelingError extends Error {
public stack: any;
constructor(public message: string) {
super(message);
this.stack = (<any>new Error(message)).stack;
}
toString(): string { return this.message; }
const NAVIGATION_CANCELING_ERROR = 'ngNavigationCancelingError';

export function navigationCancelingError(message: string) {
const error = Error('NavigationCancelingError: ' + message);
(error as any)[NAVIGATION_CANCELING_ERROR] = true;
return error;
}

export function isNavigationCancelingError(error: Error) {
return (error as any)[NAVIGATION_CANCELING_ERROR];
}

export function defaultUrlMatcher(
Expand Down
2 changes: 1 addition & 1 deletion modules/@angular/router/test/apply_redirects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('applyRedirects', () => {
() => { throw 'Should not reach'; },
(e) => {
expect(e.message).toEqual(
`Cannot load children because the guard of the route "path: 'a'" returned false`);
`NavigationCancelingError: Cannot load children because the guard of the route "path: 'a'" returned false`);
});
});

Expand Down
4 changes: 3 additions & 1 deletion modules/@angular/upgrade/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": [ "es2015", "dom" ]
"lib": [ "es2015", "dom" ],
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": []
},
"files": [
"index.ts",
Expand Down
32 changes: 4 additions & 28 deletions npm-shrinkwrap.clean.json
Original file line number Diff line number Diff line change
Expand Up @@ -6146,45 +6146,21 @@
"dev": true
},
"ts-api-guardian": {
"version": "0.1.4",
"version": "0.2.0",
"dev": true,
"dependencies": {
"ansi-regex": {
"version": "2.0.0",
"dev": true
},
"ansi-styles": {
"version": "2.2.1",
"dev": true
},
"chalk": {
"version": "1.1.3",
"dev": true
},
"diff": {
"version": "2.2.3",
"dev": true
},
"has-ansi": {
"version": "2.0.0",
"dev": true
},
"strip-ansi": {
"version": "3.0.1",
"dev": true
},
"supports-color": {
"version": "2.0.0",
"dev": true
},
"typescript": {
"version": "1.7.3",
"version": "2.0.10",
"dev": true
}
}
},
"tsickle": {
"version": "0.2.6",
"version": "0.21.1",
"dev": true,
"dependencies": {
"source-map": {
Expand Down Expand Up @@ -6265,7 +6241,7 @@
"dev": true
},
"typescript": {
"version": "2.0.2",
"version": "2.1.5",
"dev": true
},
"ua-parser-js": {
Expand Down
Loading