feat: add support for Request / Response progress
๐ Linked issue
Issue #45
โ Type of change
- [ ] ๐ Documentation (updates to the documentation, readme, or JSdoc annotations)
- [ ] ๐ Bug fix (a non-breaking change that fixes an issue)
- [ ] ๐ Enhancement (improving an existing functionality like performance)
- [x] โจ New feature (a non-breaking change that adds functionality)
- [ ] ๐งน Chore (updates to the build process or auxiliary tools and libraries)
- [ ] โ ๏ธ Breaking change (fix or feature that would cause existing functionality to change)
๐ Description
Added support for Request / Response progress.
๐ Checklist
- [x] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Codecov Report
Merging #277 (e8af744) into main (da64d78) will increase coverage by
1.10%. The diff coverage is96.82%.
:exclamation: Current head e8af744 differs from pull request most recent head 12c07f1. Consider uploading reports for the commit 12c07f1 to get more accurate results
@@ Coverage Diff @@
## main #277 +/- ##
==========================================
+ Coverage 92.00% 93.10% +1.10%
==========================================
Files 5 5
Lines 450 609 +159
Branches 102 109 +7
==========================================
+ Hits 414 567 +153
- Misses 36 42 +6
| Files | Coverage ฮ | |
|---|---|---|
| src/fetch.ts | 96.50% <96.82%> (+1.10%) |
:arrow_up: |
Hello, I would like to request help for this PR.
For now I only implemented progress for req/response with json.
First commit here working probably only within Browser env. How can I add support for Node streams? Also requesting refactor advices :)
Hi dear @picunada thanks for picking on this and nice idea for initial POC.
I think in order to move this idea forward, i am mainly looking forward to exposing minimum enough hooks in order to be able creating fetchWithProgrsss utility by wrapping $fetch, this way we can both make sure not adding overhead to the core and also implement platform dependent implementations. Also we could directly support a binary transform to allow all kind of responses. Not sure how we can wrap native utils such as response.formData() (one idea might be wrapping Response)
Basically what am i looking forward for next steps is to somehow introduce something like TrackedRequest / TrackedResponse wrapper classes. They might make this feature complete
Hi dear @picunada thanks for picking on this and nice idea for initial POC.
I think in order to move this idea forward, i am mainly looking forward to exposing minimum enough hooks in order to be able creating
fetchWithProgrsssutility by wrapping$fetch, this way we can both make sure not adding overhead to the core and also implement platform dependent implementations. Also we could directly support a binary transform to allow all kind of responses. Not sure how we can wrap native utils such asresponse.formData()(one idea might be wrappingResponse)Basically what am i looking forward for next steps is to somehow introduce something like
TrackedRequest/TrackedResponsewrapper classes. They might make this feature complete
Looking forward to this
Can this PR be expected to be implemented soon? It would be really nice to have on Nuxt 3!