uppy/packages/@uppy/core
Merlijn Vos f881fa031e
@uppy/core: make upload() idempotent (#5677)
Before

Add a file
Call uppy.upload() but make it fail (set throttling to offline in your browser)
Call uppy.upload() again but no throttling
Events are not fired, endless uploading state.
You must call retryAll() instead but it's better DX if you can simply call upload() again and let us figure it out.

After

upload() behaves like retryAll() when errors occurred in a backwards compatible way.

What if an upload fails and you also add a new file?

Backwards compatible behaviour similar to how it currently works when using the dashboard. In the dashboard you can only click the retry button and once that upload is done you can click upload again to upload the new files.

When a previous upload partially failed, you add a new file, and call upload() this PR makes sure two uploads are done in a row. That does mean you get the 'complete' event twice.
2025-03-13 09:46:24 +01:00
..
src @uppy/core: make upload() idempotent (#5677) 2025-03-13 09:46:24 +01:00
.npmignore meta: exclude tsconfig files from npm bundles (#4916) 2024-02-13 23:21:08 +01:00
CHANGELOG.md Release: uppy@4.13.2 (#5637) 2025-02-03 14:30:45 +00:00
LICENSE Move Core class to @uppy/core package. 2018-06-14 16:31:19 +02:00
package.json build(deps-dev): bump vitest from 1.6.0 to 1.6.1 (#5641) 2025-02-11 10:21:50 +01:00
README.md Fix links (#5492) 2024-10-29 13:54:00 +01:00
tsconfig.build.json Remove "paths" from all tsconfig's (#5572) 2025-01-06 12:14:42 +01:00
tsconfig.json Remove "paths" from all tsconfig's (#5572) 2025-01-06 12:14:42 +01:00

@uppy/core

Uppy logo: a smiling puppy above a pink upwards arrow

npm version CI status for Uppy tests CI status for Companion tests CI status for browser tests

Uppy is a sleek, modular JavaScript file uploader that integrates seamlessly with any application. Its fast, provides a comprehensible API and lets you worry about more important problems than building a file uploader.

  • Fetch files from local disk, remote urls, Google Drive, Dropbox, Instagram, or snap and record selfies with a camera;
  • Preview and edit metadata with a nice interface;
  • Upload to the final destination, optionally process/encode

Read the docs | Try Uppy

Uppy is being developed by the folks at Transloadit, a versatile file encoding service.

Example

import Uppy from '@uppy/core'

const uppy = new Uppy()
uppy.use(SomePlugin)

Installation

$ npm install @uppy/core

Alternatively, you can also use this plugin in a pre-built bundle from Transloadits CDN: Smart CDN. In that case Uppy will attach itself to the global window.Uppy object. See the main Uppy documentation for instructions.

Documentation

Documentation for this plugin can be found on the Uppy website.

License

The MIT License.