Skip to content
Merged
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
2 changes: 1 addition & 1 deletion integration/angular_cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"puppeteer": "3.0.2",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3"
"typescript": "~3.9.2"
},
"resolutions": {
"rxjs": "6.5.4",
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@
]
},
"devDependencies": {
"@angular/animations": "10.0.0-next.7",
"@angular/animations": "10.0.0-next.8",
"@angular/cdk": "9.2.3",
"@angular/common": "10.0.0-next.7",
"@angular/compiler": "10.0.0-next.7",
"@angular/compiler-cli": "10.0.0-next.7",
"@angular/core": "10.0.0-next.7",
"@angular/forms": "10.0.0-next.7",
"@angular/localize": "10.0.0-next.7",
"@angular/common": "10.0.0-next.8",
"@angular/compiler": "10.0.0-next.8",
"@angular/compiler-cli": "10.0.0-next.8",
"@angular/core": "10.0.0-next.8",
"@angular/forms": "10.0.0-next.8",
"@angular/localize": "10.0.0-next.8",
"@angular/material": "9.2.3",
"@angular/platform-browser": "10.0.0-next.7",
"@angular/platform-browser-dynamic": "10.0.0-next.7",
"@angular/platform-server": "10.0.0-next.7",
"@angular/router": "10.0.0-next.7",
"@angular/service-worker": "10.0.0-next.7",
"@angular/platform-browser": "10.0.0-next.8",
"@angular/platform-browser-dynamic": "10.0.0-next.8",
"@angular/platform-server": "10.0.0-next.8",
"@angular/router": "10.0.0-next.8",
"@angular/service-worker": "10.0.0-next.8",
"@babel/core": "7.9.6",
"@babel/generator": "7.9.6",
"@babel/plugin-transform-runtime": "7.9.6",
Expand Down Expand Up @@ -220,7 +220,7 @@
"tslint": "^6.0.0",
"tslint-no-circular-imports": "^0.7.0",
"tslint-sonarts": "1.9.0",
"typescript": "3.8.3",
"typescript": "3.9.2",
"verdaccio": "4.5.1",
"webpack": "4.42.1",
"webpack-dev-middleware": "3.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"peerDependencies": {
"@angular/compiler-cli": ">=10.0.0-next.0 < 11",
"typescript": ">=3.6 < 3.9"
"typescript": ">=3.9 < 3.10"
},
"peerDependenciesMeta": {
"@angular/localize": {
Expand Down
4 changes: 2 additions & 2 deletions packages/angular_devkit/build_ng_packagr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"tsickle": "~0.38.0"
},
"devDependencies": {
"@angular/compiler": "10.0.0-next.7",
"@angular/compiler-cli": "10.0.0-next.7",
"@angular/compiler": "10.0.0-next.8",
"@angular/compiler-cli": "10.0.0-next.8",
"@angular-devkit/core": "0.0.0",
"ng-packagr": "~10.0.0-next.0",
"tslib": "^1.10.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/ngtools/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
},
"peerDependencies": {
"@angular/compiler-cli": ">=10.0.0-next.0 < 11",
"typescript": ">=3.6 < 3.9",
"typescript": ">=3.9 < 3.10",
"webpack": "^4.0.0"
},
"devDependencies": {
"@angular/compiler": "10.0.0-next.7",
"@angular/compiler-cli": "10.0.0-next.7",
"typescript": "3.8.3",
"@angular/compiler": "10.0.0-next.8",
"@angular/compiler-cli": "10.0.0-next.8",
"typescript": "3.9.2",
"webpack": "4.42.1"
}
}
88 changes: 58 additions & 30 deletions packages/ngtools/webpack/src/transformers/ctor-parameters_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ describe('Constructor Parameter Transformer', () => {
const output = `
import { __decorate } from "tslib";
export class ClassInject { } ;
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: ClassInject } ];
MyService = __decorate([ Injectable() ], MyService);
let MyService = /** @class */ (() => {
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: ClassInject } ];
MyService = __decorate([ Injectable() ], MyService);
return MyService;
})();
export { MyService };
`;

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

const output = `
import { __decorate } from "tslib";
let RootProvidedService = class RootProvidedService { constructor() { } };
RootProvidedService = __decorate([ Injectable({ providedIn: 'root' }) ], RootProvidedService);

let RootProvidedService = /** @class */ (() => {
let RootProvidedService = class RootProvidedService { constructor() { } };
RootProvidedService = __decorate([ Injectable({ providedIn: 'root' }) ], RootProvidedService);
return RootProvidedService;
})();
export { RootProvidedService };
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: RootProvidedService } ];
MyService = __decorate([ Injectable() ], MyService);
let MyService = /** @class */ (() => {
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: RootProvidedService } ];
MyService = __decorate([ Injectable() ], MyService);
return MyService;
})();
export { MyService };
`;

Expand Down Expand Up @@ -118,12 +128,12 @@ describe('Constructor Parameter Transformer', () => {
const output = `
import { __decorate } from "tslib";
import { RootProvidedService } from './root-provided-service';

let MyService = class MyService {
constructor(v) { }
};
MyService.ctorParameters = () => [ { type: RootProvidedService } ];
MyService = __decorate([ Injectable() ], MyService);
let MyService = /** @class */ (() => {
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: RootProvidedService } ];
MyService = __decorate([ Injectable() ], MyService);
return MyService;
})();
export { MyService };
`;

Expand All @@ -146,9 +156,11 @@ describe('Constructor Parameter Transformer', () => {
const output = `
import { __decorate, __param } from "tslib";
export const INTERFACE_INJECT = new InjectionToken('interface-inject');
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
let MyService = /** @class */ (() => {
let MyService = class MyService { constructor(v) { } }; MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
return MyService;
})();
export { MyService };
`;

Expand All @@ -171,9 +183,12 @@ describe('Constructor Parameter Transformer', () => {
const output = `
import { __decorate, __param } from "tslib";
export const INTERFACE_INJECT = new InjectionToken('interface-inject');
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
let MyService = /** @class */ (() => {
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
return MyService;
})();
export { MyService };
`;

Expand Down Expand Up @@ -202,9 +217,12 @@ describe('Constructor Parameter Transformer', () => {
const output = `
import { __decorate, __param } from "tslib";
import { INTERFACE_INJECT } from './module-inject';
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
let MyService = /** @class */ (() => {
let MyService = class MyService { constructor(v) { } };
MyService.ctorParameters = () => [ { type: undefined, decorators: [{ type: Inject, args: [INTERFACE_INJECT,] }] } ];
MyService = __decorate([ Injectable(), __param(0, Inject(INTERFACE_INJECT)) ], MyService);
return MyService;
})();
export { MyService };
`;

Expand Down Expand Up @@ -232,15 +250,25 @@ describe('Constructor Parameter Transformer', () => {
const output = `
import { __decorate, __param } from "tslib";

let ProvidedService = class ProvidedService { constructor() { } };
ProvidedService = __decorate([ Injectable() ], ProvidedService);
let ProvidedService = /** @class */ (() => {
let ProvidedService = class ProvidedService {
constructor() { }
};
ProvidedService = __decorate([ Injectable() ], ProvidedService);
return ProvidedService;
})();
export { ProvidedService };

let LibService = class LibService {
constructor(service) { this.service = service; }
};
LibService.ctorParameters = () => [ { type: ProvidedService, decorators: [{ type: Optional }] } ];
LibService = __decorate([ Injectable(), __param(0, Optional()) ], LibService);
let LibService = /** @class */ (() => {
let LibService = class LibService {
constructor(service) {
this.service = service;
}
};
LibService.ctorParameters = () => [ { type: ProvidedService, decorators: [{ type: Optional }] } ];
LibService = __decorate([ Injectable(), __param(0, Optional()) ], LibService);
return LibService;
})();
export { LibService };
`;

Expand Down
59 changes: 40 additions & 19 deletions packages/ngtools/webpack/src/transformers/elide_imports_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,10 @@ describe('@ngtools/webpack transformers', () => {
import { __decorate } from "tslib";
import { Decorator } from './decorator';

let Foo = class Foo { constructor(param) { } };
Foo = __decorate([ Decorator() ], Foo);
let Foo = /** @class */ (() => {
let Foo = class Foo { constructor(param) { } };
Foo = __decorate([ Decorator() ], Foo); return Foo;
})();
export { Foo };
`;

Expand Down Expand Up @@ -363,8 +365,11 @@ describe('@ngtools/webpack transformers', () => {
import { Decorator } from './decorator';
import { Service } from './service';

let Foo = class Foo { constructor(param) { } };
Foo = __decorate([ Decorator(), __metadata("design:paramtypes", [Service]) ], Foo);
let Foo = /** @class */ (() => {
let Foo = class Foo { constructor(param) { } };
Foo = __decorate([ Decorator(), __metadata("design:paramtypes", [Service]) ], Foo);
return Foo;
})();
export { Foo };
`;

Expand All @@ -389,11 +394,13 @@ describe('@ngtools/webpack transformers', () => {
const output = tags.stripIndent`
import { __decorate, __metadata } from "tslib";
import { Decorator } from './decorator';

import { Service } from './service';

export class Foo { }
__decorate([ Decorator(), __metadata("design:type", Service) ], Foo.prototype, "foo", void 0);
let Foo = /** @class */ (() => {
class Foo { }
__decorate([ Decorator(), __metadata("design:type", Service) ], Foo.prototype, "foo", void 0);
return Foo;
})();
export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);
Expand Down Expand Up @@ -424,8 +431,13 @@ describe('@ngtools/webpack transformers', () => {
import { Decorator } from './decorator';
import { Service } from './service';

export class Foo { set name(f) { this._foo = f; } }
__decorate([ Decorator(), __metadata("design:type", Service), __metadata("design:paramtypes", [Service]) ], Foo.prototype, "name", null);
let Foo = /** @class */ (() => {
class Foo { set name(f) { this._foo = f; } }
__decorate([ Decorator(), __metadata("design:type", Service), __metadata("design:paramtypes", [Service]) ], Foo.prototype, "name", null);
return Foo;
})();

export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);
Expand Down Expand Up @@ -456,8 +468,12 @@ describe('@ngtools/webpack transformers', () => {
import { Decorator } from './decorator';
import { Service } from './service';

export class Foo { get name() { return this._foo; } }
__decorate([ Decorator(), __metadata("design:type", Service), __metadata("design:paramtypes", []) ], Foo.prototype, "name", null);
let Foo = /** @class */ (() => {
class Foo { get name() { return this._foo; } }
__decorate([ Decorator(), __metadata("design:type", Service), __metadata("design:paramtypes", []) ], Foo.prototype, "name", null);
return Foo;
})();
export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);
Expand Down Expand Up @@ -486,9 +502,12 @@ describe('@ngtools/webpack transformers', () => {
import { Decorator } from './decorator';
import { Service } from './service';

export class Foo { name() { return undefined; } }
__decorate([ Decorator(), __metadata("design:type", Function),
__metadata("design:paramtypes", []), __metadata("design:returntype", Service) ], Foo.prototype, "name", null);
let Foo = /** @class */ (() => {
class Foo { name() { return undefined; } }
__decorate([ Decorator(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Service) ], Foo.prototype, "name", null);
return Foo;
})();
export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);
Expand Down Expand Up @@ -517,10 +536,12 @@ describe('@ngtools/webpack transformers', () => {
import { Decorator } from './decorator';
import { Service } from './service';

export class Foo { name(f) { } }

__decorate([ Decorator(), __metadata("design:type", Function), __metadata("design:paramtypes", [Service]),
__metadata("design:returntype", void 0) ], Foo.prototype, "name", null);
let Foo = /** @class */ (() => {
class Foo { name(f) { } }
__decorate([ Decorator(), __metadata("design:type", Function), __metadata("design:paramtypes", [Service]), __metadata("design:returntype", void 0) ], Foo.prototype, "name", null);
return Foo;
})();
export { Foo };
`;

const { program, compilerHost } = createTypescriptContext(input, additionalFiles, true, extraCompilerOptions);
Expand Down
Loading