Skip to content

Commit

Permalink
refactor(compiler): generate arrow functions for setClassMetadata cal…
Browse files Browse the repository at this point in the history
…ls (angular#51637)

Reworks the `setClassMetadata` calls to generate arrow functions instead of full anonymous function declarations. While this won't have an effect on production bundle sizes, it's easier to read and it should lead to small parsing time gains in dev mode.

PR Close angular#51637
  • Loading branch information
crisbeto authored and dylhunn committed Sep 25, 2023
1 parent baaaa6d commit d6bfebe
Show file tree
Hide file tree
Showing 31 changed files with 165 additions and 146 deletions.
4 changes: 2 additions & 2 deletions packages/bazel/test/ng_package/example_package.golden
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class MyService {
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0", ngImport: i0, type: MyService, decorators: [{
type: Injectable,
args: [{ providedIn: 'root' }]
}], ctorParameters: function () { return [{ type: i1.MySecondService }]; } });
}], ctorParameters: () => [{ type: i1.MySecondService }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2JhemVsL3Rlc3QvbmdfcGFja2FnZS9leGFtcGxlL2ltcG9ydHMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQUMsVUFBVSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3pDLE9BQU8sRUFBQyxlQUFlLEVBQUMsTUFBTSxVQUFVLENBQUM7OztBQUd6QyxNQUFNLE9BQU8sU0FBUztJQUNwQixZQUFtQixhQUE4QjtRQUE5QixrQkFBYSxHQUFiLGFBQWEsQ0FBaUI7SUFBRyxDQUFDO3lIQUQxQyxTQUFTOzZIQUFULFNBQVMsY0FERyxNQUFNOztzR0FDbEIsU0FBUztrQkFEckIsVUFBVTttQkFBQyxFQUFDLFVBQVUsRUFBRSxNQUFNLEVBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cblxuaW1wb3J0IHtJbmplY3RhYmxlfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7TXlTZWNvbmRTZXJ2aWNlfSBmcm9tICcuL3NlY29uZCc7XG5cbkBJbmplY3RhYmxlKHtwcm92aWRlZEluOiAncm9vdCd9KVxuZXhwb3J0IGNsYXNzIE15U2VydmljZSB7XG4gIGNvbnN0cnVjdG9yKHB1YmxpYyBzZWNvbmRTZXJ2aWNlOiBNeVNlY29uZFNlcnZpY2UpIHt9XG59XG4iXX0=

--- esm2022/imports/second.mjs ---
Expand Down Expand Up @@ -360,7 +360,7 @@ class MyService {
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0", ngImport: i0, type: MyService, decorators: [{
type: Injectable,
args: [{ providedIn: 'root' }]
}], ctorParameters: function () { return [{ type: MySecondService }]; } });
}], ctorParameters: () => [{ type: MySecondService }] });

/**
* Generated bundle index. Do not edit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {Expression, FunctionExpr, LiteralArrayExpr, LiteralExpr, literalMap, R3ClassMetadata, ReturnStatement, WrappedNodeExpr} from '@angular/compiler';
import {ArrowFunctionExpr, Expression, LiteralArrayExpr, LiteralExpr, literalMap, R3ClassMetadata, WrappedNodeExpr} from '@angular/compiler';
import ts from 'typescript';

import {CtorParameter, DeclarationNode, Decorator, ReflectionHost, TypeValueReferenceKind} from '../../../reflection';
Expand Down Expand Up @@ -58,9 +58,7 @@ export function extractClassMetadata(
const classCtorParameters = reflection.getConstructorParameters(clazz);
if (classCtorParameters !== null) {
const ctorParameters = classCtorParameters.map(param => ctorParameterToMetadata(param, isCore));
metaCtorParameters = new FunctionExpr([], [
new ReturnStatement(new LiteralArrayExpr(ctorParameters)),
]);
metaCtorParameters = new ArrowFunctionExpr([], new LiteralArrayExpr(ctorParameters));
}

// Do the same for property decorators.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runInEachFileSystem(() => {
@Component('metadata') class Target {}
`);
expect(res).toEqual(
`(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Target, [{ type: Component, args: ['metadata'] }], null, null); })();`);
`(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Target, [{ type: Component, args: ['metadata'] }], null, null); })();`);
});

it('should convert namespaced decorated class metadata', () => {
Expand All @@ -35,7 +35,7 @@ runInEachFileSystem(() => {
@core.Component('metadata') class Target {}
`);
expect(res).toEqual(
`(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Target, [{ type: core.Component, args: ['metadata'] }], null, null); })();`);
`(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Target, [{ type: core.Component, args: ['metadata'] }], null, null); })();`);
});

it('should convert decorated class constructor parameter metadata', () => {
Expand All @@ -48,7 +48,7 @@ runInEachFileSystem(() => {
}
`);
expect(res).toContain(
`function () { return [{ type: undefined, decorators: [{ type: Inject, args: [FOO] }] }, { type: i0.Injector }]; }, null);`);
`() => [{ type: undefined, decorators: [{ type: Inject, args: [FOO] }] }, { type: i0.Injector }], null);`);
});

it('should convert decorated field metadata', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ ParameterizedInjectable = __decorate([
export { ParameterizedInjectable };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ParameterizedInjectable, decorators: [{
type: Injectable
}], ctorParameters: function () { return [{ type: Service }, { type: undefined, decorators: [{
}], ctorParameters: () => [{ type: Service }, { type: undefined, decorators: [{
type: Inject,
args: [TOKEN]
}] }, { type: Service, decorators: [] }, { type: undefined, decorators: [{
type: Inject,
args: [TOKEN]
}, {
type: SkipSelf
}] }]; } });
}] }] });
export class NoCtor {
}
NoCtor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: NoCtor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
Expand All @@ -232,15 +232,15 @@ EmptyCtor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.
EmptyCtor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: EmptyCtor });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: EmptyCtor, decorators: [{
type: Injectable
}], ctorParameters: function () { return []; } });
}], ctorParameters: () => [] });
export class NoDecorators {
constructor(service) { }
}
NoDecorators.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: NoDecorators, deps: [{ token: Service }], target: i0.ɵɵFactoryTarget.Injectable });
NoDecorators.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: NoDecorators });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: NoDecorators, decorators: [{
type: Injectable
}], ctorParameters: function () { return [{ type: Service }]; } });
}], ctorParameters: () => [{ type: Service }] });
let CustomInjectable = class CustomInjectable {
constructor(service) { }
};
Expand All @@ -253,7 +253,7 @@ CustomInjectable = __decorate([
export { CustomInjectable };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: CustomInjectable, decorators: [{
type: Injectable
}], ctorParameters: function () { return [{ type: Service, decorators: [] }]; } });
}], ctorParameters: () => [{ type: Service, decorators: [] }] });
export class DerivedInjectable extends ParameterizedInjectable {
}
DerivedInjectable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: DerivedInjectable, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
Expand All @@ -270,7 +270,7 @@ DerivedInjectableWithCtor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0"
DerivedInjectableWithCtor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: DerivedInjectableWithCtor });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: DerivedInjectableWithCtor, decorators: [{
type: Injectable
}], ctorParameters: function () { return []; } });
}], ctorParameters: () => [] });

/****************************************************************************************************
* PARTIAL FILE: parameter_decorators.d.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BasicInjectable.ɵfac = ;
BasicInjectable.ɵprov = ;
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(BasicInjectable, [{
type: Injectable
}], null, null);
Expand All @@ -10,7 +10,7 @@ BasicInjectable.ɵprov = …;

RootInjectable.ɵfac = ;
RootInjectable.ɵprov = ;
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(RootInjectable, [{
type: Injectable,
args: [{providedIn: 'root'}]
Expand All @@ -24,7 +24,7 @@ CustomInjectable.ɵprov = …;
CustomInjectable = __decorate([
CustomClassDecorator()
], CustomInjectable);
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(CustomInjectable, [{
type: Injectable
}], null, null);
Expand All @@ -34,7 +34,7 @@ CustomInjectable = __decorate([

ComponentWithExternalResource.ɵfac = ;
ComponentWithExternalResource.ɵcmp = ;
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(ComponentWithExternalResource, [{
type: Component,
args: [{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
CustomInjectable.ɵfac = ;
CustomInjectable.ɵprov = ;
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(CustomInjectable, [{
type: Injectable
}], function () {
return [{
}], () => [{
type: Service,
decorators: []
}];
}, null);
}], null);
})();
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@ ParameterizedInjectable = __decorate([
__metadata("design:paramtypes", [Service, String, Service, String])
], ParameterizedInjectable);
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ParameterizedInjectable, [{
type: Injectable
}], function () {
return [{type: Service}, {
}], () => [{ type: Service }, {
type: undefined, decorators: [{
type: Inject,
args: [TOKEN]
}]
}, {type: Service, decorators: []}, {
}, { type: Service, decorators: [] }, {
type: undefined, decorators: [{
type: Inject,
args: [TOKEN]
}, {
type: SkipSelf
}]
}];
}, null);
}], null);
})();
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DerivedInjectable.ɵfac = ;
DerivedInjectable.ɵprov = ;
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(DerivedInjectable, [{
type: Injectable
}], null, null);
Expand All @@ -10,8 +10,8 @@ DerivedInjectable.ɵprov = …;

DerivedInjectableWithCtor.ɵfac = ;
DerivedInjectableWithCtor.ɵprov = ;
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(DerivedInjectableWithCtor, [{
type: Injectable
}], function () { return []; }, null);
}], () => [], null);
})();
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
EmptyCtor.ɵfac = ;
EmptyCtor.ɵprov = ;
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(EmptyCtor, [{
type: Injectable
}], function() { return []; }, null);
}], () => [], null);
})();
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NoCtor.ɵfac = ;
NoCtor.ɵprov = ;
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(NoCtor, [{
type: Injectable
}], null, null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
NoDecorators.ɵfac = ;
NoDecorators.ɵprov = ;
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(NoDecorators, [{
type: Injectable
}], function () {
return [{
}], () => [{
type: Service
}];
}, null);
}], null);
})();
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ __decorate([
CustomPropDecorator(),
__metadata("design:type", String)
], MyDir.prototype, "mixed", void 0);
(function () {
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && $i0$.ɵsetClassMetadata(MyDir, [{
type: Directive
}], null, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ IfDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: IfDirective, decorators: [{
type: Directive,
args: [{ selector: '[if]' }]
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
export class MyComponent {
}
MyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ MyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "0.0.0-PLA
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyPipe, decorators: [{
type: Pipe,
args: [{ name: 'myPipe' }]
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; } });
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
export class MyOtherPipe {
constructor(changeDetectorRef) { }
transform(value, ...args) {
Expand All @@ -173,9 +173,9 @@ MyOtherPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "0.0.
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyOtherPipe, decorators: [{
type: Pipe,
args: [{ name: 'myOtherPipe' }]
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef, decorators: [{
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef, decorators: [{
type: Optional
}] }]; } });
}] }] });
export class MyApp {
constructor() {
this.name = 'World';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ForOfDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, decorators: [{
type: Directive,
args: [{ selector: '[forOf]' }]
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { forOf: [{
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }], propDecorators: { forOf: [{
type: Input
}] } });

Expand Down Expand Up @@ -106,7 +106,7 @@ ForOfDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, decorators: [{
type: Directive,
args: [{ selector: '[forOf]' }]
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { forOf: [{
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }], propDecorators: { forOf: [{
type: Input
}] } });

Expand Down Expand Up @@ -197,7 +197,7 @@ ForOfDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, decorators: [{
type: Directive,
args: [{ selector: '[forOf]' }]
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { forOf: [{
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }], propDecorators: { forOf: [{
type: Input
}] } });

Expand Down Expand Up @@ -314,7 +314,7 @@ ForOfDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ForOfDirective, decorators: [{
type: Directive,
args: [{ selector: '[forOf]' }]
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }]; }, propDecorators: { forOf: [{
}], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }], propDecorators: { forOf: [{
type: Input
}] } });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ MyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyComponent, decorators: [{
type: Component,
args: [{ selector: 'my-component', template: '' }]
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }]; } });
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }] });
export class MyModule {
}
MyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: MyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
Expand Down Expand Up @@ -254,7 +254,7 @@ IfDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: IfDirective, decorators: [{
type: Directive,
args: [{ selector: '[if]' }]
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; } });
}], ctorParameters: () => [{ type: i0.TemplateRef }] });
export class MyComponent {
constructor() {
this.salutation = 'Hello';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ BaseService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.
BaseService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: BaseService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: BaseService, decorators: [{
type: Injectable
}], ctorParameters: function () { return [{ type: Thing }]; } });
}], ctorParameters: () => [{ type: Thing }] });
export class ChildService extends BaseService {
}
ChildService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: ChildService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
Expand Down Expand Up @@ -509,7 +509,7 @@ BaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "0.
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: BaseModule, decorators: [{
type: NgModule,
args: [{ providers: [Service] }]
}], ctorParameters: function () { return [{ type: Service }]; } });
}], ctorParameters: () => [{ type: Service }] });
export class BasicModule extends BaseModule {
}
BasicModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "0.0.0-PLACEHOLDER", ngImport: i0, type: BasicModule, deps: null, target: i0.ɵɵFactoryTarget.NgModule });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FooModule.ɵfac = function FooModule_Factory(t) { return new (t || FooModule)();
FooModule.ɵmod = /*@__PURE__*/ $i0$.ɵɵdefineNgModule({type: FooModule, bootstrap: [FooComponent]});
FooModule.ɵinj = /*@__PURE__*/ $i0$.ɵɵdefineInjector({});
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FooModule, [{
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FooModule, [{
type: NgModule,
args: [{ declarations: [FooComponent, BarDirective, QuxPipe], bootstrap: [FooComponent] }]
}], null, null); })();
Loading

0 comments on commit d6bfebe

Please sign in to comment.