Skip to content

Releases: kqito/use-tus

v0.9.0

16 Apr 14:52
fe25b20

Choose a tag to compare

tus-js-client v4.2.1+ Support

This release fixes compatibility with tus-js-client v4.2.1, which introduced
a breaking change in the onSuccess callback signature.

What's Changed

🐛 Fix: onSuccess callback argument forwarding (#62)

tus-js-client v4.2.1 changed the onSuccess signature from () => void to
(payload: OnSuccessPayload) => void.

The internal wrappers in useTus and useTusStore now forward all arguments
transparently via spread (...args), so both the OnSuccessPayload and the
upload instance are correctly passed to your callback regardless of the
tus-js-client version.

setUpload(file, {
  onSuccess: (payload, upload) => {
    console.log(upload.url);
  },
});

Full Changelog

v0.8.4...v0.9.0

v0.8.4

16 Apr 13:56
fa8da87

Choose a tag to compare

Bug Fix: Narrow tus-js-client Peer Dependency Upper Bound

This release restricts the tus-js-client peer dependency to <4.2.0 to
prevent compatibility issues introduced in newer patch versions.

What's Changed

🐛 Bug Fix

  • Narrowed tus-js-client peerDependency upper bound to <4.2.0
    (#XX)
    — Versions >=4.2.0 introduced breaking changes in internal behavior that
    caused unexpected upload failures. Pinning the upper bound ensures stable
    behavior until full compatibility is verified.

🔧 Maintenance

  • Bumped pnpm to the latest version

Full Changelog

v0.8.3...v0.8.4

v0.8.3

20 Aug 12:50
c75a1e4

Choose a tag to compare

Enhanced Security and Build Infrastructure

This release focuses on improving package security through NPM provenance support and strengthening our CI/CD pipeline with better security practices.

What's Changed

🔒 NPM Provenance Support

We've enabled NPM provenance attestation for published packages (#57, #58).
This feature provides cryptographic proof that packages published to npm are built from this repository using GitHub Actions, enhancing supply chain security and
package trustworthiness.

  • Added NPM_CONFIG_PROVENANCE environment variable to publish workflow
  • Fixed permissions configuration to enable OIDC token generation required for provenance

🛡️ Workflow Security Improvements (#56)

  • Pinned all GitHub Actions to specific SHA hashes instead of version tags for improved security
  • This follows GitHub's security best practices to prevent potential supply chain attacks

📦 Dependencies and Infrastructure Updates

  • Updated pnpm to the latest version for better performance
  • Updated Node.js versions in CI matrix to test against current LTS versions
  • Pinned tus-js-client version in devDependencies for consistent development environment

📚 Documentation

  • Improved README readability and structure (#54)

Full Changelog

v0.8.2...v0.8.3

v0.8.2

24 Aug 02:53
5dec07c

Choose a tag to compare

Changes in v0.8.2

Bug Fix: shouldTerminate Argument in abort Function

In this release, we've addressed an issue where the shouldTerminate argument was not being passed to the abort function in the use-tus library. This fix ensures that uploads can now be correctly terminated and the resource can be deleted on the server as intended. This change resolves issue #51.

v0.8.1

18 Dec 10:26
c1822ea

Choose a tag to compare

Changes in v0.8.1

tus-js-client Update

In this release, we've updated the tus-js-client version of peerDependencies to >=2.2.0 and resolving issue #38. Importantly, no APIs or interfaces have been modified with this update, ensuring a smooth transition for our users.
If you have any issues or suggestions, please let us know. We're always looking forward to your feedback!

v0.8.0

26 Nov 04:01

Choose a tag to compare

Overview

In this minor patch release of use-tus, I have made several improvements and changes to enhance the usability and flexibility of the library. The key changes include updates to re-rendering logic, modifications to callback handling, and the addition of new state and property arguments for hooks.

Details

Re-rendering when the url field is changed

In this release, I have updated the re-rendering logic to respond to changes in the url field of the upload instance. Previously, I avoided re-rendering due to concerns of excessive rendering. However, I now allow re-rendering when the url field is changed to accommodate cases where the url needs to be referred according to the react lifecycle.
Example:

  useEffect(() => {
    console.log("useEffect", upload?.url);
  }, [upload?.url]);

Referencing upload within callback

Previously, it was not possible to refer to upload within callbacks such as onSuccess in useTus hooks and useTusStore hooks unless useRef was used. In this release, I have made modifications to allow receiving the upload instance as the last argument of various callbacks.
Example:

setUpload(file, {
  onSuccess: (upload) => {
    console.log(upload.url)
  },
  onError: (error, upload) => {
    console.log(error)
    setTimeout(() => {
      upload.start()
    }, 1000)
  }
})

Additional Changes

  • I have removed some types exported from 'tus-js-client' as 'tus-js-client' has been already defined as peerDependencies.
  • A new isUploading state has been added which will be true when uploading with tus, and false otherwise.
  • I now support passing Upload property arguments for useTus and useTusStore hooks. This is useful for using a customized own Upload class with useTus.
  • Some hooks types have been renamed for better clarity. UseTusUseTusResult has been renamed to TusHooksResult and UseTusOptions to TusHooksOptions.

v0.7.3

21 Oct 10:50
2e73c20

Choose a tag to compare

Overview

  • Fix failed publishing workflow: #41

v0.7.2

21 Oct 10:49
2e73c20

Choose a tag to compare

Overview

  • Change to use esbuild instead of babel: #40

v0.7.1

23 Nov 10:11

Choose a tag to compare

Overview

  • Fix typo in README.md #37

v0.7.0

05 Jun 13:22

Choose a tag to compare

Update

Add support for react version to v18

Changed peerDependencies for use-tus to >=16.8. This will fix issues like #35.

Also, there is no interface changes.

Bug fixs

Change isAbort will be false after remove function is called.

Change the behavior when the remove function of useTus hooks is called.
Until now, calling the remove function initialized the state and then set isAbort to true.
Therefore, the state after calling the remove function was different from the initial value.

So, we will change it so that isAbort remains false after calling the remove function.

Change setUpload function will reset state.

Changed so that isAborted, isSuccess, etc. are initialized when the setUpload function of the useTus hooks is called.

Misc

  • Use FC type instead of VFC to stories components
  • Remove @testing-library/react-hooks from dependencies