Releases: dolittle/JavaScript.SDK
Prerelease v21.0.0-gimli.11
Summary
Introduces a ModuleTraverser that starts in the main module, and looks through all the exported objects and their properties recursively - and registers anything it finds annotated with @eventType, @aggregateRoot, @eventHandler, @projection or @embedding automatically. Since traversing all the exported things quickly takes a long time in a real project, there is a blacklist of paths to stop at (currently just the JavaScript.SDK packages itself).
It still requires you to import or require the files containing the annotated types to discover, but it reduces the amount of code for the .setup(...) of the DolittleClient.
Added
- Implement the type discovery by traversing the modules that are imported by the main module recursively.
Prerelease v21.0.0-gimli.9
Summary
Changed EventContext to contain both the current and the committed ExecutionContext, and fixed the event processors to include the committed event execution context.
Changed
EventContextnow hascommittedExecutionContex+currentExecutionContextinstead ofexecutionContext, and is in line with .NET SDK.
Fixed
- Committed execution context not passed along by event processors.
Prerelease v21.0.0-gimli.8
Summary
Implement the handshake with the Runtime, using a new RuntimeConnector that performs this operation and fetches the configured tenants.
Added
RuntimeConnectorfor performing the initial connection with retries and back-offs (until cancelled or error is incompatible versions).- A GrpcError interface and typeguard to simplify checking for errors from the gRPC library
- A
cancelledproperty on theCancellation, and a static methodafterto create cancellations that are cancelled after the specified amount of time.
Changed
- Removed the
dns:prefix in the CouldNotConnectToRuntime error message. - The SDK now performs the handshake to get the microservice ID and environment from the Runtime to setup the root ExecutionContext.
Prerelease v21.0.0-gimli.10
Summary
Make IEventHandlerMethodsBuilder return itself for continuation, and fix the last builder interfaces and callbacks I could find so they don't expose the any build(...) methods to the user.
Added
- More builder interfaces that don't expose any
build(...)methods to the user.
Changed
IEventHandlerMethodsBuilder.handle(...)returns itself for continuation
Prerelease v21.0.0-gimli.7
Summary
Allows passing in the global TypeDI container as an external service provider.
Fixed
- Changed type definitions so you can pass inn the global TypeDI
Containerinstance.
Prerelease v21.0.0-gimli.6
Summary
Fixes a bug where optional parameters to TSyringe methods caused the isTSyringeContainer to fail. Also adds support for TypeDI as external service provider.
Added
- Support for TypeDI service provider.
Fixed
- Bug where TSyringe containers where not properly identified.
Prerelease v21.0.0-gimli.5
Summary
A massive chunk of work with lots of changes (sorry). A lot of the changes have to do with trying to create a good structure with "interfaces", and trying to tame imports and exports to not do strange things. Otherwise, a lot of small fixes on documentations and overloads across the board.
On the bigger things, like in the next .NET SDK - we're changing up how the client is built from one step to two steps, to make it easier to integrate with other frameworks and allow us to do an initial asynchronous call to the Runtime while booting up to get some configuration going from the start. A lot of work has gone into the dependency inversion system, which internally is using InversifyJS (with some hacks), but should easily support a root container from any kind of DI package for TS. A little work on how we deal with decorators, also made it easy to create our own injection decorators that don't rely on reflect-metadata. It's not perfect but I think it's better than requiring users to import this special package once.
Added
- Dependency injection of services to EventHandlers
- Tenant-specific dependency injection system using InversifyJS internally - exposed as custom interfaces mimicking .NET setup.
- Metadata decorator factory for using in the SDK that keeps data on the classes. This allows a little more flexibility on using different versions of the SDK to declare e.g. event types since we no longer depend on a global registry to keep track of them.
disconnect()on the client that stops all processors and waits for them to finish before returning.
Changed
- Removed
index.tsfiles in directories, and changed to_exports.tsto help us avoid wrongimportstatements. - Split up the
.build()call to create the client into.setup()+.connect(), to simplify integrations with other frameworks and setting up the configuration. - Interface for working with Aggregate Roots - this is now more in line with the apis for the other artefacts.
Fixed
importfiles directly within packages.
Removed
- Extension methods in the protobuf project, they seem very tied to how things are imported and exported.
- The old
IContainerinterface and usage in the client. The new setup with multiple containers is easier to work with and makes more sense.
Prerelease v21.0.0-gimli.4
Summary
These numbers should not be changed. They were committed by the release-typescript-lib-action, but they should not. The action has also been patched to fix this behaviour: dolittle/release-typescript-lib-action#24
Fixed
- Magic numbers in
VersionInfo.ts
Prerelease v21.0.0-gimli.3
Summary
Adds VersionInfo to be set during build.
Added
- VersionInfo class in
@dolittle/sdk - Update Version Info step in GitHub workflow
Prerelease v21.0.0-gimli.2
Summary
Adds more information to the NPM Packages.
Added
- Description, Keywords, Author added to package.json files.