Skip to content

Releases: dapr/js-sdk

Release v3.1.0

12 Jun 05:20
553431f
Compare
Choose a tag to compare

What's Changed

Features

Fixes

  • fix(state): return an empty array instead of empty string when state.query does not return anything by @salmankhan-prs in #471
  • fix(actor): Configured the delete operation in the state provider by @ruokun-niu in #486
  • fix(ci): explicitly call pre-build while building for publish steps by @shubham1172 in #495

Chores

  • chore(http): replace method "createHTTPMetadataQueryParam" with "createHTTPQueryParam" by @SoTrx in #480
  • chore(proto): update protos for 1.11 by @ItalyPaleAle in #490
  • chore(release): add support to release dev packages @shubham1172 in #493
  • chore(config): updating config API to use v1 endpoint by @shivamkm07 in #496
  • chore(release): prepare for v3.1.0 release by @shubham1172 in #501

New Contributors

Full Changelog: v3.0.0...v3.1.0

Release v3.0.0

20 Mar 16:36
ae34854
Compare
Choose a tag to compare

What's Changed

In this release we focused on cleaning up technical debt and introducing breaking changes. Please read carefully how to migrate your application code for the impacted lines.

Breaking Changes

Deprecation for dapr-client

As discussed in Deprecate dapr-client NPM package, the dapr-client package won't be published anymore from v3.0.0. Please use the newer @dapr/dapr package.

DaprClient's publish method now infers the content-type from data

feat(pubsub): Allow publishing CloudEvents directly by @shubham1172

Introduced by #371, this enhances the publish method to infer the content-type of the data instead of always using application/json. This enables CloudEvents to be published directly. Earlier, CloudEvents were also sent with the content-type application/json which was treated by the Dapr runtime as a JSON value and embedded in another CloudEvent. This means, editing CloudEvent fields (like type) was not possible earlier.

// Publish message to topic as application/cloudevents+json
// You can also use the cloudevent SDK to create cloudevents https://github.com/cloudevents/sdk-javascript
const cloudEvent = {
    specversion: "1.0",
    source: "/some/source",
    type: "example",
    id: "1234",
};
await client.pubsub.publish(pubSubName, topic, cloudEvent);

// Other examples where content-type is automatically inferred correctly.
// Publish message to topic as text/plain
await client.pubsub.publish(pubSubName, topic, "hello, world!");
// Publish message to topic as application/json
await client.pubsub.publish(pubSubName, topic, { hello: "world" });

DaprClient's publish method allows specifying an explicit content-type

feat(pubsub): Allow setting explicit content-type during publish operations by @shubham1172

The content-type used in the publish method can also be explicitly specified instead of inferring from the data itself. This can be useful in scenarios when users want to send a JSON data as plain text, or a CloudEvent as vanilla JSON.

// Publish a JSON message as plain text
const options = { contentType: "text/plain" };
await client.pubsub.publish(pubSubName, topic, { hello: "world" }, options)

Address parity between DaprServer's subscribe method's HTTP and gRPC implementations

fix(pubsub): Fix parity between HTTPs and gRPC pub/sub by @shubham1172

Introduced by #343, this aligns the HTTP and gRPC pubsub systems to return data in the same way for both the normal and rawPayload modes.

The HTTP subscribe callback now returns data after parsing it correctly. Data is either extracted from the body's data field, or the data_base64 field. data_base64 is always expected to be a base64 encoded string, and will be decoded and parsed as JSON if possible. If it is not JSON, it will be returned as a string. If data is not found in either field, the entire body will be returned as-is.

Update DaprClient APIs

chore: Update DaprClient API by @shubham1172

Introduced by #442, this introduces a new API specification for DaprClient. As the Dapr JS SDK grew, so did the the parameters to the different functions. The API has changed to incorporate an options object where it makes sense. More specifically the following APIs are impacted:

  • DaprClient: an options parameter containing details like communication protocols, Dapr sidecar's host and address, etc. is used to instantiate the object. Options can also be empty, which then uses some sane defaults (e.g. new DaprClient()) specified here.
  • IClientState: getBulk method now takes an options parameter to configure the metadata and parallelism.
  • IClientPubSub: publish method now takes an options parameter to configure the metadata and content-type for the data.

Update DaprServer APIs

chore: refactor DaprServer API by @DeepanshuA

Introduced by #444, this is similar to the above change and introduces a new API specification for DaprServer.

DaprServer's instantiation does not need any required parameters now. All the configuration can be passed using an options parameter. Note, logger settings and communication protocol is shared with the underlying DaprClient object unless it has its own such parameters specified.

Features

  • feat(core): Allow payloads larger than 4MB by @XavierGeerinck in #381
  • feat(core): Implement serialization for gRPC and HTTP in a similar way by @XavierGeerinck in #381
  • feat(core): Implement deserialization for gRPC and HTTP in a similary way by @XavierGeerinck in #381
  • feat(core): Support bring your own express instance through the serverHttp option by @XavierGeerinck in #381
  • feat(pubsub): Add bulk publish support by @shubham1172 in #430
  • feat(pubsub): Add retry logic for PubSub and Implement Deserialization generalized by @XavierGeerinck in #453
  • feat(state): Allow passing metadata to client.state.save and return a custom response with error by @shubham1172 in #461

Fixes

  • fix(invoke): Allow invocations for non-string or object data by @XavierGeerinck in #381
  • fix(actors): Error shouldn't cause Client Fail If Actor Non-Existent method called by @DeepanshuA in #422
  • fix(docs): Fix broken link to Setting up a Typescript project by @marcduiker in #450
  • fix(pubsub): Fix metadata setting in gRPC pubsub and bindings by @shubham1172 in #458

Chores

Tests

  • test: Allow writing Dapr logs to file in e2e test shell script by @shubham1172 in #457

New Contributors

Full Changelog: v2.5.0...v3.0.0

Release v2.5.0

03 Nov 06:01
f9571d5
Compare
Choose a tag to compare

What's Changed

Features

  • feat(configuration): Change configuration API response to dictionary by @addjuarez in #345
  • feat(bindings): Pass Metadata in grpc binding invocation by @DeepanshuA in #348
  • feat(client): Report SDK version in user-agent by @ItalyPaleAle in #402
  • feat(invocation): Allow sending and receiving headers during HTTP service invocation by @salmankhan-prs in #408

Fixes

  • fix(docs): Update titles and links for examples of Xavier Geerinck by @giovannism20 in #418
  • fix(invocation): Fix error reporting in HTTP service invocation by @salmankhan-prs in #415

Chores

Tests

  • tests(e2e/ts): End to end test for testing typescript build by @amulyavarote in #388

New Contributors

Full Changelog: v2.4.2...v2.5.0

Release v2.4.2

03 Oct 11:37
3a5ae46
Compare
Choose a tag to compare

What's Changed

Features

Fixes

  • fix(test): remove DAPR_API_TOKEN from test sidecar by @ahmedhesham6 in #376
  • fix(pubsub): pass headers to PubSub system so that users can get the properties by @XavierGeerinck in #389

Chores

  • chore(ci): Add prettier configuration, prettify the codebase, and add to build validation by @shubham1172 in #384
  • chore(dev): Add pre-commit hooks for help in prettier configuration by @XavierGeerinck in #391
  • chores(proto): manage grpc-tools installation via script by @shubham1172 in #392

Documentation

New Contributors

Full Changelog: v2.4.1...v2.4.2

Release v2.4.1

20 Sep 15:50
51b31cd
Compare
Choose a tag to compare

What's Changed

Fixes

  • fix(logger): Propagate logger to sidecar awaiting method by @shubham1172 in #358
  • fix(type): Mark exported types as dependencies in package.json by @shubham1172 in #359

Chores

Documentation

Full Changelog: v2.4.0...v2.4.1

Release v2.4.0

06 Sep 17:13
be0277d
Compare
Choose a tag to compare

What's Changed

Features

  • feat(pubsub): Allow passing metadata to publish and subscribe API by @shubham1172 in #329
  • feat(pubsub): Implement pubsub dead letter & single/multi routing by @XavierGeerinck in #342
  • feat(actors): Allow actors to be configurable by @shubham1172 in #346
  • feat(metadata): Support capabilities field in metadata API by @DeepanshuA in #347

Fixes

  • fix(lock): Renaming distributed lock API UnlockResponse.Status (#336) by @tmacam in #337
  • fix(pubsub): Send correct HTTP response status in subscription event handler by @DeepanshuA in #334
  • fix(client): Reusing same HTTP client instance by @DeepanshuA in #340

Chores

Documentation

New Contributors💖

Full Changelog: v2.3.1...v2.4.0

Release v2.3.1

27 Jul 08:21
7412918
Compare
Choose a tag to compare

What's Changed

Features

Fixes

  • fix(package-lock): bump version by @webup in #309
  • fix(sidecar): sidecar would not be started when getClient was called due to previous abstraction by @XavierGeerinck in #324
  • fix(types/http): use import * as http(s) by @webup in #308

Chores

Documentation

Tests

  • tests(e2e/grpc): add Configuration API test for subscribe all keys by @shubham1172 in #327

New Contributors💖

Full Changelog: v2.3.0...v2.3.1

Release v2.3.0

22 Jun 07:16
5f6fd57
Compare
Choose a tag to compare

What's Changed

For this release, we focused on solving issues to provide a more stable environment and let gRPC become more mature as well through features such as bring-your-own-proto.

Features

Fixes

Documentation

Bugs

Tests & CI

Misc

Bumps

New Contributors 💖

  • @jilichao made their first contribution in #293

Full Changelog: v2.2.1...v2.3.0

Release v2.2.0 - v2.2.1

13 May 07:22
c3eebe0
Compare
Choose a tag to compare

What's Changed

⚠️ This release marks an important update as we are moving away from the dapr-client npm repository towards the @dapr/dapr organization on NPM.

Next to the above, we focused on streamlining the tests as much as possible and becoming up to date with Dapr 1.7.0

Breaking Changes & Deprecations

We are moving from the dapr-client NPM package towards the @dapr/dapr package as per #207

Since this is a breaking change for everyone, a deprecation schedule (#259) is in place, and we will be updating both packages for the coming months. The current plan is to maintain both package until at least version 2.3.0 of the Dapr JS SDK

Features

  • feat: Use environment variables to initialize the Client and Server
  • feat: Configuration API
  • feat: Actors Reminder/Timer TTL
  • feat: State Store Query API: Sync with latest spec

Documentation

  • doc: Make distinction between client and server clearer

Bugs

Tests & CI

  • ci: E2E tests to cancel the pipeline when they fail
  • tests: Fix actors E2E tests

Misc

  • chore: Add license headers everywhere

Bumps

Full

Full Changelog: v2.1.0...v2.2.0-rc.0

Release v2.1.0

23 Feb 17:47
18e46fe
Compare
Choose a tag to compare

What's Changed

This sprint we worked on defining a more sprint-like release cycle to catch up with the latest Dapr features. We made quite some progress and are working to streamline the release process as much as possible.

Features

  • feat: Use environment variables to initialize the Client and Server

Misc

  • feat: Upgrade Node.JS to 16.14.0
  • ci: Resolve tests and fix the build process to catch errors

Bugs

  • bug: resolve an issue with Typescript types

Bumps

Full

Full Changelog: v2.0.1...v2.1.0