Releases: ditsmod/ditsmod
Ditsmod v2.55.0 Released!
Breaking Changes
Other changes
Commit | Type | Description |
---|---|---|
6767399700 | fix | Introduced $if() method for Providers helper. |
e1fa4f0024 | fix | Allow passing instance of Providers helper to providersPer* . |
77ccff93a3 | fix | Introduced providers.passThrough() . |
9357078583 | fix | Fixed type for request handler. |
Full Changelog: core-2.54.2...core-2.55.0
Ditsmod v2.54.0 Released!
Commit | Type | Description |
---|---|---|
7e2a5195f2 | refactor | Hide logs from external modules, by default. |
83542addf2 | refactor | Now the name of the module where the logs were recorded is added to all logs. |
41d6c2eeb2 | refactor | Allow collisions with mix scope in host modules. |
7823a7aa93 | refactor | Introduced DecoratorAndValue#declaredInDir property. |
2f1d6c6f0c | refactor | Introduced ExtensionObj#exportedOnly . |
c3910acae2 | refactor | Fixed AppInitializer#logExtensionsStatistic() , now counter works as expected. |
Full Changelog: core-2.53.2...core-2.54.0
Ditsmod v2.52.0 Released!
Breaking Changes
- renamed
SingletonHttpFrontend
toDefaultSingletonHttpFrontend
34c1f18eb4. - renamed
SingletonChainMaker
toDefaultSingletonChainMaker
6f6bdd4c64. - renamed
SingletonHttpErrorHandler
toDefaultSingletonHttpErrorHandler
d3be41e942.
Commit | Type | Description |
---|---|---|
5af42900c4 | feat | added Res#setHeaders . |
16141c9cfd | feat | added ability pass headers to Res#send() . |
b2c9fdd160 | feat | extended RequestContext . |
951e096b2d | feat | added HttpHeaders interface. |
9e1f71972c | feat | added RequestContext to defaultProvidersPerApp . |
5f0fe6e030 | fix | fixed import makeClassDecorator for GuardMetadata . |
e52d41f3ff | fix | fixed type for A_PATH_PARAMS . |
a0149e582b | refactor | refactoring Logger and ConsoleLogger . |
fd63181078 | refactor | refactoring ConsoleLogger . |
9189d9644d | refactor | change default log level for ErrorOpts . |
66f468f783 | refactor | apply new methods for RequestContext . |
Full Changelog: core-2.51.2...core-2.52.0
Ditsmod v2.50.0 Released!
Features
-
Introduced
RequestContext
for HTTP interceptors:interface HttpInterceptor { intercept(next: HttpHandler, ctx: RequestContext): Promise<any>; }
-
Introduced
@controller({ isSingleton: true })
options. You can now specify that your controller is a singleton. In this case, the controller receives aRequestContext
, but an injector is not created for it on every request. Routes in such a controller are very fast.
v2.49.0
Features
-
Added a check to determine if the imported module is external. This change applies to exporting providers and extensions from the root module. Previously, these extensions and providers were added to all modules without exception, including external modules (which are usually placed in the
node_modules
folder). And it was unnecessary, because external modules do not need "global" providers and extensions. Therefore, it is no longer available in this release. -
Added
bufferLogs
option:import { Application } from '@ditsmod/core'; import { AppModule } from './app/app.module.js'; const app = await new Application().bootstrap(AppModule, { bufferLogs: false }); app.server.listen(3000, 'localhost');
If
{ bufferLogs: true }
, all messages are buffered during application initialization and flushed afterwards. This can be useful if you want all messages to be recorded by the final logger, which is configured after the application is fully initialized.Default -
true
. -
Reduced
Logger
interface requirements. Now the logger you can use to substitute the defaultConsoleLogger
should have only three methods:log(level: InputLogLevel, ...args: any[]); setLevel(value: OutputLogLevel); getLevel(): OutputLogLevel;
-
Now
res.nodeRes
is public property, so you can use this native Node.js response object.
Bug fixes
- When appending modules, their
providersPerApp
was ignored. In this release, they are taken into account. - Fixed
cleanErrorTrace()
.
v2.48.0
Features
-
Added
Injector#pull()
method.
If the nearest provider with the giventoken
is in the parent injector, then this method pulls that provider into the current injector. After that, it works the same asinjector.get()
. If the nearest provider with the giventoken
is in the current injector, then this method behaves exactly likeinjector.get()
. This method is primarily useful because it allows you, in the context of the current injector, to rebuild instances of providers that depend on a particular configuration that may be different in the current and parent injectors:import { injectable, Injector } from '@ditsmod/core'; class Config { one: any; two: any; } @injectable() class Service { constructor(public config: Config) {} } const parent = Injector.resolveAndCreate([Service, { token: Config, useValue: { one: 1, two: 2 } }]); const child = parent.resolveAndCreateChild([{ token: Config, useValue: { one: 11, two: 22 } }]); child.get(Service).config; // returns from parent injector: { one: 1, two: 2 } child.pull(Service).config; // pulls Service in current injector: { one: 11, two: 22 } child.get(Service).config; // now, in current injector, works cache: { one: 11, two: 22 }
-
Added
isClassFactoryProvider()
type guard. -
For
Logger
, addedmergeConfig()
andgetConfig()
. -
In
Providers
helper, added support forFunctionFactoryProvider
.
v2.47.0
Features
Migration to ESM!
v2.46.0
Features
- Added support for the second useFactory form. Now you can use a simple function (instead of a class method):
function fn1(service1: Service1, service2: Service2) {
// ...
return 'some value';
}
{ token: 'token3', useFactory: fn1, deps: [Service1, Service2] }
v2.40.0
Features
- added
normalizeProviders()
,getToken()
to index.ts; - added
T
param toValueProvider<T>
; - added some code to support new package
@ditsmod/testing
.