Skip to content

Commit 6ece7db

Browse files
IgorMinarmhevery
authored andcommittedJul 26, 2019
1 parent 3a2b195 commit 6ece7db

File tree

34 files changed

+196
-65
lines changed

34 files changed

+196
-65
lines changed
 
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
10+
11+
import * as animations from '@angular/animations';
12+
import * as animationsBrowser from '@angular/animations/browser';
13+
import * as animationsBrowserTesting from '@angular/animations/browser/testing';
14+
import * as common from '@angular/common';
15+
import * as commonHttp from '@angular/common/http';
16+
import * as commonTesting from '@angular/common/testing';
17+
import * as commonHttpTesting from '@angular/common/testing';
18+
import * as compiler from '@angular/compiler';
19+
import * as compilerTesting from '@angular/compiler/testing';
20+
import * as core from '@angular/core';
21+
import * as coreTesting from '@angular/core/testing';
22+
import * as elements from '@angular/elements';
23+
import * as forms from '@angular/forms';
24+
// Current plan for Angular 8 is to stop building the @angular/http package
25+
// import * as http from '@angular/http';
26+
// import * as httpTesting from '@angular/http/testing';
27+
import * as platformBrowser from '@angular/platform-browser';
28+
import * as platformBrowserDynamic from '@angular/platform-browser-dynamic';
29+
import * as platformBrowserDynamicTesting from '@angular/platform-browser-dynamic/testing';
30+
import * as platformBrowserAnimations from '@angular/platform-browser/animations';
31+
import * as platformBrowserTesting from '@angular/platform-browser/testing';
32+
import * as platformServer from '@angular/platform-server';
33+
import * as platformServerTesting from '@angular/platform-server/testing';
34+
import * as platformWebworker from '@angular/platform-webworker';
35+
import * as platformWebworkerDynamic from '@angular/platform-webworker-dynamic';
36+
import * as router from '@angular/router';
37+
import * as routerTesting from '@angular/router/testing';
38+
import * as routerUpgrade from '@angular/router/upgrade';
39+
import * as serviceWorker from '@angular/service-worker';
40+
import * as upgrade from '@angular/upgrade';
41+
import * as upgradeStatic from '@angular/upgrade/static';
42+
import * as upgradeTesting from '@angular/upgrade/static/testing';
43+
44+
export default {
45+
animations,
46+
animationsBrowser,
47+
animationsBrowserTesting,
48+
common,
49+
commonTesting,
50+
commonHttp,
51+
commonHttpTesting,
52+
compiler,
53+
compilerTesting,
54+
core,
55+
coreTesting,
56+
elements,
57+
forms,
58+
// See above
59+
// http,
60+
// httpTesting,
61+
platformBrowser,
62+
platformBrowserTesting,
63+
platformBrowserDynamic,
64+
platformBrowserDynamicTesting,
65+
platformBrowserAnimations,
66+
platformServer,
67+
platformServerTesting,
68+
platformWebworker,
69+
platformWebworkerDynamic,
70+
router,
71+
routerTesting,
72+
routerUpgrade,
73+
serviceWorker,
74+
upgrade,
75+
upgradeStatic,
76+
upgradeTesting,
77+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "angular-integration",
3+
"description": "Assert that users with TypeScript 3.5 can type-check an Angular application",
4+
"version": "0.0.0",
5+
"license": "MIT",
6+
"dependencies": {
7+
"@angular/animations": "file:../../dist/packages-dist/animations",
8+
"@angular/common": "file:../../dist/packages-dist/common",
9+
"@angular/compiler": "file:../../dist/packages-dist/compiler",
10+
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
11+
"@angular/core": "file:../../dist/packages-dist/core",
12+
"@angular/elements": "file:../../dist/packages-dist/elements",
13+
"@angular/forms": "file:../../dist/packages-dist/forms",
14+
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
15+
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
16+
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
17+
"@angular/platform-webworker": "file:../../dist/packages-dist/platform-webworker",
18+
"@angular/platform-webworker-dynamic": "file:../../dist/packages-dist/platform-webworker-dynamic",
19+
"@angular/router": "file:../../dist/packages-dist/router",
20+
"@angular/service-worker": "file:../../dist/packages-dist/service-worker",
21+
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
22+
"@types/jasmine": "2.5.41",
23+
"rxjs": "file:../../node_modules/rxjs",
24+
"typescript": "3.5.3",
25+
"zone.js": "file:../../node_modules/zone.js"
26+
},
27+
"scripts": {
28+
"test": "tsc"
29+
}
30+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"emitDecoratorMetadata": true,
4+
"experimentalDecorators": true,
5+
"module": "commonjs",
6+
"moduleResolution": "node",
7+
"outDir": "../../dist/typings_test_ts32/",
8+
"rootDir": ".",
9+
"target": "es5",
10+
"lib": [
11+
"es5",
12+
"dom",
13+
"es2015.collection",
14+
"es2015.iterable",
15+
"es2015.promise"
16+
],
17+
"types": [],
18+
"strictNullChecks": true
19+
},
20+
"files": [
21+
"include-all.ts",
22+
"node_modules/@types/jasmine/index.d.ts"
23+
]
24+
}

‎package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@
105105
"source-map": "^0.6.1",
106106
"source-map-support": "0.5.9",
107107
"systemjs": "0.18.10",
108-
"tsickle": "0.34.3",
108+
"tsickle": "0.36.0",
109109
"tslib": "^1.9.0",
110110
"tslint": "5.7.0",
111-
"typescript": "~3.4.2",
111+
"typescript": "~3.5.3",
112112
"xhr2": "0.1.4",
113113
"yargs": "13.1.0",
114114
"zone.js": "^0.9.1"

‎packages/bazel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"peerDependencies": {
4040
"@angular/compiler-cli": "0.0.0-PLACEHOLDER",
4141
"@bazel/typescript": "0.*",
42-
"typescript": ">=3.4 <3.5"
42+
"typescript": ">=3.4 <3.6"
4343
},
4444
"repository": {
4545
"type": "git",

‎packages/bazel/test/ng_package/example_package.golden

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export * from './index';
300300

301301
/**
302302
* @fileoverview added by tsickle
303-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
303+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
304304
*/
305305
/**
306306
* @license
@@ -316,7 +316,7 @@ export { MyModule } from './mymodule';
316316

317317
/**
318318
* @fileoverview added by tsickle
319-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
319+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
320320
*/
321321
/**
322322
* @license
@@ -337,7 +337,7 @@ MyModule.decorators = [
337337

338338
/**
339339
* @fileoverview added by tsickle
340-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
340+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
341341
*/
342342
/**
343343
* @license
@@ -371,7 +371,7 @@ export * from './index';
371371

372372
/**
373373
* @fileoverview added by tsickle
374-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
374+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
375375
*/
376376
/**
377377
* @license
@@ -514,7 +514,7 @@ import { NgModule } from '@angular/core';
514514

515515
/**
516516
* @fileoverview added by tsickle
517-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
517+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
518518
*/
519519
class SecondaryModule {
520520
}
@@ -526,7 +526,7 @@ const a = 1;
526526

527527
/**
528528
* @fileoverview added by tsickle
529-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
529+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
530530
*/
531531

532532
/**
@@ -549,7 +549,7 @@ import { NgModule } from '@angular/core';
549549

550550
/**
551551
* @fileoverview added by tsickle
552-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
552+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
553553
*/
554554
class MyModule {
555555
}
@@ -559,7 +559,7 @@ MyModule.decorators = [
559559

560560
/**
561561
* @fileoverview added by tsickle
562-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
562+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
563563
*/
564564

565565
/**

‎packages/benchpress/src/metric/user_metric.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export class UserMetric extends Metric {
3434
endMeasure(restart: boolean): Promise<{[key: string]: any}> {
3535
let resolve: (result: any) => void;
3636
let reject: (error: any) => void;
37-
const promise = new Promise((res, rej) => {
37+
const promise = new Promise < { [key: string]: any; }
38+
> ((res, rej) => {
3839
resolve = res;
3940
reject = rej;
4041
});

‎packages/common/testing/src/mock_platform_location.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ export interface MockPlatformLocationConfig {
9393
*
9494
* @publicApi
9595
*/
96-
export const MOCK_PLATFORM_LOCATION_CONFIG = new InjectionToken('MOCK_PLATFORM_LOCATION_CONFIG');
96+
export const MOCK_PLATFORM_LOCATION_CONFIG =
97+
new InjectionToken<MockPlatformLocationConfig>('MOCK_PLATFORM_LOCATION_CONFIG');
9798

9899
/**
99100
* Mock implementation of URL state.

‎packages/compiler-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"peerDependencies": {
2525
"@angular/compiler": "0.0.0-PLACEHOLDER",
26-
"typescript": ">=3.4 <3.5"
26+
"typescript": ">=3.4 <3.6"
2727
},
2828
"engines": {
2929
"node": ">=8.0"

‎packages/compiler-cli/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ function createEmitCallback(options: api.CompilerOptions): api.TsEmitCallback|un
106106
}) =>
107107
// tslint:disable-next-line:no-require-imports only depend on tsickle if requested
108108
require('tsickle').emitWithTsickle(
109-
program, {...tsickleHost, options, host}, host, options, targetSourceFile, writeFile,
110-
cancellationToken, emitOnlyDtsFiles, {
109+
program, {...tsickleHost, options, host, moduleResolutionHost: host}, host, options,
110+
targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, {
111111
beforeTs: customTransformers.before,
112112
afterTs: customTransformers.after,
113113
});

‎packages/compiler-cli/src/metadata/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export interface MetadataMap { [name: string]: MemberMetadata[]; }
5959
export interface MemberMetadata {
6060
__symbolic: 'constructor'|'method'|'property';
6161
decorators?: (MetadataSymbolicExpression|MetadataError)[];
62+
parameters?: (MetadataSymbolicExpression|MetadataError|null|undefined)[];
6263
}
6364
export function isMemberMetadata(value: any): value is MemberMetadata {
6465
if (value) {

‎packages/compiler-cli/src/transformers/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const MIN_TS_VERSION = '3.4.0';
7979
* ∀ supported typescript version v, v < MAX_TS_VERSION
8080
* MAX_TS_VERSION is not considered as a supported TypeScript version
8181
*/
82-
const MAX_TS_VERSION = '3.5.0';
82+
const MAX_TS_VERSION = '3.6.0';
8383

8484
class AngularCompilerProgram implements Program {
8585
private rootNames: string[];

‎packages/compiler-cli/test/diagnostics/check_types_spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -771,12 +771,6 @@ describe('ng type checker', () => {
771771
'<div>{{"hello" | aPipe}}</div>',
772772
`Argument of type '"hello"' is not assignable to parameter of type 'number'.`, '0:5');
773773
});
774-
it('should report an index into a map expression', () => {
775-
rejectOnlyWithFullTemplateTypeCheck(
776-
'<div>{{ {a: 1}[name] }}</div>',
777-
`Element implicitly has an 'any' type because type '{ a: number; }' has no index signature.`,
778-
'0:5');
779-
});
780774
it('should report an invalid property on an exportAs directive', () => {
781775
rejectOnlyWithFullTemplateTypeCheck(
782776
'<div aDir #aDir="aDir">{{aDir.fname}}</div>',

‎packages/compiler-cli/test/metadata/collector_spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('Collector', () => {
6060
version: METADATA_VERSION,
6161
metadata: {
6262
DeclaredClass: {__symbolic: 'class'},
63-
declaredFn: {__symbolic: 'function'},
63+
declaredFn: {__symbolic: 'function'} as any,
6464
}
6565
});
6666
});
@@ -433,8 +433,8 @@ describe('Collector', () => {
433433
}
434434
}
435435
},
436-
complexFn: {__symbolic: 'function'},
437-
declaredFn: {__symbolic: 'function'}
436+
complexFn: {__symbolic: 'function'} as any,
437+
declaredFn: {__symbolic: 'function'} as any,
438438
}
439439
});
440440
});

‎packages/compiler-cli/test/ngtsc/ngtsc_spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3144,7 +3144,7 @@ runInEachFileSystem(os => {
31443144
const fileoverview = `
31453145
/**
31463146
* @fileoverview added by tsickle
3147-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3147+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
31483148
*/
31493149
`;
31503150
expect(trim(jsContents).startsWith(trim(fileoverview))).toBeTruthy();
@@ -3161,7 +3161,7 @@ runInEachFileSystem(os => {
31613161
const fileoverview = `
31623162
/**
31633163
* @fileoverview added by tsickle
3164-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3164+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
31653165
*/
31663166
`;
31673167
expect(trim(jsContents).startsWith(trim(fileoverview))).toBeTruthy();
@@ -3193,7 +3193,7 @@ runInEachFileSystem(os => {
31933193
* @fileoverview Some Comp overview
31943194
* @modName {some_comp}
31953195
*
3196-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3196+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
31973197
*/
31983198
`;
31993199
expect(trim(jsContents).startsWith(trim(fileoverview))).toBeTruthy();
@@ -3222,7 +3222,7 @@ runInEachFileSystem(os => {
32223222
* @fileoverview Some Comp overview
32233223
* @modName {some_comp}
32243224
*
3225-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3225+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
32263226
*/
32273227
`;
32283228
expect(trim(jsContents).startsWith(trim(fileoverview))).toBeTruthy();

‎packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export declare class CommonModule {
238238
`'does_not_exist' does not exist on type '{ name: string; }'`,
239239
`Expected 2 arguments, but got 3.`,
240240
`Argument of type '"test"' is not assignable to parameter of type 'number'`,
241-
`Argument of type '{ name: string; }' is not assignable to parameter of type '{}[]'`,
241+
`Argument of type '{ name: string; }' is not assignable to parameter of type 'unknown[]'`,
242242
];
243243

244244
for (const error of allErrors) {

‎packages/core/src/event_emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import {Subject, Subscription} from 'rxjs';
5656
*
5757
* @publicApi
5858
*/
59-
export class EventEmitter<T> extends Subject<T> {
59+
export class EventEmitter<T extends any> extends Subject<T> {
6060
// TODO: mark this as internal once all the facades are gone
6161
// we can't mark it as internal now because EventEmitter exported via @angular/core would not
6262
// contain this property making it incompatible with all the code that uses EventEmitter via

‎packages/core/src/linker/element_ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {noop} from '../util/noop';
2424
// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,
2525
// i.e. users have to ask for what they need. With that, we can build better analysis tools
2626
// and could do better codegen in the future.
27-
export class ElementRef<T = any> {
27+
export class ElementRef<T extends any = any> {
2828
/**
2929
* The underlying native element or `null` if direct access to native elements is not supported
3030
* (e.g. when the application runs in a web worker).

‎packages/forms/test/form_array_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {of } from 'rxjs';
1616
function asyncValidator(expected: string, timeouts = {}) {
1717
return (c: AbstractControl) => {
1818
let resolve: (result: any) => void = undefined !;
19-
const promise = new Promise(res => { resolve = res; });
19+
const promise = new Promise<ValidationErrors|null>(res => { resolve = res; });
2020
const t = (timeouts as any)[c.value] != null ? (timeouts as any)[c.value] : 0;
2121
const res = c.value != expected ? {'async': true} : null;
2222

0 commit comments

Comments
 (0)
Please sign in to comment.