Proposed Version: v1.0.0
Receiver
- [BREAKING] prevented mutating the file data object
e.dataTransfer.files
, and creates upload object instead. File Object is now assigned and preserved with property of "data" inside the upload object.
second argument in this.props.onFileDrop:
// v0.3.x
files = [
{
id: string,
status: number,
prgroess: number,
src: string,
lastModified: number,
lastModifiedDate: string,
name: string,
size: number,
type: string,
webkitRelativePath: string,
},
...
];
// v1.0.0
uploads = [
{
id: string,
status: number,
prgroess: number,
src: string,
// File Object moved into data property
data: {
lastModified: number,
lastModifiedDate: string,
name: string,
size: number,
type: string,
webkitRelativePath: string,
},
},
...
];
UploadHandler
- checks for the existence of
props.upload
andprops.file
incomponentDidMount
- removed unused
getStatusString
function - allows render function as
children
to provideabort
andupload
function
UploadManager
- [BREAKING] baked-in with debounced on progress callback, accepts
props.progressDebounce
for configuration - [BREAKING] prevented mutating the file data object in
onUploadProgress
andonUploadEnd
- [BREAKING] for
onUploadAbort
,onUploadStart
,onUploadProgress
andonUploadEnd
, the first argument now becomes just the file (upload task) id but not the file object. It minimizes the chance of File object mutation from the callback. - [BREAKING]
props.formDataParser
is DEPRECATED and replaced byprops.uploadDataHandler
- [BREAKING]
props.uploadHeader
is DEPRECATED and replaced byprops.uploadHeaderHandler
- supports
abort
function to an upload task and acceptsprops.onUploadAbort
callback
// v0.3.x
this.props.onUploadStart = (file, { progress, status }) => { ... };
// v1.0.0
this.props.onUploadStart = (fileId, { progress, status }) => { ... };
General
- added more unit test coverage, some are still missing in
UploadManager
- updated basic example to cope with the breaking changes