Releases: resonatehq/resonate-sdk-ts
Resonate v0.6.3
Overview
This is small release that adds a mechanism to add resources to the Resonate instance. This is a non breaking change.
What's Changed
Full Changelog: v0.6.2...v0.6.3
Resonate v0.6.2
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
- Changing from Slack to Discord by @flossypurse in #141
- Make locks for the top level function opt-in by @avillega in #142
New Contributors
- @flossypurse made their first contribution in #141
Full Changelog: v0.6.1...v0.6.2
Resonate v0.6.1
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
andctx.options
functions by @avillega in #137
Full Changelog: v0.6.0...v0.6.1
Resonate v0.6.0
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:
- Clearer control flow
- Explicit durability guarantees
- 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
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
- Add RetryPolicy Removes IRetry by @avillega in #122
- Store the retry policy with the DurablePromise. by @avillega in #123
- Removes "default" options from the invocation by @avillega in #125
- Replace DurablePromise union type with single type by @avillega in #128
- Add initial support for Function Call types by @avillega in #129
- Remove the generator version of the sdk. by @avillega in #130
New Contributors
Full Changelog: v0.5.3...v0.5.4
Resonate v0.5.3
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
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
andwait
methods to the DurablePromise class.
What's Changed
- Add sync and wait to durable promise class by @dfarr in #112
- Add context sleep by @dfarr in #113
- Bump 0.5 by @dfarr in #114
- Bump version by @dfarr in #115
Full Changelog: v0.5.1...v0.5.2
Resonate v0.5.1
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
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
- feat(release): npm publish package by @guergabo in #1
- add types to readme example by @tristanz in #9
- Move files into core directory by @dfarr in #12
- Adding pr template by @vaibhawvipul in #10
- Add IStorage interface and MemoryStorage implementation by @vaibhawvipul in #14
- Add remote invocation by @dfarr in #16
- feat(rest): update remote store to new promise rest api by @guergabo in #18
- IndexDB RMW by @vaibhawvipul in #15
- Add recovery path by @dfarr in #19
- adding browser test by @vaibhawvipul in #20
- Refactor context and add locks and cache by @dfarr in #22
- Schedules for stores by @vaibhawvipul in #21
- Schedule promises in optimized loop by @dfarr in #28
- Refactor Stores and Storages and implement local locking by @dfarr in #30
- Fix recovery path by @dfarr in #31
- Add promise combinators by @dfarr in #26
- Remote Lock Interface by @vaibhawvipul in #29
- Add get accessor for default schedule store by @dfarr in #34
- Locks and Schedules Create API fix by @vaibhawvipul in #36
- Add schedule function to resonate by @dfarr in #37
- Add store tests for timedout promises by @dfarr in #35
- Add resonate.opts and context.opts functions by @dfarr in #39
- Add typedocs by @dfarr in #42
- SDK DST by @dfarr in #33
- Tweak DST tests by @dfarr in #44
- Add manual create, resolve, and reject functions to resonate class by @dfarr in #45
- Fix Lock tests by @vaibhawvipul in #43
- Add promise on context by @dfarr in #46
- Use default timeout for create and schedule by @dfarr in #47
- Store Unit Tests by @vaibhawvipul in #48
- Explicit checks in tests to ensure that error messages are consistent by @vaibhawvipul in #51
- updating to esm and fix dependencies by @vaibhawvipul in #52
- Verifying Build with helloworld app by @vaibhawvipul in #55
- Resonate Cancelled and Timedout Error by @vaibhawvipul in #56
- fix main build - test by @vaibhawvipul in #57
- Refactor by @dfarr in #54
- adding release workflow by @vaibhawvipul in #63
- bug fixes to release pipeline by @vaibhawvipul in #74
- RELEASE 0.3.2 by @vaibhawvipul in #76
- Reimplement recovery path and add function versioning by @dfarr in #69
- Consolidate errors by @dfarr in #78
- fix(release): build before publishing by @guergabo in #80
- Update rudimentary async and generator tests by @dfarr in #81
- fix(package): first attempt by @guergabo in #82
- Add args to deferred execution promises by @dfarr in #89
- Update release process by @dfarr in #88
- Remove io by @dfarr in #92
- Re-implement schedules by @dfarr in #93
- Move register and run version to options by @dfarr in #94
- feat(ms): update to have correct field name by @guergabo in #84
- fix(retry): export retry so users can configure the retry policy by @guergabo in #96
- fix(versioning): resonate.options should default to 1 by @guergabo in #97
- Add promise combinators and convenience functions by @dfarr in #95
- Add durable and lock options by @dfarr in #100
New Contributors
- @guergabo made their first contribution in #1
- @tristanz made their first contribution in #9
- @vaibhawvipul made their first contribution in #10
Full Changelog: https://github.com/resonatehq/resonate-sdk-ts/commits/v0.5.0