You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use axios to send requests in the browser. I recently updated from axios v0.22.0, and I'm noticing that onUploadProgress works a little differently from how it did before — enough that I had to change my code. Previously, the onUploadProgress callback was passed a native ProgressEvent. It's now passed an axiosProgressEvent. I like axiosProgressEvent and all the new properties available on it. However, there's one property that the ProgressEvent had that the axiosProgressEvent doesn't: lengthComputable. Previously, my code was using lengthComputable, so I had to change it. That wasn't hard to do, but I didn't realize I had to for a while, as I didn't see this change mentioned in the release notes. Going forward, I'll probably just use the progress property on the axiosProgressEvent, but it would have been nice not to change existing code.
lengthComputable is still accessible via the event property on the axiosProgressEvent, but I think it should also be a top-level property on the axiosProgressEvent. That would make axiosProgressEvent more like a superset of a native ProgressEvent.
To Reproduce
No response
Code snippet
onUploadProgress: (event)=>{// event no longer has a lengthComputable property.console.log(event);}
Expected behavior
I was expecting the lengthComputable property to continue to exist on the event passed to onUploadProgress. If it's possible, I think it'd be helpful to add lengthComputable to the axiosProgressEvent. Alternatively, this change could be highlighted in the release notes. I think this change was introduced in bdf493c as part of v1.0.0.
Axios Version
1.6.2
Adapter Version
XHR
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
I use axios to send requests in the browser. I recently updated from axios v0.22.0, and I'm noticing that
onUploadProgress
works a little differently from how it did before — enough that I had to change my code. Previously, theonUploadProgress
callback was passed a nativeProgressEvent
. It's now passed anaxiosProgressEvent
. I likeaxiosProgressEvent
and all the new properties available on it. However, there's one property that theProgressEvent
had that theaxiosProgressEvent
doesn't:lengthComputable
. Previously, my code was usinglengthComputable
, so I had to change it. That wasn't hard to do, but I didn't realize I had to for a while, as I didn't see this change mentioned in the release notes. Going forward, I'll probably just use theprogress
property on theaxiosProgressEvent
, but it would have been nice not to change existing code.lengthComputable
is still accessible via theevent
property on theaxiosProgressEvent
, but I think it should also be a top-level property on theaxiosProgressEvent
. That would makeaxiosProgressEvent
more like a superset of a nativeProgressEvent
.To Reproduce
No response
Code snippet
Expected behavior
I was expecting the
lengthComputable
property to continue to exist on the event passed toonUploadProgress
. If it's possible, I think it'd be helpful to addlengthComputable
to theaxiosProgressEvent
. Alternatively, this change could be highlighted in the release notes. I think this change was introduced in bdf493c as part of v1.0.0.Axios Version
1.6.2
Adapter Version
XHR
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: