Skip to content

Releases: dolittle/JavaScript.SDK

Prerelease v14.3.0-projections.2

09 Apr 10:34
686ea54

Choose a tag to compare

Pre-release

Summary

Update Contracts and fix CHANGELOG for prereleases.

Changed

  • Contracts version reference

Fixed

  • Don't append to changeling when merging in PRs to a prerelease branch
  • Removed the wrong content from CHANGELOG

Prerelease v14.3.0-projections.1

09 Apr 10:17
9ac66e5

Choose a tag to compare

Pre-release

Summary

Upgrade to latest prerelease of Contracts, and implement getting of current projection state from the Runtime through IProjectionStore.

Added

  • The IProjectionStore interface to get current projection states from the Runtime.

Changed

  • Updated to latest prerelease of Contracts (11).
  • Improve some log messages that referred to a type. It was printing the whole class definition.
  • Reset the default log level back to info.

Prerelease v14.3.0-projections.0

30 Mar 14:30
e5c28aa

Choose a tag to compare

Pre-release
  • Added a new package projections in the project.
  • New client.withProjections() for building Projections inline
  • New ProjectionsBuilder with createProjection(projectionId) method that returns a ProjectionBuilder that has 3 methods:
    • inScope(scopeId) for setting the scope (defaults to default scope)
    • forReadModel(Constructor<any>) that takes a class to register as a readmodel for the projection
    • on() with all of the variations for using EventTypes, type arguments or Generations etc
  • I made the API a bit more flat so that you can put the forReadModel(), on() and inScope() methods in whichever order.
    • I don't think we need a constraint on this, if users want to put them in a different order then that's on them. It also doesn't make the code suddenly stop working if you put forReadModel() before inScope() or stuff like that.
    • This also means that the code is more error prone as it's slightly easier to accidentally call forReadModel() twice I guess. This gets checked during the build and it will throw an error in that case.
  • New sample in Samples/Tutorials/Projections with a readmodel of all chefs and all the dishes they've prepared
    • This could be enough for the tutorial too, that can be discussed when we get there
  • Code regarding the decorators is not complete as we should just first focus on the inline
  • The projections project builds, but the whole repo doesn't as I'm waiting for the ProjectionsClient from the new contracts for JS. I've mocked the ProjectionsClient in places with a dummy type.
  • You can delete a readmodel by returning a ProjectionResult.delete in the on() method.

Example how the inline code would look like:

const client = Client
    .forMicroservice('f39b1f61-d360-4675-b859-53c05c87c0e6')
    .withEventTypes(eventTypes => {
        eventTypes.register(DishPrepared);
        eventTypes.register(ChefFired);
    })
    .withProjections(projections => {
        projections.createProjection('4a4c5b13-d4dd-4665-a9df-27b8e9b2054c')
            .forReadModel(Chef)
            .on(DishPrepared, _ => _.keyFromProperty('Chef'), (chef, event, ctx) => {
                console.log(`Handling event ${JSON.stringify(event)} and read model ${JSON.stringify(chef)}`);
                chef.name = event.Chef;
                chef.dishes.push(event.Dish);
                return chef;
            })
            .on(ChefFired, _ => _.keyFromProperty('Chef'), (chef, event, ctx) => {
                console.log(`Firing ${chef.name}`);
                return ProjectionResult.delete;
            })
        })
    .build();

And a diagram on how the builder works:
image

Release v14.2.0

15 Feb 19:20
3802fee

Choose a tag to compare

Summary

Adds aggregates to the SDK in a barebones matter, agnostic to whether there is IoC or not.

Added

  • System for working with aggregates and aggregate roots
  • AggregateOf<> method on Client for creating an aggregate root operation on a specific aggregate
  • Small sample showcasing the aggregates system

Changed

  • docker-compose in samples run with latest runtime versions

Release v14.1.0

17 Nov 09:18
8f2b53d

Choose a tag to compare

Merge pull request #39 from dolittle/grpcjs

Upgrading to @grpc/grpc-js

Release v14.0.1

06 Oct 14:19
1b7f30c

Choose a tag to compare

Merge pull request #36 from dolittle/tutorial-sample

Change Basic sample to be the same as the  tutorial sample

Release v14.0.0

06 Oct 13:14
cedccc1

Choose a tag to compare

Merge pull request #37 from dolittle/fix-api-signatures

Fix api signatures

Release v13.0.1

06 Oct 08:59
2501358

Choose a tag to compare

Merge pull request #35 from dolittle/fix-event-types

Fix event types

Release v13.0.0

05 Oct 07:03
b6a6d95

Choose a tag to compare

Merge pull request #34 from dolittle/fix-api

Fix public api

Release v12.0.0

03 Oct 05:28
8eb8e19

Choose a tag to compare

Merge pull request #33 from dolittle/event-horizons-builder

Fix builder public API to match .NET SDK