Feature request: expose ZipWriter.add promise resolution for progress bars. #446
Replies: 5 comments
-
Did you try to use the option |
Beta Was this translation helpful? Give feedback.
-
Just saw this. I'll try and tap into this now. It's surprising that even with the level set to 0 it still takes a while to write the zip files, but i guess if i knew anything about the format i might not be using a library to write it. |
Beta Was this translation helpful? Give feedback.
-
Okay, I've been testing in Safari this whole time, and it's shockingly slow compared to Chrome. Is Chrome using native Zip APIs and Safari isn't? I'll check the performance tab and see what comes out, but we're talking 1 second vs 35-60 seconds. I'm also noticing some weirdness in Safari where the browser is still responsive, but the HTML/Nodes don't appear to receive text updates (maybe they only repaint after updates have paused for a little bit?) so I'm not able to actually see a progress bar. Also weirdly, the debug console in Safari shows HTTP/Fetch requests going out well after the promises have resolved for HTTPReader calls, so maybe I'm doing the wrapping wrong on those, or the debug tools in Safari might be laggy on the updates. Maybe both? I'll update this thread as I further debug the issue. Thanks in advance for reading through the chaos. PS, I think I remember that Promises resolve differently in different browsers, but I thought it was old Edge and Chrome that had the difference before they moved to universally use Chromium or something like that, not Chrome vs Safari. Something about the process scheduling there. I'll figure it out later. |
Beta Was this translation helpful? Give feedback.
-
There are no long executions on Safari. Not sure how it's doing the process scheduling. All the work appears to go through io.js I don't see anything that looks like it's blocking on the GPU or CPU and the CPU isn't pegging. I put up a notice on our site to just use Firefox or Chrome when downloading large files. Closing this ticket as I don't have a way to verify a lack of progress indicator since it's too fast in Firefox and Chrome and too laggy and weird in Safari. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the late response. I don't really know what's happening on your end. On my end, the progress bars in these 2 demos work as expected in Safari: |
Beta Was this translation helpful? Give feedback.
-
While writing code that zips thousands of image files, I've noticed that the download progress can be monitored by wrapping HttpReader calls in a promises, however the compression of the assets cannot be monitored the same way. Due to request caching, the HttpReader calls also take less than 1 second to resolve, while the ZipWriter process takes quite a while (50 or more seconds in my test case). I'd like to showcase progress somehow to the end user in this case, however there are no updates coming from zip.js (I think?)
This request is for discussion and implementation of an API, callback or promise pattern for gathering feedback on the zip file creation process. I'm digging through the source code now to see if there's a way to do it easily, but suggestions from the authors would also be great.
Beta Was this translation helpful? Give feedback.
All reactions