Releases: lionng429/react-file-uploader
Releases · lionng429/react-file-uploader
v1.0.0
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
v0.4.1
v0.4.0
Changelog
Dependencies
- updated React peer dependency to ^15.0.0 || ^16.0.0
- added back
react
intodependencies
- moved
prop-types
fromdevDependencies
todependencies
Features
Receiver.js
- added file type checking in
onDragEnter
UploadManager.js
- added
reqConfigs
as a prop which acceptsaccept
,method
,timeout
andwithCredentials
properties - added
formDataParser
as a prop which allows custom fields to be sent through in the request (#5) - these changes refer to #9, thanks for the contribution from @digital-flowers
Bug Fixes
- fixed missing DragEvent on Safari (#7)
- fixed unnecessary
key
props inUploadHandler
(#8) - refactored basic example
ESLint
- removed airbnb and related dependencies
- fixed eslint errors
0.3.7
0.3.1
0.3.0
v0.3.0
Changes
General:
- added eslint and fix all eslint warnings and errors
- added test cases with jest (incomplete)
- added debug messages with prefx
react-file-uploader:
with debug - removed invalid use of peerDependencies
- updated basic example to adpoted changes in v0.3.0
- updated ReadMe
Receiver:
- will throw invariant error if browser does not support DragEvent or DataTransfer
- onFileDrop will apply
e
rather thane.target
at the first argument
UploadManager:
- accepts
component
props in string to customize wrapper element - accepts
uploadErrorHandler
props function to customize theerror
&result
forsuperagent.end
method - accepts
uploadHeader
props which will be set as superagent request header - uses
lodash.assign
instead oflodash.merge
for better performance
UploadHandler:
- accepts
component
props in string to customize wrapper element - no longer provides default template if no
children
is provided