All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added mappings class to map on creation handlerclasses and behaviours
- Changed interfaces to classes
- Modified name of object to better match TS conventions
- Resolver is now passed as mediator ctor parameter
- Removed settings and examples
- Add exports of
pipelineBehavior
andIPipelineBehavior
on index.js
- Add cjs and esm examples
- Update to Typescript V5
- Fix CJS / ESM module support
- Fix behaviour
setOrder
method
- Support for ES Modules. This mitigates the bailout on optimizations warnings whem importing CommonJs packages on Angular applications More info
- Added new pipeline behavior example to documentation.
- Added new example of reordering execution order for both notifications and pipeline behaviors to documentation.
- Separated the documentation into "Core concepts", and then extracted the Dependency Injection part out as a separate section.
- Added new types called
INotificationClass
andINotificationHandlerClass
. These are used for classes instead of instances of these types. The code wrongly hadINotification
specified in cases where the actual real type wasINotificationClass
. This also strengthens the code and makes it harder to write it wrong. - The
publish
method on theMediator
now returns aPromise<void>
instead ofPromise<void[]>
. - The
Dispatcher
now just has two properties.notifications
andbehaviors
, which control the handler mappings for each of them, and the order. - Added support for Pipeline behaviors.
- A new decorator has been introduced for this.
- A new
IPipelineBehavior
interface, as well as aIPipelineBehaviorClass
type has been introduced. - Changed imports to type imports where possible, to speed up compilation, and decrease the chance of accidental circular dependencies.
- Added
"importsNotUsedAsValues": "error"
to thetsconfig.json
file, so that the TypeScript compiler will give an error if a regular import is used where a type import could have been used instead. Again, to decrease the chance of accidental circular dependencies. - Added
"strict": true
to thetsconfig.json
file, so that we now have full TypeScript strictness in the project.
- Removed the order in the notification handler decorator.
- Got rid of the
DispatcherInstance
class. Instead, we now have mapping classes (similar, but not entirely identical). See the rest of the notes.
- Changed attribute name
RequestHandler
torequestHandler
- Update packages versions
0.2.0 - 2021-03-01
This release support Notifications.
Due to early stage of the project until release v1 is not possible to adheres to Semantic Versioning consequentially breaking changes are added to this release.
- Added support for notification with
@NotificationHandler
attribute - Added
dispatcher
property of typeIDispatcher
tomediatorSettings
. - Added
publish
method toMediator
@Handler
is now deprecated use@RequestHandler
instead.
- The
resolve
method ofIResolver
is changed fromresolve<T>(name: string): IRequestHandler<IRequest<T>, T>;
toresolve<T>(name: string): T;
this is necessary because the resolver now is used by the request handler and by the dispatcher.
0.1.2 - 2021-02-27
- No code changes
- Added comments
0.1.1 - 2021-02-25
- No code changes
- Fixed README with github repository
0.1.0 - 2021-02-25
- Initial release