Skip to content

Commit 3c58878

Browse files
committed
chore(build): Upgrade to [email protected]
This change also makes us compliant with 1.6.0-dev compiler, so we can do some experiments with apps that use 1.6 features and compile against Angular. We should probably add a travis build for 1.6 so we stay compatible with both versions.
1 parent c5cb700 commit 3c58878

28 files changed

+140
-145
lines changed

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,10 +760,10 @@ gulp.task('!pre.test.typings', ['docs/typings'], function() {
760760
});
761761

762762
// -----------------
763-
// TODO: Use a version of TypeScript that matches what is used by DefinitelyTyped.
764763
gulp.task('test.typings', ['!pre.test.typings'], function() {
765764
return gulp.src(['typing_spec/*.ts', 'dist/docs/typings/angular2/angular2.d.ts'])
766765
.pipe(tsc({target: 'ES5', module: 'commonjs',
766+
experimentalDecorators: true,
767767
noImplicitAny: true,
768768
// Don't use the version of typescript that gulp-typescript depends on, we need 1.5
769769
// see https://github.com/ivogabe/gulp-typescript#typescript-version

modules/angular2/annotations.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ export {
2727
} from 'angular2/src/core/compiler/interfaces';
2828

2929

30-
export {
31-
Class,
32-
ClassDefinition,
33-
ParameterDecorator,
34-
TypeDecorator
35-
} from 'angular2/src/util/decorators';
30+
export {Class, ClassDefinition, TypeDecorator} from 'angular2/src/util/decorators';
3631

3732
export {
3833
Attribute,

modules/angular2/src/core/annotations/decorators.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import {ComponentAnnotation, DirectiveAnnotation, LifecycleEvent} from './annotations';
22
import {ViewAnnotation} from './view';
33
import {AttributeAnnotation, QueryAnnotation, ViewQueryAnnotation} from './di';
4-
import {
5-
makeDecorator,
6-
makeParamDecorator,
7-
TypeDecorator,
8-
ParameterDecorator,
9-
Class
10-
} from '../../util/decorators';
4+
import {makeDecorator, makeParamDecorator, TypeDecorator, Class} from '../../util/decorators';
115
import {Type} from 'angular2/src/facade/lang';
126
import {ViewEncapsulation} from 'angular2/src/render/api';
137

modules/angular2/src/facade/intl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ declare module Intl {
88
currency?: string;
99
currencyDisplay?: string;
1010
useGrouping?: boolean;
11+
minimumIntegerDigits?: number;
12+
minimumFractionDigits?: number;
13+
maximumFractionDigits?: number;
1114
}
1215

1316
interface NumberFormat {

modules/angular2/src/facade/lang.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ export function CONST_EXPR<T>(expr: T): T {
5959
return expr;
6060
}
6161

62-
export function CONST():<T>(target: T) => T {
62+
export function CONST(): ClassDecorator {
6363
return (target) => target;
6464
}
6565

66-
export function ABSTRACT():<T>(target: T) => T {
66+
export function ABSTRACT(): ClassDecorator {
6767
return (t) => t;
6868
}
6969

7070
// Note: This is only a marker annotation needed for ts2dart.
7171
// This is written so that is can be used as a Traceur annotation
7272
// or a Typescript decorator.
73-
export function IMPLEMENTS(_):<T>(target: T) => T {
73+
export function IMPLEMENTS(_): ClassDecorator {
7474
return (t) => t;
7575
}
7676

modules/angular2/src/mock/location_mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {List, ListWrapper} from 'angular2/src/facade/collection';
66
import {Location} from 'angular2/src/router/location';
77

88

9-
@proxy
9+
@proxy()
1010
@IMPLEMENTS(Location)
1111
export class SpyLocation extends SpyObject {
1212
urlChanges: List<string>;

modules/angular2/src/router/route_config_impl.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ export class Route implements RouteDefinition {
2222
path: string;
2323
component: Type;
2424
as: string;
25+
// added next two properties to work around https://github.com/Microsoft/TypeScript/issues/4107
26+
loader: Function;
27+
redirectTo: string;
2528
constructor({path, component, as}: {path: string, component: Type, as?: string}) {
2629
this.path = path;
2730
this.component = component;
2831
this.as = as;
32+
this.loader = null;
33+
this.redirectTo = null;
2934
}
3035
}
3136

modules/angular2/src/test_lib/spies.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@ import 'package:angular2/src/change_detection/change_detection.dart';
44
import 'package:angular2/di.dart';
55
import './test_lib.dart';
66

7-
@proxy
7+
@proxy()
88
class SpyChangeDetector extends SpyObject implements ChangeDetector {
99
noSuchMethod(m) => super.noSuchMethod(m);
1010
}
1111

12-
@proxy
12+
@proxy()
1313
class SpyProtoChangeDetector extends SpyObject implements ProtoChangeDetector {
1414
noSuchMethod(m) => super.noSuchMethod(m);
1515
}
1616

17-
@proxy
17+
@proxy()
1818
class SpyPipe extends SpyObject implements Pipe {
1919
noSuchMethod(m) => super.noSuchMethod(m);
2020
}
2121

22-
@proxy
22+
@proxy()
2323
class SpyPipeFactory extends SpyObject implements PipeFactory {
2424
noSuchMethod(m) => super.noSuchMethod(m);
2525
}
2626

27-
@proxy
27+
@proxy()
2828
class SpyDependencyProvider extends SpyObject implements DependencyProvider {
2929
noSuchMethod(m) => super.noSuchMethod(m);
3030
}
3131

32-
@proxy
32+
@proxy()
3333
class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef {
3434
noSuchMethod(m) => super.noSuchMethod(m);
3535
}

modules/angular2/src/test_lib/test_lib.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import {createTestInjector, FunctionWithParamTokens, inject} from './test_inject
1212

1313
export {inject} from './test_injector';
1414

15-
export function proxy() {}
15+
export function proxy(): ClassDecorator {
16+
return (t) => t;
17+
}
1618

1719
var _global: jasmine.GlobalPolluter = <any>(typeof window === 'undefined' ? global : window);
1820

modules/angular2/src/util/decorators.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export interface TypeDecorator {
4949
*/
5050
<T extends Type>(type: T): T;
5151

52+
// Make TypeDecorator assignable to built-in ParameterDecorator type.
53+
// ParameterDecorator is declared in lib.d.ts as a `declare type`
54+
// so we cannot declare this interface as a subtype.
55+
// see https://github.com/angular/angular/issues/3379#issuecomment-126169417
56+
(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
57+
5258
/**
5359
* Storage for the accumulated annotations so far used by the DSL syntax.
5460
*
@@ -62,17 +68,6 @@ export interface TypeDecorator {
6268
Class(obj: ClassDefinition): Type;
6369
}
6470

65-
/**
66-
* An interface implemented by all Angular parameter decorators, which allows them to be used as ES7
67-
* decorators.
68-
*/
69-
export interface ParameterDecorator {
70-
/**
71-
* Invoke as ES7 decorator.
72-
*/
73-
(cls: Type, unusedKey: any, index: number): void;
74-
}
75-
7671
function extractAnnotation(annotation: any): any {
7772
if (isFunction(annotation) && annotation.hasOwnProperty('annotation')) {
7873
// it is a decorator, extract annotation

0 commit comments

Comments
 (0)