@uppy/xhr-upload
Advanced tools
# @uppy/xhr-upload | ||
## 3.1.0 | ||
Released: 2023-02-13 | ||
Included in: Uppy v3.5.0 | ||
- @uppy/xhr-upload: add `'upload-stalled'` event (Antoine du Hamel / #4247) | ||
## 3.0.4 | ||
@@ -4,0 +11,0 @@ |
@@ -19,3 +19,3 @@ function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } | ||
const packageJson = { | ||
"version": "3.0.4" | ||
"version": "3.1.0" | ||
}; | ||
@@ -262,9 +262,6 @@ import locale from './locale.js'; | ||
const timer = new ProgressTimeout(opts.timeout, () => { | ||
xhr.abort(); | ||
queuedRequest.done(); | ||
const error = new Error(this.i18n('timedOut', { | ||
const error = new Error(this.i18n('uploadStalled', { | ||
seconds: Math.ceil(opts.timeout / 1000) | ||
})); | ||
this.uppy.emit('upload-error', file, error); | ||
reject(error); | ||
this.uppy.emit('upload-stalled', error, [file]); | ||
}); | ||
@@ -537,8 +534,6 @@ const id = nanoid(); | ||
const timer = new ProgressTimeout(this.opts.timeout, () => { | ||
xhr.abort(); | ||
const error = new Error(this.i18n('timedOut', { | ||
const error = new Error(this.i18n('uploadStalled', { | ||
seconds: Math.ceil(this.opts.timeout / 1000) | ||
})); | ||
emitError(error); | ||
reject(error); | ||
this.uppy.emit('upload-stalled', error, files); | ||
}); | ||
@@ -545,0 +540,0 @@ xhr.upload.addEventListener('loadstart', () => { |
export default { | ||
strings: { | ||
// Shown in the Informer if an upload is being canceled because it stalled for too long. | ||
timedOut: 'Upload stalled for %{seconds} seconds, aborting.' | ||
uploadStalled: 'Upload has not made any progress for %{seconds} seconds. You may want to retry it.' | ||
} | ||
}; |
{ | ||
"name": "@uppy/xhr-upload", | ||
"description": "Plain and simple classic HTML multipart form uploads with Uppy, as well as uploads using the HTTP PUT method.", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"license": "MIT", | ||
@@ -28,4 +28,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@uppy/companion-client": "^3.0.2", | ||
"@uppy/utils": "^5.0.2", | ||
"@uppy/companion-client": "^3.1.1", | ||
"@uppy/utils": "^5.1.2", | ||
"nanoid": "^4.0.0" | ||
@@ -38,4 +38,4 @@ }, | ||
"peerDependencies": { | ||
"@uppy/core": "^3.0.4" | ||
"@uppy/core": "^3.0.6" | ||
} | ||
} |
@@ -233,7 +233,4 @@ import BasePlugin from '@uppy/core/lib/BasePlugin.js' | ||
const timer = new ProgressTimeout(opts.timeout, () => { | ||
xhr.abort() | ||
queuedRequest.done() | ||
const error = new Error(this.i18n('timedOut', { seconds: Math.ceil(opts.timeout / 1000) })) | ||
this.uppy.emit('upload-error', file, error) | ||
reject(error) | ||
const error = new Error(this.i18n('uploadStalled', { seconds: Math.ceil(opts.timeout / 1000) })) | ||
this.uppy.emit('upload-stalled', error, [file]) | ||
}) | ||
@@ -520,6 +517,4 @@ | ||
const timer = new ProgressTimeout(this.opts.timeout, () => { | ||
xhr.abort() | ||
const error = new Error(this.i18n('timedOut', { seconds: Math.ceil(this.opts.timeout / 1000) })) | ||
emitError(error) | ||
reject(error) | ||
const error = new Error(this.i18n('uploadStalled', { seconds: Math.ceil(this.opts.timeout / 1000) })) | ||
this.uppy.emit('upload-stalled', error, files) | ||
}) | ||
@@ -526,0 +521,0 @@ |
export default { | ||
strings: { | ||
// Shown in the Informer if an upload is being canceled because it stalled for too long. | ||
timedOut: 'Upload stalled for %{seconds} seconds, aborting.', | ||
uploadStalled: 'Upload has not made any progress for %{seconds} seconds. You may want to retry it.', | ||
}, | ||
} |
@@ -5,5 +5,5 @@ /* eslint-disable */ | ||
type XhrUploadLocale = Locale< | ||
| 'timedOut' | ||
| 'uploadStalled' | ||
> | ||
export default XhrUploadLocale |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
101755
-0.03%1348
-0.74%