Releases: resonatehq/resonate-sdk-ts
Resonate v0.7.1
What's Changed
- retry for ever when connection to the sever by @Tomperez98 in #238
- Set callback timeout to timeout of root promise by @dfarr in #239
Full Changelog: v0.7.0...v0.7.1
Resonate v0.7.0
What's Changed
- Update README by @flossypurse in #147
- Add RFC and LFC by @avillega in #148
- Add asserts by @avillega in #157
- Function support in coroutines by @avillega in #159
- convert to callback style by @avillega in #160
- Rename computation to coroutine by @avillega in #163
- Initial implementation of network abstraction by @avillega in #162
- Local Store by @Tomperez98 in #164
- fix ternaries by @Tomperez98 in #166
- Fix create and claim by @Tomperez98 in #167
- Use kwargs to improve readability by @Tomperez98 in #168
- Change test so they work in bun and npm by @avillega in #171
- Next computation by @avillega in #169
- step function to return an array by @Tomperez98 in #172
- Polishing of resonate inner by @avillega in #173
- Fix local router to be more flexible by @avillega in #175
- Improve assertion msgs on server by @Tomperez98 in #174
- Add resonate class and move server to dev folder by @avillega in #176
- simulator by @Tomperez98 in #177
- Clean up by @Tomperez98 in #180
- Make the Ret type of functions and runs support Awaitable types by @avillega in #182
- Simulation Errors by @Tomperez98 in #181
- Add control flow to signal task completion by @avillega in #183
- fix tests with npm by @Tomperez98 in #185
- Prevent more than one task per rootPromiseId inflight by @Tomperez98 in #184
- Get simulator working by @Tomperez98 in #186
- Update network.ts by @Tomperez98 in #188
- Improves the program flow to prevent race conditions by @avillega in #187
- Implement resonate run, rpc, beginRun, beginRpc by @dfarr in #189
- Subscribe on beginRun by @dfarr in #196
- Next rejects by @avillega in #197
- Set up everything to preview by @avillega in #198
- Simulator with Fibonacci by @Tomperez98 in #194
- skip dst tests by @avillega in #203
- Add the ability to run examples in the browser by @Tomperez98 in #204
- Character Flip Simulation by @Tomperez98 in #205
- Fix concurrency bug by @avillega in #207
- Adds heartbeats by @avillega in #206
- DST Command to package.json by @Tomperez98 in #208
- DST command agnostic by @Tomperez98 in #209
- Merge next into main by @avillega in #202
- hardcode charflip prob to 0 by @Tomperez98 in #210
- Allow string invocation from resonate class and use basic options by @avillega in #211
- Add nursery by @dfarr in #212
- Exec and Delay Methods for the simulator by @Tomperez98 in #213
- Use ReponseFor in network interface by @dfarr in #214
- Fix DST wiring by @Tomperez98 in #215
- Support for basic options by @avillega in #216
- Randomly activate and deactivate processes DST by @Tomperez98 in #217
- Fix never exiting hearbeat by @Tomperez98 in #218
- Implement dropTask by @Tomperez98 in #219
- implements durable sleep by @avillega in #220
- Expose Promises and Schedules low level API by @Tomperez98 in #226
- Do not hearbeat local network by @Tomperez98 in #227
- Handle platform level errors by @dfarr in #221
- Expose unicast and anycast addresses by @Tomperez98 in #228
- Ctx.detached by @avillega in #229
- Adds dependencies by @avillega in #231
- Use logical clock by @Tomperez98 in #234
- Update workflows to node LTS and change verify install by @avillega in #235
- Always use handler and cache responses by @dfarr in #236
Full Changelog: v0.6.3...v0.7.0
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