diff --git a/packages/common/module-utils/configurable-module.builder.ts b/packages/common/module-utils/configurable-module.builder.ts index cc642779f6d..29a31eb04b9 100644 --- a/packages/common/module-utils/configurable-module.builder.ts +++ b/packages/common/module-utils/configurable-module.builder.ts @@ -209,8 +209,6 @@ export class ConfigurableModuleBuilder< const providers: Array = [ { provide: self.options.optionsInjectionToken, - // useFactory is for performance reasons - // see more: https://github.com/nestjs/nest/issues/12738#issuecomment-1810987001 useFactory: () => this.omitExtras(options, self.extras), }, ]; diff --git a/packages/core/injector/internal-core-module/internal-core-module-factory.ts b/packages/core/injector/internal-core-module/internal-core-module-factory.ts index d97d8e96782..5635a5abaab 100644 --- a/packages/core/injector/internal-core-module/internal-core-module-factory.ts +++ b/packages/core/injector/internal-core-module/internal-core-module-factory.ts @@ -42,8 +42,6 @@ export class InternalCoreModuleFactory { ); }; - // useFactory is for performance reasons - // see more: https://github.com/nestjs/nest/issues/12738#issuecomment-1810987001 return InternalCoreModule.register([ { provide: ExternalContextCreator, diff --git a/packages/core/router/router-module.ts b/packages/core/router/router-module.ts index 5fd316e90a9..c21b7c0762b 100644 --- a/packages/core/router/router-module.ts +++ b/packages/core/router/router-module.ts @@ -32,8 +32,6 @@ export class RouterModule { providers: [ { provide: ROUTES, - // useFactory is for performance reasons - // see more: https://github.com/nestjs/nest/issues/12738#issuecomment-1810987001 useFactory: () => routes, }, ], diff --git a/packages/microservices/module/clients.module.ts b/packages/microservices/module/clients.module.ts index 5350ee3fa78..cbb053b388f 100644 --- a/packages/microservices/module/clients.module.ts +++ b/packages/microservices/module/clients.module.ts @@ -19,8 +19,6 @@ export class ClientsModule { const clientsOptions = !Array.isArray(options) ? options.clients : options; const clients = (clientsOptions || []).map(item => ({ provide: item.name, - // useFactory is for performance reasons - // see more: https://github.com/nestjs/nest/issues/12738#issuecomment-1810987001 useFactory: () => this.assignOnAppShutdownHook(ClientProxyFactory.create(item)), })); diff --git a/packages/platform-express/multer/multer.module.ts b/packages/platform-express/multer/multer.module.ts index 540cba75dd4..04823c95885 100644 --- a/packages/platform-express/multer/multer.module.ts +++ b/packages/platform-express/multer/multer.module.ts @@ -17,8 +17,6 @@ export class MulterModule { return { module: MulterModule, providers: [ - // useFactory is for performance reasons - // see more: https://github.com/nestjs/nest/issues/12738#issuecomment-1810987001 { provide: MULTER_MODULE_OPTIONS, useFactory: () => options }, { provide: MULTER_MODULE_ID,