Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build(deps): Bump true-myth from 8.4.0 to 8.5.0 #1694

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 2, 2025

Bumps true-myth from 8.4.0 to 8.5.0.

Release notes

Sourced from true-myth's releases.

v8.5.0: Now with retries!

About

This release adds Task.withRetries, an easy-to use function for retrying tasks, as well as a new true-myth/tasks/delay module with common strategies for delays.

True Myth is a TypeScript library for safer handling of null/undefined and both synchronous and asynchronous errors. To install this version:

Package manager Command
npm npm add true-myth@^8.5.0
yarn yarn add true-myth@^8.5.0
pnpm pnpm add true-myth@^8.5.0
bun bun add true-myth@^8.5.0

Changes

(🚀 Enhancement)

(🏠 Internal)

Committers: 1

Discussion

This new utility function, modeled fairly directly on the [the Rust retry crate][crate], lets you retry a Task if it initially rejects.

Although you can customize nearly every part of this, you do not have to. By default, withRetries will immediately retry the callback up to three times:

let fetchTask = Task.withRetries(
  () => Task.fromPromise(fetch('https://true-myth.js.org'))
);

When combined with tools like Task.safe, this can becomes a very concise abstraction:

const fetch = Task.safe(window.fetch);
let result = await Task.withRetries(() => fetch('https://true-myth.js.org'))

You can fully customize its behavior, however:

  1. The retryable callback receives a status object which reports the number of retries and the elapsed time requested. You can use that to determine what actions to take depending on how long you have been trying an operation.

    [!NOTE] The elapsed value will always be greater than or equal to the requested elapsed time after the first try, because even calling setTimeout(() => {}, 0) will take at least one microtask queue tick, and JavaScript runtimes do not guarantee exactly the time it takes for promises to settle or setTimeout to resolve, and the resolution changes over time.

... (truncated)

Changelog

Sourced from true-myth's changelog.

8.5.0 (2025-01-25)

Adds a powerful Task.withRetries utility for retrying tasks, along with a new module, true-myth/task/delay, which provides a bunch of useful strategies for retries. See the docs for more details, and thanks to @​alfierivera for suggesting it!

(:rocket: Enhancement)

(:house: Internal)

Committers: 1

Commits
  • c4d1d56 Release 8.5.0
  • 3143399 Merge pull request #939 from true-myth/task-with-retries-v8.x
  • f589a64 Task: Apply @​ts-ignore 3× compatibility with older TS versions
  • ef3d7a2 [backport] Task: add a new withRetries function
  • 2c4b9f5 Merge pull request #926 from true-myth/v8.x-ci-on-branch
  • 214fd5f internal: Introduce a separate CI job for any 8.x work
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [true-myth](https://github.com/true-myth/true-myth) from 8.4.0 to 8.5.0.
- [Release notes](https://github.com/true-myth/true-myth/releases)
- [Changelog](https://github.com/true-myth/true-myth/blob/main/CHANGELOG.md)
- [Commits](true-myth/true-myth@v8.4.0...v8.5.0)

---
updated-dependencies:
- dependency-name: true-myth
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@github-actions github-actions bot enabled auto-merge (squash) February 2, 2025 12:46
@github-actions github-actions bot merged commit 0b0b362 into main Feb 2, 2025
7 checks passed
@github-actions github-actions bot deleted the dependabot/npm_and_yarn/true-myth-8.5.0 branch February 2, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants