tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.78k stars 2.45k forks source link

[feat] Progress reporting for HTTP API in JS #8333

Open doinkythederp opened 9 months ago

doinkythederp commented 9 months ago

Describe the problem

When using the Tauri HTTP API, I'd like to know how much of a file is downloaded so that I can create a progress bar in my app.

Describe the solution you'd like

It would be nice if the HTTP api's fetch function could take a progress callback.

Alternatives considered

Another option is to provide access to a ReadableStream object as a response type, allowing the developer to access data as it becomes available.

Additional context

No response

FabianLars commented 9 months ago

For file uploads/downloads in v1 we have a plugin for that which also reports progress: https://github.com/tauri-apps/plugins-workspace/tree/v1/plugins/upload - this will also be faster if you want to save the file to disk anyway because it doesn't pipe the data through the IPC.

That said, i doubt that this would be added to v1, but i think it would fit nicely into v2 with the reworked api.

FabianLars commented 9 months ago

/upstream tauri-apps/plugins-workspace