Skip to content

Releases: dolittle/JavaScript.SDK

Prerelease v21.0.0-gimli.11

15 Dec 07:14
8463249

Choose a tag to compare

Pre-release

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

14 Dec 15:11
325e3a0

Choose a tag to compare

Pre-release

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

  • EventContext now has committedExecutionContex+currentExecutionContext instead of executionContext, and is in line with .NET SDK.

Fixed

  • Committed execution context not passed along by event processors.

Prerelease v21.0.0-gimli.8

14 Dec 13:47
916f4ae

Choose a tag to compare

Pre-release

Summary

Implement the handshake with the Runtime, using a new RuntimeConnector that performs this operation and fetches the configured tenants.

Added

  • RuntimeConnector for 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 cancelled property on the Cancellation, and a static method after to 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

14 Dec 15:54
4770d71

Choose a tag to compare

Pre-release

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

13 Dec 22:56
687103e

Choose a tag to compare

Pre-release

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 Container instance.

Prerelease v21.0.0-gimli.6

13 Dec 22:34
e75c2bc

Choose a tag to compare

Pre-release

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

13 Dec 18:44
864aa0a

Choose a tag to compare

Pre-release

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.ts files in directories, and changed to _exports.ts to help us avoid wrong import statements.
  • 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

  • import files directly within packages.

Removed

  • Extension methods in the protobuf project, they seem very tied to how things are imported and exported.
  • The old IContainer interface 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

07 Dec 13:39
0c70f04

Choose a tag to compare

Pre-release

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

07 Dec 11:22
a12517f

Choose a tag to compare

Pre-release

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

07 Dec 10:53
c705685

Choose a tag to compare

Pre-release

Summary

Adds more information to the NPM Packages.

Added

  • Description, Keywords, Author added to package.json files.