Skip to content

Releases: resonatehq/resonate-sdk-ts

Resonate v0.6.2

26 Aug 17:07
Compare
Choose a tag to compare

Overview

This is small release that changes the default locking behaviour for top level resonate functions. We are moving from lock by
default to NOT lock by default. This shouldn't be concerning for most applications. To preserve the previous behaviour users can
set the shouldLock option to true at the top level resonate function.

What's Changed

New Contributors

Full Changelog: v0.6.1...v0.6.2

Resonate v0.6.1

19 Aug 19:47
Compare
Choose a tag to compare

Overview

  • This release brings user defined resources to the Resonate SDK along with minor bug fixes and improvements.

User defined resources

User defined resources, allows the users to defined their own resources in a specific resonate context and use it in all
its children contexts. Some examples of resources include database connections, file handles, sockets, etc.

With the introduction of Resources it was necessary to include a way to handle their lifecycle. Inspired by languages like go and zig,
the Resonate now has finalizers, a finalizer is a function that gets executed at the end of the current context, it should be used
mostly for cleanup of resources but it is flexible for other use cases.

What's Changed

  • Add user resources (dependency injection) and finalizers by @avillega in #135
  • Extract runFunc into a stand alone function to reduce repetition by @avillega in #136
  • Reintroduce resonate.options and ctx.options functions by @avillega in #137

Full Changelog: v0.6.0...v0.6.1

Resonate v0.6.0

25 Jul 17:50
3110fa2
Compare
Choose a tag to compare

Release Notes - Version 0.6.0

Overview

The upcoming version of the Resonate SDK significantly changes its architecture and could impact how Resonate is used.
The new Resonate SDK architecture simplifies our codebase while preserving the core functionality of durable promises. By introducing the InvocationHandle and leveraging standard JS Promises, we've addressed the complexities that arose from our previous design.

This new approach offers:

  1. Clearer control flow
  2. Explicit durability guarantees
  3. Simpler implementation

We encourage developers to explore the new SDK and leverage these improved patterns in their applications. Your feedback and innovative use cases will be crucial as we continue to evolve Resonate. Please reach out in the Resonate Community Slack with any questions you might have about this update.

While we still provide most of the same api surface as before this release, like the Context.run function and Resonate.promises Object, users should consider this version a breaking change from v0.5.5

New Features

With the new architecture we introduce the concept of an InvocationHandle. The InvocationHandle holds the resultPromise, which is where we put the result of the user function when resolving the promise created by it. The result Promise is created when invokeLocal is called. invokeLocal uses an async thunk to do the whole process of executing the user code with the proper retries, resolving or rejecting the durable promise, handling all the different kinds of errors, and finally rejecting or resolving the result Promise held by the InvocationHandle. This pattern is mostly enabled by the good support of lexical closures in JS.

Usage of the invocationHandle looks like:

resonate.register('foo', async (ctx: Context) => {
  const handle = await ctx.invokeLocal(async (ctx: Context) => {
    await setTimeout(1000)
    console.log("World")
  }, options({retryPolicy: never()}))

  console.log("Hello")

  let durablePromise = resonate.store.promises.get(handle.invocationId);
  console.log(durablePromise.state) // prints: PENDING

  await handle.result();

  durablePromise = resonate.store.promises.get(handle.invocationId);
  console.log(durablePromise.state) // prints: RESOLVED
})

const topHandle = await resonate.invokeLocal("foo", "foo.0")
await topHandle.result()

Bug Fixes

  • A bug where new DurablePromises could be created on retries has been fixed.

What's Changed

  • Rename some options to improve clarity and intent of them by @avillega in #131
  • Update package-lock.json by @avillega in #134
  • Change resonate architecture to use Invocation Handles by @avillega in #133

Full Changelog: v0.5.5...v0.6.0

Resonate v0.5.5

08 Jul 17:34
ffde4c2
Compare
Choose a tag to compare

Release Notes - Version 0.5.5

Overview

Cleanup and minor refactoring.

New Features

  • Retry Policy is now stored with the durable promise and used in the recovery path.
  • Run can take an FC as an argument #120

Breaking Changes

  • Generator version of the API have been removed, will likely be re-added in the future.

What's Changed

New Contributors

Full Changelog: v0.5.3...v0.5.4

Resonate v0.5.3

22 May 20:12
26afe8a
Compare
Choose a tag to compare

Release Notes - Version 0.5.3

Overview

This is a small release with new features and bug fixes.

New Features

  • Basic auth support in store and cli.

What's Changed

Full Changelog: v0.5.2...v0.5.3

Resonate v0.5.2

08 May 20:14
d4e506e
Compare
Choose a tag to compare

Release Notes - Version 0.5.2

Overview

This is a small release with new features.

New Features

  • Add ctx.sleep to suspend execution for a specified amount of time.
  • Add sync and wait methods to the DurablePromise class.

What's Changed

Full Changelog: v0.5.1...v0.5.2

Resonate v0.5.1

29 Apr 17:39
1f8ab6d
Compare
Choose a tag to compare

Release Notes - Version 0.5.1

Overview

This is a small release containing new features and bug fixes.

New Features

  • CreatedOn: context now exposes the time the underlying durable promise is created, uses invocation created time if the durable option is disabled.

What's Changed

  • Export all necessary items in index.ts by @dfarr in #101
  • Fix created promise on ResonatePromise by @dfarr in #106
    • Created can be used to await the creation of a durable promise in cases where you need to ensure the durable promise has been created, but you do not want to await the completion of the promise.
  • Add createdOn time to context by @dfarr in #107
  • v0.5.1 by @dfarr in #109

Full Changelog: v0.5.0...v0.5.1

Resonate v0.5.0

12 Apr 22:18
0ae2081
Compare
Choose a tag to compare

Release Notes - Version 0.5.0

Overview

This release is a big one for us! We are proud to introduce several new capabilities that will allow you to both mitigate failures and coordinate distributed services in a dead simple way.

New Features

  • Retries: survive transient & intermittent failures with automatic retries of operations.
  • Recoverability: survive crash failures and automatically pick up the operation right where it left off.
  • Schedules: schedule stateful reminders to run operations periodically.
  • Task Framework: distribute tasks across multiple machines for parallel execution and collect the operations’ results.

What's Changed

New Contributors

Full Changelog: https://github.com/resonatehq/resonate-sdk-ts/commits/v0.5.0