Skip to content

Commit ad471a9

Browse files
alan-agius4mgechev
authored andcommitted
build: update to TypeScript 3.9
1 parent 31bd1e5 commit ad471a9

File tree

11 files changed

+373
-265
lines changed

11 files changed

+373
-265
lines changed

integration/angular_cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"puppeteer": "3.0.2",
4444
"ts-node": "~8.3.0",
4545
"tslint": "~6.1.0",
46-
"typescript": "~3.8.3"
46+
"typescript": "~3.9.2"
4747
},
4848
"resolutions": {
4949
"rxjs": "6.5.4",

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@
6666
]
6767
},
6868
"devDependencies": {
69-
"@angular/animations": "10.0.0-next.7",
69+
"@angular/animations": "10.0.0-next.8",
7070
"@angular/cdk": "9.2.3",
71-
"@angular/common": "10.0.0-next.7",
72-
"@angular/compiler": "10.0.0-next.7",
73-
"@angular/compiler-cli": "10.0.0-next.7",
74-
"@angular/core": "10.0.0-next.7",
75-
"@angular/forms": "10.0.0-next.7",
76-
"@angular/localize": "10.0.0-next.7",
71+
"@angular/common": "10.0.0-next.8",
72+
"@angular/compiler": "10.0.0-next.8",
73+
"@angular/compiler-cli": "10.0.0-next.8",
74+
"@angular/core": "10.0.0-next.8",
75+
"@angular/forms": "10.0.0-next.8",
76+
"@angular/localize": "10.0.0-next.8",
7777
"@angular/material": "9.2.3",
78-
"@angular/platform-browser": "10.0.0-next.7",
79-
"@angular/platform-browser-dynamic": "10.0.0-next.7",
80-
"@angular/platform-server": "10.0.0-next.7",
81-
"@angular/router": "10.0.0-next.7",
82-
"@angular/service-worker": "10.0.0-next.7",
78+
"@angular/platform-browser": "10.0.0-next.8",
79+
"@angular/platform-browser-dynamic": "10.0.0-next.8",
80+
"@angular/platform-server": "10.0.0-next.8",
81+
"@angular/router": "10.0.0-next.8",
82+
"@angular/service-worker": "10.0.0-next.8",
8383
"@babel/core": "7.9.6",
8484
"@babel/generator": "7.9.6",
8585
"@babel/plugin-transform-runtime": "7.9.6",
@@ -220,7 +220,7 @@
220220
"tslint": "^6.0.0",
221221
"tslint-no-circular-imports": "^0.7.0",
222222
"tslint-sonarts": "1.9.0",
223-
"typescript": "3.8.3",
223+
"typescript": "3.9.2",
224224
"verdaccio": "4.5.1",
225225
"webpack": "4.42.1",
226226
"webpack-dev-middleware": "3.7.2",

packages/angular_devkit/build_angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
},
7676
"peerDependencies": {
7777
"@angular/compiler-cli": ">=10.0.0-next.0 < 11",
78-
"typescript": ">=3.6 < 3.9"
78+
"typescript": ">=3.9 < 3.10"
7979
},
8080
"peerDependenciesMeta": {
8181
"@angular/localize": {

packages/angular_devkit/build_ng_packagr/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"tsickle": "~0.38.0"
1616
},
1717
"devDependencies": {
18-
"@angular/compiler": "10.0.0-next.7",
19-
"@angular/compiler-cli": "10.0.0-next.7",
18+
"@angular/compiler": "10.0.0-next.8",
19+
"@angular/compiler-cli": "10.0.0-next.8",
2020
"@angular-devkit/core": "0.0.0",
2121
"ng-packagr": "~10.0.0-next.0",
2222
"tslib": "^1.10.0"

packages/ngtools/webpack/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
},
2929
"peerDependencies": {
3030
"@angular/compiler-cli": ">=10.0.0-next.0 < 11",
31-
"typescript": ">=3.6 < 3.9",
31+
"typescript": ">=3.9 < 3.10",
3232
"webpack": "^4.0.0"
3333
},
3434
"devDependencies": {
35-
"@angular/compiler": "10.0.0-next.7",
36-
"@angular/compiler-cli": "10.0.0-next.7",
37-
"typescript": "3.8.3",
35+
"@angular/compiler": "10.0.0-next.8",
36+
"@angular/compiler-cli": "10.0.0-next.8",
37+
"typescript": "3.9.2",
3838
"webpack": "4.42.1"
3939
}
4040
}

packages/ngtools/webpack/src/transformers/ctor-parameters_spec.ts

Lines changed: 58 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ describe('Constructor Parameter Transformer', () => {
3232
const output = `
3333
import { __decorate } from "tslib";
3434
export class ClassInject { } ;
35-
let MyService = class MyService { constructor(v) { } };
36-
MyService.ctorParameters = () => [ { type: ClassInject } ];
37-
MyService = __decorate([ Injectable() ], MyService);
35+
let MyService = /** @class */ (() => {
36+
let MyService = class MyService { constructor(v) { } };
37+
MyService.ctorParameters = () => [ { type: ClassInject } ];
38+
MyService = __decorate([ Injectable() ], MyService);
39+
return MyService;
40+
})();
3841
export { MyService };
3942
`;
4043

@@ -80,12 +83,19 @@ describe('Constructor Parameter Transformer', () => {
8083

8184
const output = `
8285
import { __decorate } from "tslib";
83-
let RootProvidedService = class RootProvidedService { constructor() { } };
84-
RootProvidedService = __decorate([ Injectable({ providedIn: 'root' }) ], RootProvidedService);
86+
87+
let RootProvidedService = /** @class */ (() => {
88+
let RootProvidedService = class RootProvidedService { constructor() { } };
89+
RootProvidedService = __decorate([ Injectable({ providedIn: 'root' }) ], RootProvidedService);
90+
return RootProvidedService;
91+
})();
8592
export { RootProvidedService };
86-
let MyService = class MyService { constructor(v) { } };
87-
MyService.ctorParameters = () => [ { type: RootProvidedService } ];
88-
MyService = __decorate([ Injectable() ], MyService);
93+
let MyService = /** @class */ (() => {
94+
let MyService = class MyService { constructor(v) { } };
95+
MyService.ctorParameters = () => [ { type: RootProvidedService } ];
96+
MyService = __decorate([ Injectable() ], MyService);
97+
return MyService;
98+
})();
8999
export { MyService };
90100
`;
91101

@@ -118,12 +128,12 @@ describe('Constructor Parameter Transformer', () => {
118128
const output = `
119129
import { __decorate } from "tslib";
120130
import { RootProvidedService } from './root-provided-service';
121-
122-
let MyService = class MyService {
123-
constructor(v) { }
124-
};
125-
MyService.ctorParameters = () => [ { type: RootProvidedService } ];
126-
MyService = __decorate([ Injectable() ], MyService);
131+
let MyService = /** @class */ (() => {
132+
let MyService = class MyService { constructor(v) { } };
133+
MyService.ctorParameters = () => [ { type: RootProvidedService } ];
134+
MyService = __decorate([ Injectable() ], MyService);
135+
return MyService;
136+
})();
127137
export { MyService };
128138
`;
129139

@@ -146,9 +156,11 @@ describe('Constructor Parameter Transformer', () => {
146156
const output = `
147157
import { __decorate, __param } from "tslib";
148158
export const INTERFACE_INJECT = new InjectionToken('interface-inject');
149-
let MyService = class MyService { constructor(v) { } };
150-
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
151-
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
159+
let MyService = /** @class */ (() => {
160+
let MyService = class MyService { constructor(v) { } }; MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
161+
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
162+
return MyService;
163+
})();
152164
export { MyService };
153165
`;
154166

@@ -171,9 +183,12 @@ describe('Constructor Parameter Transformer', () => {
171183
const output = `
172184
import { __decorate, __param } from "tslib";
173185
export const INTERFACE_INJECT = new InjectionToken('interface-inject');
174-
let MyService = class MyService { constructor(v) { } };
175-
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
176-
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
186+
let MyService = /** @class */ (() => {
187+
let MyService = class MyService { constructor(v) { } };
188+
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
189+
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
190+
return MyService;
191+
})();
177192
export { MyService };
178193
`;
179194

@@ -202,9 +217,12 @@ describe('Constructor Parameter Transformer', () => {
202217
const output = `
203218
import { __decorate, __param } from "tslib";
204219
import { INTERFACE_INJECT } from './module-inject';
205-
let MyService = class MyService { constructor(v) { } };
206-
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
207-
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
220+
let MyService = /** @class */ (() => {
221+
let MyService = class MyService { constructor(v) { } };
222+
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
223+
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
224+
return MyService;
225+
})();
208226
export { MyService };
209227
`;
210228

@@ -232,15 +250,25 @@ describe('Constructor Parameter Transformer', () => {
232250
const output = `
233251
import { __decorate, __param } from "tslib";
234252
235-
let ProvidedService = class ProvidedService { constructor() { } };
236-
ProvidedService = __decorate([ Injectable() ], ProvidedService);
253+
let ProvidedService = /** @class */ (() => {
254+
let ProvidedService = class ProvidedService {
255+
constructor() { }
256+
};
257+
ProvidedService = __decorate([ Injectable() ], ProvidedService);
258+
return ProvidedService;
259+
})();
237260
export { ProvidedService };
238261
239-
let LibService = class LibService {
240-
constructor(service) { this.service = service; }
241-
};
242-
LibService.ctorParameters = () => [ { type: ProvidedService, decorators: [{ type: Optional }] } ];
243-
LibService = __decorate([ Injectable(), __param(0, Optional()) ], LibService);
262+
let LibService = /** @class */ (() => {
263+
let LibService = class LibService {
264+
constructor(service) {
265+
this.service = service;
266+
}
267+
};
268+
LibService.ctorParameters = () => [ { type: ProvidedService, decorators: [{ type: Optional }] } ];
269+
LibService = __decorate([ Injectable(), __param(0, Optional()) ], LibService);
270+
return LibService;
271+
})();
244272
export { LibService };
245273
`;
246274

packages/ngtools/webpack/src/transformers/elide_imports_spec.ts

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,10 @@ describe('@ngtools/webpack transformers', () => {
326326
import { __decorate } from "tslib";
327327
import { Decorator } from './decorator';
328328
329-
let Foo = class Foo { constructor(param) { } };
330-
Foo = __decorate([ Decorator() ], Foo);
329+
let Foo = /** @class */ (() => {
330+
let Foo = class Foo { constructor(param) { } };
331+
Foo = __decorate([ Decorator() ], Foo); return Foo;
332+
})();
331333
export { Foo };
332334
`;
333335

@@ -363,8 +365,11 @@ describe('@ngtools/webpack transformers', () => {
363365
import { Decorator } from './decorator';
364366
import { Service } from './service';
365367
366-
let Foo = class Foo { constructor(param) { } };
367-
Foo = __decorate([ Decorator(), __metadata("design:paramtypes", [Service]) ], Foo);
368+
let Foo = /** @class */ (() => {
369+
let Foo = class Foo { constructor(param) { } };
370+
Foo = __decorate([ Decorator(), __metadata("design:paramtypes", [Service]) ], Foo);
371+
return Foo;
372+
})();
368373
export { Foo };
369374
`;
370375

@@ -389,11 +394,13 @@ describe('@ngtools/webpack transformers', () => {
389394
const output = tags.stripIndent`
390395
import { __decorate, __metadata } from "tslib";
391396
import { Decorator } from './decorator';
392-
393397
import { Service } from './service';
394-
395-
export class Foo { }
396-
__decorate([ Decorator(), __metadata("design:type", Service) ], Foo.prototype, "foo", void 0);
398+
let Foo = /** @class */ (() => {
399+
class Foo { }
400+
__decorate([ Decorator(), __metadata("design:type", Service) ], Foo.prototype, "foo", void 0);
401+
return Foo;
402+
})();
403+
export { Foo };
397404
`;
398405

399406
const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);
@@ -424,8 +431,13 @@ describe('@ngtools/webpack transformers', () => {
424431
import { Decorator } from './decorator';
425432
import { Service } from './service';
426433
427-
export class Foo { set name(f) { this._foo = f; } }
428-
__decorate([ Decorator(), __metadata("design:type", Service), __metadata("design:paramtypes", [Service]) ], Foo.prototype, "name", null);
434+
let Foo = /** @class */ (() => {
435+
class Foo { set name(f) { this._foo = f; } }
436+
__decorate([ Decorator(), __metadata("design:type", Service), __metadata("design:paramtypes", [Service]) ], Foo.prototype, "name", null);
437+
return Foo;
438+
})();
439+
440+
export { Foo };
429441
`;
430442

431443
const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);
@@ -456,8 +468,12 @@ describe('@ngtools/webpack transformers', () => {
456468
import { Decorator } from './decorator';
457469
import { Service } from './service';
458470
459-
export class Foo { get name() { return this._foo; } }
460-
__decorate([ Decorator(), __metadata("design:type", Service), __metadata("design:paramtypes", []) ], Foo.prototype, "name", null);
471+
let Foo = /** @class */ (() => {
472+
class Foo { get name() { return this._foo; } }
473+
__decorate([ Decorator(), __metadata("design:type", Service), __metadata("design:paramtypes", []) ], Foo.prototype, "name", null);
474+
return Foo;
475+
})();
476+
export { Foo };
461477
`;
462478

463479
const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);
@@ -486,9 +502,12 @@ describe('@ngtools/webpack transformers', () => {
486502
import { Decorator } from './decorator';
487503
import { Service } from './service';
488504
489-
export class Foo { name() { return undefined; } }
490-
__decorate([ Decorator(), __metadata("design:type", Function),
491-
__metadata("design:paramtypes", []), __metadata("design:returntype", Service) ], Foo.prototype, "name", null);
505+
let Foo = /** @class */ (() => {
506+
class Foo { name() { return undefined; } }
507+
__decorate([ Decorator(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Service) ], Foo.prototype, "name", null);
508+
return Foo;
509+
})();
510+
export { Foo };
492511
`;
493512

494513
const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);
@@ -517,10 +536,12 @@ describe('@ngtools/webpack transformers', () => {
517536
import { Decorator } from './decorator';
518537
import { Service } from './service';
519538
520-
export class Foo { name(f) { } }
521-
522-
__decorate([ Decorator(), __metadata("design:type", Function), __metadata("design:paramtypes", [Service]),
523-
__metadata("design:returntype", void 0) ], Foo.prototype, "name", null);
539+
let Foo = /** @class */ (() => {
540+
class Foo { name(f) { } }
541+
__decorate([ Decorator(), __metadata("design:type", Function), __metadata("design:paramtypes", [Service]), __metadata("design:returntype", void 0) ], Foo.prototype, "name", null);
542+
return Foo;
543+
})();
544+
export { Foo };
524545
`;
525546

526547
const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);

0 commit comments

Comments
 (0)