Releases: jonbern/fetch-retry
Permissive wrapping, fix global pollution and export types
Adds permissive wrapping of the fetch
function while retaining the original typing of the wrapped library. This enables us to handle that there are slight variations between fetch
implementations in node.
This change also removes the need for the triple-slash directive which polluted the global namespace with DOM typings. The new version also exports all the types defined in the library for good measure.
Many thanks to @alecmev for providing an excellent PR which made these changes possible.
Type definition of the defaults parameter
Adds type definition for the defaults
parameter in the fetchBuilder
function. Previously it was mistakenly typed as object
which was not very helpful.
Many thanks to @simeonborko for reporting the issue and providing the PR.
Fix type definition to support URL instance
Fixes a bug where URL instances could not be passed as the first argument to the wrapped fetch function.
Many thanks to @afmelsaidy for reporting the issue and providing a pull request.
Adds example on how to use with Node.js fetch and fixes failing tests
- Adds an example on how to use with Node.js fetch API which became available in version 18.
- Fixes failing tests when running Node.js version 18, which failed due to using an older version of node-fetch, resulting in having multiple versions of the
Request
object.
Security updates: minimist
Updated dependencies and fixed security issues reported in dependencies, most notably minimist.
Bug fixes and security fixes
- @pwambach fixed an issue where typescript definition no longer was valid. The fix was to use a default export instead.
- @bamse16 fixed an issue where npm install for
production
andci
would fail due tohusky
being defined as a dev dependency - Security fixes, including a
high
severity issue fornode-fetch
.
Thanks for all the contributions, and apologies for taking a long time to merge the fixes.
Bug fix for node environment
Fixes a bug (#63) introduced in version 5.0.0 where support for the Request
argument was added. The initial implementation introduced a runtime error for the node environment.
Many thanks to @paulrosania for reporting the issue, and to @knotthere for creating a PR with the suggested fix.
Improvements and bug fix
This release includes a bundle of improvements and a bug fix. Due to the renaming of the IRequestInitWithRetry
interface, I have created a new major release to attempt to mitigate any potential breaking changes.
Included in this release:
- Rename
IRequestInitWithRetry
toRequestInitWithRetry
and export the interface (@christophehurpeau) - Use rollup.js to support UMD builds (@dwiyatci)
- Adding support for Request argument (@knotthere)
- Added integration tests for Request argument and URL type (@jonbern)
- Added husky pre-commit script to build project and run tests (@jonbern)
- Upgrade dependencies to fix security warnings
Many thanks for all the contributions for improving this project. It is greatly appreciated! 🙏
Update dependencies to fix security warnings
4.1.1 4.1.1
Adds support for async retryOn function
This version adds support for async retryOn
functions, which enhances the capabilities of the custom retry functionality.
Many thanks to the community for providing the feature request, and especially @x3cion and @deefactorial for providing the PRs.