Skip to content

Releases: dolittle/JavaScript.SDK

Prerelease v22.2.0-sam.5

09 Feb 10:52
b18ec56

Choose a tag to compare

Pre-release

Summary

Revert Tutorials/Projections, and add new MongoDBProjections sample. Upgrade to released contracts, and checked that it works with the released Runtime.

Prerelease v22.2.0-sam.4

09 Feb 07:15
68410e8

Choose a tag to compare

Pre-release

Summary

Adds validation that fails during build of Projections if copy to MongoDB collection name is not valid. Also upgrades contracts, and upgrades to the new contracts and adds enums for new conversion types.

Also added some specs for verifying that the copy to MongoDB specifications are correct when using decorators on classes and when using the explicit builder.

Prerelease v22.2.0-sam.3

07 Feb 12:59
cfff501

Choose a tag to compare

Pre-release

Summary

Implements the new structures of Projection registration copy to MongoDB conversion arguments. A few notes:

  • Renaming is not implemented, I don't see how that would be useful in JS/TS. And it would require work to extend the MongoDB deserialiser somehow.
  • @convertToMongoDB decorators on nested types are not detected. In general nested types on Projections don't work that well, so I'll leave that for a bigger effort later.
  • If you have properties with . in the name, the .WithConversion('property.name', ...) will generate wrong conversion structures. I don't see a nice way to deal with this alongside the fancy TS magic to get compiler warnings on those strings.

I feel like there is time to add a few specs on some of these things. I'll leave the PR for a little longer. I have tested it with the sam.6 release of the Runtime, and it is pretty cool!

Prerelease v22.2.0-sam.2

03 Feb 13:46
69d750f

Choose a tag to compare

Pre-release

Summary

Extends the Db.collection method with an overload to more easily get the collection for a Projection read model type.

Prerelease v22.2.0-sam.1

02 Feb 09:04
e3ef286

Choose a tag to compare

Pre-release

Summary

Implement decorators for configuring projection read model copies to MongoDB on a projection class, and for specifying conversions on properties.

Prerelease v22.2.0-sam.0

01 Feb 11:21
560f69a

Choose a tag to compare

Pre-release

Summary

Implements the explicit builder API for specifying read model copies to MongoDB for a projection. This implementation should send over the specification to the Runtime.

Todo:

  • Decorators for specifying copies and conversions on projection classes
  • Detecting decorators when registering projections from types

Release v22.1.0

28 Jan 10:06
ffcd084

Choose a tag to compare

Summary

Adds the possibility to take upon a specific projection read model as a dependency and use that to get the projection states for that read model type.

Added

  • IProjectionOf<TReadModel> that acts as a minimal IProjectionStore for a particular projection type.
  • IProjectionStore.of<TReadModel>(...) method with overloads for sending in ProjectionId and ScopeId to create instances of IProjectionOf<TReadModel>
  • IProjectionOf<TReadModel> is registered in the tenant scoped service providers for all types with the [Projection] attribute, or projections created in the .WithProjections(...) builder. So they can be injected in controllers etc.
  • IProjectionOf.for(type) that returns a service identifier that can be used in @inject(...) decorators.
  • IAggregateOf.for(type) that returns a service identifier that can be used in @inject(...) decorators.

Release v22.0.0

25 Jan 11:33
2c4f818

Choose a tag to compare

Summary

Simplifies the IProjectionStore apis by removing the CurrentState<> wrapper around the returned types from get(...) and getAll(...) methods, and returns an array instead of a Map when getting multiple read models. And introduces a new getState(...) method that has the wrapped types for when it is interesting.

Added

  • IProjectionStore.getState(...) method that keeps the syntax of the previous .get(...) method.

Changed

  • IProjectionStore.get(...) returns the specified type or any instead of wrapping with CurrentState<>
  • IProjectionStore.getAll(...) returns an array of the specified type or any instead of a Map of keys to CurrentState<>.

Release v21.0.1

24 Jan 13:27
36d5447

Choose a tag to compare

Summary

Uses the new batch streaming method to get all Projection states from the Runtime. This fixes an issue where a large amount of Projection states caused the gRPC client in the SDK to throw an exception because the response message was too big. Also fixed some gRPC method internals that we haven't used before (server streaming calls), and fixed the references to JavaScript.Fundamentals pre-release packages.

Fixed

  • The IProjectionStore.getAll method now uses the new gRPC method that streams results back in batches to fix the issue of too large gRPC messages when a large amount of projection read models have been created.

Release v21.0.0

20 Jan 15:28
68d39ef

Choose a tag to compare

Summary

Major improvements to the Dolittle Client, in how it connects to the Runtime, configuration, setup an integration with ExpressJS. Combined these changes aim to make the SDK easier to setup and configure, and to make it easier to detect when incompatible versions are used.

Added

  • Support for Dependency Injection using Inversify internally, with support for TypeDi and TSyinge, also supporting tenant-specific bindings.
  • The DolittleClient and tenant specific resources (IEventStore, IAggregates, IProjections, ...) are bound in the service provider used and exposed by the client. They can be used in for example Event Handlers, or with the ExpressJS integration in request handlers.
  • Express integration through .use(dolittle()) on express , starts the DolittleClient and sets it up with default configurations if not explicitly provided, starts a middleware that makes the DolittleClient resources available on the request based on the Tenant-ID header (provided by the platform). See the ExpressJS sample.
  • By default auto discover all aggregate roots, event types, event handlers, projections and embeddings
  • When starting up a DolittleClien, it now performs an initial handshake with the configured Runtime to determine that the version of the SDK and the Runtime are compatible, and retrieves the MicroserviceId to configure its executions context (provided by the platform).

Changed

  • Building a DolittleClient is two steps, namely .setup() and .connect(), to make integrations easier.
  • The configured Tenants are retrieved during the first connection to the Runtime, so the .tenants on the DolittleClient Is no longer an asynchronous call.
  • The builder APIs exposed in the .setup(...) call have been changed so they are all called .register() or .create() and removed the .build() methods
  • The aggregateOf() methods on the client have been changed to an Aggregates property that behaves like the other tenant specific resources.

Fixed

  • The SDK de-duplicates registered types and processors (Event Handlers, ...) so that you can use both automatic discovery and manual registration.

Removed

  • .build() methods no longer exposed on the builder API