dolittle / JavaScript.SDK

Dolittle JavaScript SDK
https://dolittle.io
MIT License
5 stars 2 forks source link

Circular dependencies between @dolittle/sdk.events and @dolittle/sdk.events.[filtering|handling] #27

Closed woksin closed 4 years ago

woksin commented 4 years ago

The package @dolittle/sdk.events depends on both @dolittle/sdk.events.handling and @dolittle/sdk.events.filtering, which again depends on @dolittle/sdk.events which means that they as stand alone packages would fail. Furthermore events.filtering and events.handling is not even in the dependencies list in the @dolittle/sdk.events package.json (which they shouldn't!) This only works now because when using the javascript sdk the devs install the @dolittle/sdk package which includes all the packages, thus when the @dolittle/sdk.events package tried to resolve the @dolittle/sdk.events.[filtering|hanlding] it finds it in the node_moduels folder because @dolittle/sdk has them as dependencies.

woksin commented 4 years ago

The culprit in the events package is the EventStoreBuilder class, it owns the builders for filters and handlers

einari commented 4 years ago

We should look into the ownership here.

General rule of thumb; for dependencies, a more specialized package could take a dependency to a higher order package - but the other way around should not be allowed.

woksin commented 4 years ago

This is now resolved