Skip to content

Releases: kurrent-io/KurrentDB-Client-NodeJS

v1.0.1

28 Apr 05:48
584962e
Compare
Choose a tag to compare

What's Changed

  • opentelemetry: fix span names by @w1am in #411

Full Changelog: v1.0.0...v1.0.1

v1.0.0

31 Mar 17:01
630cc54
Compare
Choose a tag to compare

What's Changed

Rebranding

We have officially rebranded EventStoreDB to KurrentDB. As part of this transition:

  • EventStoreDBClient has been renamed to KurrentDBClient.
  • The connection protocol now supports kurrentdb.

The rebranded client is registered as a new package on NPM as @kurrent/kurrentdb-client

Read Performance Enhancements

The readStream and readAll operations now use the Rust client, significantly improving efficiency and performance.

Server-Side Filtering for readAll

The readAll function now supports server-side filtering using the filter option.

Example Usage:

// Filter by stream name
const stream = client.readAll({
  filter: streamNameFilter({ prefixes: ["someprefix-"] })
});

// Filter by event type
const stream = client.readAll({
  filter: eventTypeFilter({ prefixes: ["someprefix-"] })
});

Other

Breaking Changes ⚠️

Upgrading to @kurrent/kurrentdb-client v1.0.0 introduces breaking changes. Ensure you address these changes to prevent application failures.

1. Client Initialization via Connection String

The traditional class constructor method for KurrentDBClient has been removed. Clients must now be initialized using a connection string, ensuring consistency across our ecosystem.

Migration Example:

- const client = new EventStoreDBClient({
-   { endpoint: "localhost:2113" },
-   { rootCertificate: node.certs.root },
-   { username: "admin", password: "changeit" }
- });

+ const client = KurrentDBClient.connectionString`kurrentdb://localhost:2113?tls=false`;

Note: If you were already using a connection string, no changes are required.

2. Node.js 14 Deprecation

Support for Node.js 14 has been officially dropped, in accordance with the Node.js Release Schedule.

Action Required:

  • Upgrade to Node.js v20 or later (LTS recommended).

3. Migration to Async Iterables for Stream Handling

The event emitter pattern for handling streams has been removed. Streams must now be processed using async iteration.

Migration Example:

// ❌ Event Emitter Pattern (No Longer Supported)
- client
-   .readAll()
-   .on("data", (event) => handleEvent(event))
-   .on("error", (err) => handleError(err));

// ✅ Async Iteration Pattern (Supported)
try {
  const stream = client.readAll();
  for await (const event of stream) {
    handleEvent(event);
  }
} catch (err) {
  handleError(err);
}

4. Move ExpectedRevision to StreamState

await client.appendToStream("stream", eventOne, {
-  expectedRevision: NO_STREAM,
+  streamState: NO_STREAM,
});